
.hub-brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--gh-text-bright);
  font-weight: 700;
  font-size: 14px;
  margin-right: 14px;
  padding-right: 14px;
  border-right: 1px solid var(--gh-border);
  transition: opacity 0.2s ease;
}
.hub-brand-link:hover {
  opacity: 0.85;
}
.hub-brand-svg {
  width: 22px;
  height: 22px;
  fill: var(--gh-text-bright);
}
.hub-brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

:root {
  --gh-bg: #0d1117;
  --gh-surface: #161b22;
  --gh-surface-subtle: #21262d;
  --gh-border: #30363d;
  --gh-border-muted: #21262d;
  --gh-text: #c9d1d9;
  --gh-text-bright: #f0f6fc;
  --gh-text-muted: #8b949e;
  --gh-blue: #58a6ff;
  --gh-green: #238636;
  --gh-green-text: #3fb950;
  --gh-purple: #a371f7;
  --gh-red: #f85149;
  --gh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --gh-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="light"], .light-theme, html[data-theme="light"], body.light-theme {
  --gh-bg: #ffffff;
  --gh-surface: #f6f8fa;
  --gh-surface-subtle: #eaeef2;
  --gh-border: #d0d7de;
  --gh-border-muted: #d0d7de;
  --gh-text: #24292f;
  --gh-text-bright: #1f2328;
  --gh-text-muted: #57606a;
  --gh-blue: #0969da;
  --gh-green: #1a7f37;
  --gh-green-text: #1a7f37;
  --gh-purple: #8250df;
  --gh-red: #cf222e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(110, 118, 129, 0.35) rgba(13, 17, 23, 0.5);
}

/* Universal Slim Executive-Tier Scrollbar (Matched to Downloads Dialog Box) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(13, 17, 23, 0.5);
  border-radius: 8px;
  margin: 4px 0;
}

::-webkit-scrollbar-thumb {
  background: rgba(110, 118, 129, 0.35);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(88, 166, 255, 0.6);
  box-shadow: 0 0 8px rgba(88, 166, 255, 0.4);
}

::-webkit-scrollbar-thumb:active {
  background: #58a6ff;
}

/* Light Theme Scrollbars */
[data-theme="light"] *,
.light-theme * {
  scrollbar-color: rgba(140, 149, 159, 0.45) rgba(240, 242, 245, 0.6);
}

[data-theme="light"] ::-webkit-scrollbar-track,
.light-theme ::-webkit-scrollbar-track {
  background: rgba(240, 242, 245, 0.6);
}

