
/* GitHub replica components: repo subpages, issues, PRs, diffs, profiles, settings */
.repo-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 16px; color: var(--gh-fg-muted); }
.repo-breadcrumb a { color: var(--gh-accent-fg); }
.repo-breadcrumb strong { color: var(--gh-fg-default); font-weight: 600; }
.breadcrumb-sep { color: var(--gh-fg-muted); }
.tree-breadcrumb-bar { padding: 8px 16px; margin-bottom: 12px; background: var(--gh-canvas-subtle); border: 1px solid var(--gh-border-default); border-radius: var(--gh-radius); }
.subpage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.subpage-head h1 { margin: 0; font-size: 24px; font-weight: 400; }
.pagination-row { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.table-list { width: 100%; border-collapse: collapse; }
.table-list th { padding: 10px 16px; font-size: 12px; font-weight: 600; color: var(--gh-fg-muted); text-align: left; background: var(--gh-canvas-subtle); border-bottom: 1px solid var(--gh-border-default); }
.table-list td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--gh-border-muted); vertical-align: top; }
.table-list tr:last-child td { border-bottom: 0; }
.table-list a { display: inline-flex; align-items: center; gap: 6px; }

/* Commit list */
.commit-list { overflow: hidden; }
.commit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--gh-border-muted); }
.commit-row:first-child { border-top: 0; }
.commit-row-main { display: flex; align-items: flex-start; gap: 10px; min-width: 0; flex: 1; }
.commit-row-text { display: flex; flex-direction: column; min-width: 0; }
.commit-row-title { font-weight: 600; color: var(--gh-fg-default); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commit-row-meta { font-size: 12px; color: var(--gh-fg-muted); }
.commit-row-actions { display: flex; align-items: center; gap: 4px; }
.commit-sha { padding: 0 6px; font-family: var(--gh-font-mono); font-size: 12px; color: var(--gh-fg-muted); border: 1px solid var(--gh-border-default); border-radius: 4px; }
.commit-page-head { margin-bottom: 24px; }
.commit-page-head h1 { margin: 0 0 12px; font-size: 24px; font-weight: 400; }
.commit-page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--gh-fg-muted); }
.commit-sha-pill { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; font-family: var(--gh-font-mono); font-size: 12px; color: var(--gh-fg-muted); border: 1px solid var(--gh-border-default); border-radius: 4px; }
.commit-message-body { padding: 16px; margin: 16px 0; white-space: pre-wrap; font-family: var(--gh-font-mono); font-size: 13px; background: var(--gh-canvas-subtle); border-radius: var(--gh-radius); }
.commit-parents { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--gh-fg-muted); }
.commit-parents a { font-family: var(--gh-font-mono); color: var(--gh-fg-muted); }

/* Blob */
.blob-box { overflow: hidden; }
.blob-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--gh-canvas-subtle); border-bottom: 1px solid var(--gh-border-default); flex-wrap: wrap; }
.blob-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.blob-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.blob-code-wrap { overflow: auto; max-height: 70vh; }
.blob-code { width: 100%; border-collapse: collapse; font-family: var(--gh-font-mono); font-size: 12px; line-height: 20px; }
.blob-code tr { border-top: 1px solid transparent; }
.blob-code tr:hover { background: var(--gh-canvas-subtle); }
.blob-line-no { width: 1%; padding: 0 10px; color: var(--gh-fg-subtle); text-align: right; vertical-align: top; user-select: none; border-right: 1px solid var(--gh-border-muted); }
.blob-line-no a { color: var(--gh-fg-subtle); }
.blob-line-code { padding: 0 12px; vertical-align: top; }
.blob-line-code pre { margin: 0; font: inherit; white-space: pre; }
.blob-image { padding: 24px; text-align: center; background: var(--gh-canvas-subtle); }
.blob-image img { max-height: 640px; }
.blob-binary { padding: 48px; text-align: center; color: var(--gh-fg-muted); }
.blob-binary p { margin: 12px 0; }

/* Diffs */
.diff-list { display: flex; flex-direction: column; gap: 16px; }
.diff-file { border: 1px solid var(--gh-border-default); border-radius: var(--gh-radius); overflow: hidden; }
.diff-file-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; font-size: 13px; background: var(--gh-canvas-subtle); border-bottom: 1px solid var(--gh-border-default); }
.diff-file-path { display: flex; align-items: center; gap: 6px; min-width: 0; }
.diff-file-path span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff-badge { padding: 0 6px; font-size: 11px; color: var(--gh-fg-muted); border: 1px solid var(--gh-border-default); border-radius: 999px; }
.diff-file-stats { display: flex; gap: 6px; font-family: var(--gh-font-mono); font-size: 12px; }
.additions { color: var(--gh-success-fg); }
.deletions { color: var(--gh-danger-fg); }
.diff-table { width: 100%; border-collapse: collapse; font-family: var(--gh-font-mono); font-size: 12px; line-height: 20px; }
.diff-hunk td { padding: 4px 12px; color: var(--gh-fg-muted); background: var(--gh-accent-subtle); border-top: 1px solid var(--gh-border-muted); border-bottom: 1px solid var(--gh-border-muted); }
.diff-num { width: 1%; min-width: 40px; padding: 0 8px; color: var(--gh-fg-subtle); text-align: right; vertical-align: top; user-select: none; }
.diff-code { padding: 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-add { background: rgba(46, 160, 67, 0.15); }
.diff-del { background: rgba(248, 81, 73, 0.15); }
.diff-add .diff-code, .diff-add .diff-num { color: var(--gh-fg-default); }
.diff-del .diff-code, .diff-del .diff-num { color: var(--gh-fg-default); }

/* Issue / PR */
.issue-head { margin-bottom: 16px; }
.issue-head h1 { margin: 0 0 8px; font-size: 32px; font-weight: 400; line-height: 1.25; }
.issue-number { color: var(--gh-fg-muted); font-weight: 300; }
.issue-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--gh-fg-muted); }
.state-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; font-size: 14px; font-weight: 600; color: #fff; border-radius: 999px; }
.state-badge.open { background: var(--gh-success-emphasis); }
.state-badge.closed { background: var(--gh-danger-emphasis); }
.state-badge.merged { background: var(--gh-done-emphasis); }
.issue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 24px; align-items: start; }
.issue-main { min-width: 0; }
.issue-sidebar { font-size: 13px; }
.sidebar-block { padding: 16px 0; border-bottom: 1px solid var(--gh-border-default); }
.sidebar-block:first-child { padding-top: 0; }
.sidebar-block h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--gh-fg-muted); }
.sidebar-person { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.timeline { border: 1px solid var(--gh-border-default); border-radius: var(--gh-radius); background: var(--gh-canvas-default); }
.comment { padding: 16px; border-bottom: 1px solid var(--gh-border-muted); }
.comment:last-child { border-bottom: 0; }
.comment-author { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--gh-fg-muted); }
.comment-author a { font-weight: 600; color: var(--gh-fg-default); }
.comment-body { font-size: 14px; }
.comment-via { margin-top: 8px; font-size: 11px; color: var(--gh-fg-subtle); }
.comment-form { padding: 16px; border-top: 1px solid var(--gh-border-default); }
.comment-tabs { display: flex; gap: 2px; margin-bottom: 8px; font-size: 13px; }
.comment-tabs span { padding: 4px 10px; border: 1px solid var(--gh-border-default); border-bottom: 0; border-radius: 6px 6px 0 0; background: var(--gh-canvas-subtle); }
.comment-tabs span.selected { background: var(--gh-canvas-default); font-weight: 600; }
.comment-form textarea { border-radius: 0 6px 6px 6px; font-family: var(--gh-font-body); }
.comment-form-actions { display: flex; gap: 8px; margin-top: 8px; }
.signin-prompt { padding: 16px; text-align: center; }
.issue-filter-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--gh-border-default); flex-wrap: wrap; }
.issue-filter-form { display: flex; gap: 6px; align-items: center; }
.issue-filter-form .form-control { width: 260px; }
.issue-state-tabs { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 13px; }
.issue-state-tabs a { display: inline-flex; align-items: center; gap: 4px; color: var(--gh-fg-default); }
.issue-state-tabs a.selected { font-weight: 600; }
.issue-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--gh-border-muted); }
.issue-row:first-of-type { border-top: 0; }
.issue-state { padding-top: 2px; color: var(--gh-success-fg); }
.issue-state.closed { color: var(--gh-danger-fg); }
.issue-state.merged { color: var(--gh-done-fg); }
.issue-main { min-width: 0; flex: 1; }
.issue-title { font-size: 16px; font-weight: 600; color: var(--gh-fg-default); }
.issue-title:hover { color: var(--gh-accent-fg); }
.issue-labels { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.IssueLabel { display: inline-block; padding: 0 7px; font-size: 12px; font-weight: 500; line-height: 20px; border-radius: 999px; }
.issue-meta { font-size: 12px; color: var(--gh-fg-muted); }
.issue-meta code { padding: 0 4px; font-size: 11px; background: var(--gh-canvas-subtle); border-radius: 4px; }
.issue-comments { color: var(--gh-fg-muted); font-size: 13px; }
.issue-comments a { display: inline-flex; align-items: center; gap: 4px; color: var(--gh-fg-muted); }
.pr-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--gh-border-default); }
.pr-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 14px; color: var(--gh-fg-default); border-bottom: 2px solid transparent; }
.pr-tabs a.selected { font-weight: 600; border-bottom-color: #fd8c73; }
.pr-section { margin-top: 24px; }
.pr-section-title { margin: 0 0 12px; font-size: 18px; font-weight: 400; }
.pr-section-title .muted { font-size: 13px; font-weight: 400; }
.merge-box { padding: 16px; margin-bottom: 16px; border: 1px solid var(--gh-border-default); border-radius: var(--gh-radius); }
.merge-status { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; }
.merge-status.ok { color: var(--gh-success-fg); }
.merge-status.conflict { color: var(--gh-danger-fg); }
.merge-box.merged { color: var(--gh-done-fg); }
.merge-box.closed { color: var(--gh-danger-fg); }

/* Releases */
.release-card { margin-bottom: 16px; overflow: hidden; }
.release-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--gh-canvas-subtle); border-bottom: 1px solid var(--gh-border-default); }
.release-title { font-size: 18px; font-weight: 600; }
.release-card-body { padding: 16px; }
.release-assets { display: flex; gap: 8px; margin-top: 16px; }