[data-theme="light"] ::-webkit-scrollbar-thumb,
.light-theme ::-webkit-scrollbar-thumb {
  background: rgba(140, 149, 159, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover,
.light-theme ::-webkit-scrollbar-thumb:hover {
  background: rgba(9, 105, 218, 0.65);
  box-shadow: 0 0 8px rgba(9, 105, 218, 0.35);
}

html, body {
  background-color: var(--gh-bg);
  color: var(--gh-text);
  font-family: var(--gh-font);
  line-height: 1.5;
  font-size: 14px;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  box-sizing: border-box;
}

/* Top Nav Bar */
.gh-topbar {
  background-color: var(--gh-surface);
  border-bottom: 1px solid var(--gh-border);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gh-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hub-back-btn {
  color: var(--gh-blue);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.hub-back-btn:hover {
  text-decoration: underline;
}

.offline-badge {
  background-color: rgba(63, 185, 80, 0.15);
  border: 1px solid rgba(63, 185, 80, 0.4);
  color: var(--gh-green-text);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* Repo Header */
.repo-header {
  background-color: var(--gh-surface);
  border-bottom: 1px solid var(--gh-border);
  padding: 16px 24px 0 24px;
}

.repo-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.repo-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
}

.repo-title-wrap a {
  color: var(--gh-blue);
  text-decoration: none;
  font-weight: 600;
}

.repo-title-wrap a:hover {
  text-decoration: underline;
}

.repo-visibility {
  border: 1px solid var(--gh-border);
  color: var(--gh-text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 12px;
}

.repo-actions-top {
  display: flex;
  gap: 8px;
}

.gh-btn {
  background-color: var(--gh-surface-subtle);
  border: 1px solid var(--gh-border);
  color: var(--gh-text-bright);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
}

.gh-btn:hover {
  background-color: #30363d;
  border-color: #8b949e;
}

/* Repo Nav Tabs */
.repo-nav-tabs {
  display: flex;
  gap: 8px;
}

.repo-tab {
  padding: 8px 14px;
  color: var(--gh-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.repo-tab:hover {
  color: var(--gh-text-bright);
}

.repo-tab.active {
  color: var(--gh-text-bright);
  border-bottom-color: #f78166;
  font-weight: 600;
}

.tab-counter {
  background-color: rgba(110, 118, 129, 0.4);
  color: var(--gh-text-bright);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Main Layout */
.repo-container {
  max-width: 1280px;
  width: 100%;
  margin: 24px auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.code-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
}

.code-layout > div:first-child {
  min-width: 0;
  max-width: 100%;
}

.repo-sidebar {
  width: 296px;
  min-width: 296px;
  max-width: 296px;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .code-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .repo-sidebar {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

/* Sidebar Components & Meta Items */
.sidebar-section {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--gh-border);
  min-width: 0;
  box-sizing: border-box;
}

.sidebar-heading {
  font-weight: 600;
  font-size: 14px;
  color: var(--gh-text-bright);
  margin-bottom: 8px;
}

.sidebar-heading-link {
  color: var(--gh-text-bright);
  text-decoration: none;
}
.sidebar-heading-link:hover {
  color: var(--gh-blue);
}

.sidebar-desc {
  font-size: 13px;
  color: var(--gh-text);
  margin-bottom: 12px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: break-word;
}

.sidebar-stats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.sidebar-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.sidebar-meta-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  min-width: 0;
}

.sidebar-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  word-break: break-all;
  overflow-wrap: break-word;
}

.sidebar-meta-item .meta-label {
  font-weight: 600;
  color: var(--gh-text-muted);
  font-size: 11px;
}

.sidebar-meta-item .meta-val,
.sidebar-meta-item .sidebar-url {
  word-break: break-all;
  overflow-wrap: break-word;
  max-width: 100%;
  font-size: 12px;
  color: var(--gh-blue);
  text-decoration: none;
}

.sidebar-meta-item .sidebar-url:hover {
  text-decoration: underline;
}

/* File Explorer Box */
.file-box {
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background-color: var(--gh-bg);
  overflow: hidden;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.file-box-header {
  background-color: var(--gh-surface);
  border-bottom: 1px solid var(--gh-border);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

#latestCommitMsg {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

#latestCommitMeta {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 12px;
}

.file-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--gh-border-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.1s;
}

.file-row:last-child {
  border-bottom: none;
}

.file-row:hover {
  background-color: var(--gh-surface-subtle);
}

.file-icon {
  margin-right: 10px;
  color: var(--gh-text-muted);
}

.file-name {
  color: var(--gh-text-bright);
  text-decoration: none;
  font-family: var(--gh-mono);
  font-size: 13px;
}

.file-name:hover {
  color: var(--gh-blue);
  text-decoration: underline;
}

/* Readme Section */
.readme-box {
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background-color: var(--gh-bg);
  overflow: hidden;
}

.readme-header {
  background-color: var(--gh-surface);
  border-bottom: 1px solid var(--gh-border);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.readme-body {
  padding: 32px;
  line-height: 1.6;
}

.readme-body h1, .readme-body h2, .readme-body h3 {
  border-bottom: 1px solid var(--gh-border);
  padding-bottom: 8px;
  margin: 20px 0 12px 0;
  color: var(--gh-text-bright);
}

.readme-body code {
  background-color: rgba(110, 118, 129, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--gh-mono);
  font-size: 12px;
}

.readme-body pre {
  background-color: var(--gh-surface);
  border: 1px solid var(--gh-border);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 14px 0;
}

.readme-body img {
  max-width: 100%;
  border-radius: 4px;
}

/* Auto-linked Mentions & Issues */
.gh-mention {
  color: var(--gh-text-bright);
  font-weight: 600;
  text-decoration: none;
}

.gh-mention:hover {
  color: var(--gh-blue);
  text-decoration: underline;
}

.gh-issue-link {
  color: var(--gh-blue);
  text-decoration: none;
  font-weight: 500;
}

.gh-issue-link:hover {
  text-decoration: underline;
}

.gh-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.gh-pill-latest {
  background-color: rgba(63, 185, 80, 0.15);
  border: 1px solid rgba(63, 185, 80, 0.4);
  color: var(--gh-green-text);
}

/* Code Viewer */
.code-viewer-box {
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background-color: var(--gh-surface);
  overflow: hidden;
  margin-bottom: 24px;
}

.code-viewer-header {
  background-color: var(--gh-surface-subtle);
  border-bottom: 1px solid var(--gh-border);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-viewer-content {
  padding: 16px;
  background-color: var(--gh-bg);
  overflow-x: auto;
  font-family: var(--gh-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
  color: var(--gh-text-bright);
}

/* Issues View */
.issues-container {
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background-color: var(--gh-bg);
  overflow: hidden;
}

.issues-header {
  background-color: var(--gh-surface);
  border-bottom: 1px solid var(--gh-border);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.issues-filter-btn {
  background: none;
  border: none;
  color: var(--gh-text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.issues-filter-btn.active {
  color: var(--gh-text-bright);
  font-weight: 600;
}

.issue-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gh-border-muted);
  display: flex;
  gap: 12px;
  cursor: pointer;
}

.issue-item:hover {
  background-color: var(--gh-surface-subtle);
}

.issue-status-icon {
  color: var(--gh-green-text);
  margin-top: 2px;
}

.issue-status-icon.closed {
  color: var(--gh-purple);
}

.issue-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gh-text-bright);
  margin-bottom: 4px;
}

.issue-title:hover {
  color: var(--gh-blue);
}

.issue-meta {
  font-size: 12px;
  color: var(--gh-text-muted);
}

.issue-label {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}

/* Release View (Matching Pic 3 Pixel-for-Pixel) */
.release-page-item {
  border-bottom: 1px solid var(--gh-border);
  padding-bottom: 32px;
  margin-bottom: 32px;
}

.release-page-item:last-child {
  border-bottom: none;
}

.release-top-breadcrumb {
  font-size: 13px;
  color: var(--gh-text-muted);
  margin-bottom: 8px;
}

.release-top-breadcrumb a {
  color: var(--gh-blue);
  text-decoration: none;
}

.release-main-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--gh-text-bright);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.release-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gh-text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.release-meta-row a {
  color: var(--gh-text-bright);
  text-decoration: none;
  font-weight: 600;
}

.release-meta-row a:hover {
  color: var(--gh-blue);
  text-decoration: underline;
}

.commit-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--gh-surface-subtle);
  border: 1px solid var(--gh-border);
  color: var(--gh-text-bright);
  font-family: var(--gh-mono);
  font-size: 12px;
  text-decoration: none;
}

/* Assets Table (Exact GitHub Replica) */
.gh-assets-table-box {
  margin-top: 24px;
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  background-color: var(--gh-surface);
  overflow: hidden;
}

.gh-assets-header {
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--gh-text-bright);
  border-bottom: 1px solid var(--gh-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--gh-surface-subtle);
}

.gh-assets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.gh-assets-table tr {
  border-bottom: 1px solid var(--gh-border-muted);
  transition: background-color 0.1s;
}

.gh-assets-table tr:last-child {
  border-bottom: none;
}

.gh-assets-table tr:hover {
  background-color: var(--gh-surface-subtle);
}

.gh-assets-table td {
  padding: 10px 16px;
  vertical-align: middle;
}

.asset-name-cell a {
  color: var(--gh-blue);
  text-decoration: none;
  font-family: var(--gh-mono);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.asset-name-cell a:hover {
  text-decoration: underline;
}

.asset-hash-cell {
  color: var(--gh-text-muted);
  font-family: var(--gh-mono);
  font-size: 11px;
}

.asset-size-cell {
  text-align: right;
  color: var(--gh-text-muted);
  white-space: nowrap;
}

.asset-date-cell {
  text-align: right;
  color: var(--gh-text-muted);
  white-space: nowrap;
}

.asset-actions-cell {
  text-align: right;
  white-space: nowrap;
}

/* Offline Connection Banner (When opened as file:///) */
.offline-connect-banner {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.1), rgba(137, 87, 229, 0.1));
  border: 1px solid var(--gh-blue);
  border-radius: 8px;
  padding: 20px;
  margin: 20px auto;
  max-width: 800px;
  text-align: center;
  color: var(--gh-text-bright);
}

.offline-connect-banner h3 {
  margin-bottom: 8px;
  color: var(--gh-blue);
}

.offline-connect-banner code {
  background-color: rgba(110, 118, 129, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--gh-mono);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--gh-surface);
  border: 1px solid var(--gh-border);
  border-radius: 10px;
  max-width: min(760px, 94vw);
  width: 90%;
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 1.15rem;
  color: var(--gh-text-bright);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gh-text-bright);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  background-color: var(--gh-bg);
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  color: var(--gh-text-bright);
  font-size: 0.875rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--gh-blue);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--gh-text-muted);
  margin-top: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
/* Offline Breadcrumbs & Link Interceptors */
.gh-crumb-link {
  color: var(--gh-blue);
  text-decoration: none;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.gh-crumb-link:hover {
  background: rgba(88, 166, 255, 0.15);
  text-decoration: underline;
}
.gh-crumb-sep {
  color: var(--gh-border);
  margin: 0 4px;
}
.gh-crumb-active {
  color: var(--gh-text-bright);
  font-weight: 600;
}
.gh-offline-link {
  color: var(--gh-blue);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dotted var(--gh-blue);
  cursor: pointer;
  transition: all 0.15s ease;
}
.gh-offline-link:hover {
  background: rgba(88, 166, 255, 0.12);
  border-bottom-style: solid;
}
.offline-link-icon {
  font-size: 11px;
  opacity: 0.75;
  margin-left: 2px;
}
.gh-anchor-link {
  color: var(--gh-blue);
  text-decoration: none;
  cursor: pointer;
}
.gh-anchor-link:hover {
  text-decoration: underline;
}

.hub-legal-footer {
  border-top: 1px solid var(--gh-border, #30363d);
  background: var(--gh-bg-secondary, rgba(0, 0, 0, 0.2));
  color: var(--gh-text-muted, #8b949e);
}
[data-theme="light"] .hub-legal-footer {
  background: #f6f8fa;
  border-top-color: #d0d7de;
  color: #57606a;
}