/* Forms / settings / profile */
.profile-header { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 32px; align-items: start; margin-bottom: 32px; }
.profile-avatar { width: 260px; height: 260px; border-radius: 50%; border: 1px solid var(--gh-border-default); background: var(--gh-canvas-subtle); }
.profile-identity h1 { margin: 0; font-size: 24px; font-weight: 600; }
.profile-username { margin: 0; font-size: 20px; font-weight: 300; color: var(--gh-fg-muted); }
.profile-bio { margin: 12px 0; font-size: 16px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--gh-fg-muted); }
.profile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.profile-actions { display: flex; gap: 8px; margin: 16px 0; }
.profile-tabs { margin-top: 24px; }
.profile-layout { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 32px; }
.pinned-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pinned-repo { padding: 16px; border: 1px solid var(--gh-border-default); border-radius: var(--gh-radius); }
.pinned-repo h3 { margin: 0 0 4px; font-size: 14px; }
.pinned-repo p { margin: 0 0 8px; font-size: 12px; color: var(--gh-fg-muted); }
.contribution-graph { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 10px); gap: 2px; overflow-x: auto; padding: 12px 0; }
.contribution-cell { width: 10px; height: 10px; border-radius: 2px; background: var(--gh-border-subtle); }
.contribution-cell[data-level="1"] { background: #9be9a8; }
.contribution-cell[data-level="2"] { background: #40c463; }
.contribution-cell[data-level="3"] { background: #30a14e; }
.contribution-cell[data-level="4"] { background: #216e39; }
html[data-color-mode="dark"] .contribution-cell[data-level="1"] { background: #0e4429; }
html[data-color-mode="dark"] .contribution-cell[data-level="2"] { background: #006d32; }
html[data-color-mode="dark"] .contribution-cell[data-level="3"] { background: #26a641; }
html[data-color-mode="dark"] .contribution-cell[data-level="4"] { background: #39d353; }
.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-list li { padding: 12px 0; border-bottom: 1px solid var(--gh-border-muted); font-size: 13px; }
.settings-layout { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 32px; }
.settings-nav a { display: block; padding: 6px 10px; margin-bottom: 2px; font-size: 14px; color: var(--gh-fg-default); border-radius: 6px; }
.settings-nav a.selected { font-weight: 600; background: var(--gh-canvas-subtle); }
.settings-card { padding: 24px; border: 1px solid var(--gh-border-default); border-radius: var(--gh-radius); }
.settings-card h1 { margin: 0 0 8px; font-size: 24px; font-weight: 400; }
.settings-card .form-group { max-width: 640px; }
.search-page h1 { font-size: 24px; font-weight: 400; }
.search-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--gh-border-default); }
.search-tabs a { padding: 8px 12px; font-size: 14px; color: var(--gh-fg-default); border-bottom: 2px solid transparent; }
.search-tabs a.selected { font-weight: 600; border-bottom-color: #fd8c73; }
.notification-row { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--gh-border-muted); }
.notification-row.unread { background: var(--gh-accent-subtle); }
.notification-row:first-child { border-top: 0; }
.new-repo-form { max-width: 640px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 8px 12px; font-size: 13px; text-align: left; border-bottom: 1px solid var(--gh-border-muted); }
.site-page h1 { margin-top: 0; }

/* Highlight.js GitHub-ish theme */
.hljs { color: #24292e; background: transparent; }
.hljs-comment, .hljs-quote { color: #6a737d; }
.hljs-keyword, .hljs-selector-tag, .hljs-type { color: #d73a49; }
.hljs-string, .hljs-attr, .hljs-symbol, .hljs-bullet, .hljs-template-tag, .hljs-template-variable { color: #032f62; }
.hljs-number, .hljs-literal { color: #005cc5; }
.hljs-title, .hljs-section, .hljs-name { color: #6f42c1; }
.hljs-built_in, .hljs-builtin-name { color: #005cc5; }
.hljs-variable, .hljs-params { color: #e36209; }
.hljs-meta { color: #6a737d; }
.hljs-tag { color: #22863a; }
.hljs-regexp, .hljs-link { color: #032f62; }
.hljs-deletion { background: #ffeef0; }
.hljs-addition { background: #f0fff4; }
html[data-color-mode="dark"] .hljs { color: #c9d1d9; }
html[data-color-mode="dark"] .hljs-comment, html[data-color-mode="dark"] .hljs-quote { color: #8b949e; }
html[data-color-mode="dark"] .hljs-keyword, html[data-color-mode="dark"] .hljs-selector-tag, html[data-color-mode="dark"] .hljs-type { color: #ff7b72; }
html[data-color-mode="dark"] .hljs-string, html[data-color-mode="dark"] .hljs-attr, html[data-color-mode="dark"] .hljs-symbol, html[data-color-mode="dark"] .hljs-bullet { color: #a5d6ff; }
html[data-color-mode="dark"] .hljs-number, html[data-color-mode="dark"] .hljs-literal { color: #79c0ff; }
html[data-color-mode="dark"] .hljs-title, html[data-color-mode="dark"] .hljs-section, html[data-color-mode="dark"] .hljs-name { color: #d2a8ff; }
html[data-color-mode="dark"] .hljs-built_in, html[data-color-mode="dark"] .hljs-builtin-name { color: #79c0ff; }
html[data-color-mode="dark"] .hljs-variable, html[data-color-mode="dark"] .hljs-params { color: #ffa657; }
html[data-color-mode="dark"] .hljs-tag { color: #7ee787; }

@media (max-width: 1080px) {
  .issue-layout, .profile-layout, .profile-header, .settings-layout { grid-template-columns: 1fr; }
  .issue-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .profile-avatar { width: 180px; height: 180px; }
}
@media (max-width: 768px) {
  .issue-head h1 { font-size: 24px; }
  .issue-row { flex-wrap: wrap; }
  .issue-filter-form .form-control { width: 100%; }
  .issue-state-tabs { margin-left: 0; }
  .pinned-grid { grid-template-columns: 1fr; }
  .issue-sidebar { grid-template-columns: 1fr; }
}
