/*! forgejo-github-theme 1.0.0 — generated by install.sh on 20260803-193909.
    Do not edit this file: it is rebuilt on every install.
    Put your overrides in github-theme.branding.css instead. */

/* === 01-base.css === */
/*!
 * forgejo-github-theme — 01-base
 * Typography, density modes, corner modes, global surface rules.
 * Loaded for every theme (light + dark) via custom/header.tmpl.
 * SPDX-License-Identifier: MIT
 */

/* --------------------------------------------------------------------------
 * Fallbacks: if a user picks a non-GitHub Forgejo theme, the --gh-* tokens are
 * absent. Declare neutral defaults so this stylesheet never renders broken.
 * The theme files override all of these.
 * ------------------------------------------------------------------------ */
:root {
  --gh-canvas: var(--color-body, #fff);
  --gh-canvas-subtle: var(--color-box-header, #f6f8fa);
  --gh-canvas-inset: var(--color-secondary-bg, #f6f8fa);
  --gh-canvas-overlay: var(--color-menu, #fff);
  --gh-border: var(--color-secondary, #d0d7de);
  --gh-border-muted: var(--color-light-border, #d8dee4);
  --gh-border-strong: var(--color-secondary-dark-3, #afb8c1);
  --gh-fg: var(--color-text, #1f2328);
  --gh-fg-muted: var(--color-text-light, #59636e);
  --gh-fg-subtle: var(--color-text-light-1, #6e7781);
  --gh-fg-on-emphasis: #fff;
  --gh-accent: var(--color-primary, #0969da);
  --gh-accent-strong: var(--color-primary-hover, #0757ba);
  --gh-accent-fg: var(--color-primary, #0969da);
  --gh-accent-subtle: var(--color-small-accent, #ddf4ff);
  --gh-success: var(--color-green, #2da44e);
  --gh-success-fg: var(--color-green-dark-1, #1a7f37);
  --gh-danger: var(--color-red, #cf222e);
  --gh-danger-fg: var(--color-red, #cf222e);
  --gh-attention-fg: var(--color-yellow-dark-1, #9a6700);
  --gh-done-fg: var(--color-purple, #8250df);

  --gh-radius: 6px;
  --gh-radius-small: 4px;
  --gh-radius-large: 12px;
  --gh-radius-pill: 2em;
  --gh-row-py: 8px;
  --gh-block-gap: 16px;
  --gh-font-size: 14px;
  --gh-line-height: 1.5;
  --gh-sidebar-width: 316px;
  --gh-header-height: 62px;
  --gh-content-max: 1280px;
  --gh-logo-url: none;
  --gh-logo-width: 32px;

  --gh-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --gh-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Motion — respected by every transition in this stylesheet. */
  --gh-motion-fast: 80ms;
  --gh-motion: 160ms;
  --gh-ease: cubic-bezier(0.33, 1, 0.68, 1);
}

/* --------------------------------------------------------------------------
 * Density modes. Set by theme.js on <html data-gh-density>.
 * ------------------------------------------------------------------------ */
html[data-gh-density="comfortable"] {
  --gh-row-py: 12px;
  --gh-block-gap: 20px;
  --gh-font-size: 14px;
  --gh-line-height: 1.6;
}

html[data-gh-density="compact"] {
  --gh-row-py: 4px;
  --gh-block-gap: 10px;
  --gh-font-size: 13px;
  --gh-line-height: 1.45;
}

/* Corner mode: square strips every radius the theme owns. */
html[data-gh-corners="square"] {
  --gh-radius: 0px;
  --gh-radius-small: 0px;
  --gh-radius-large: 0px;
  --gh-radius-pill: 0px;
}

/* --------------------------------------------------------------------------
 * Typography
 * ------------------------------------------------------------------------ */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--gh-font-sans);
  font-size: var(--gh-font-size);
  line-height: var(--gh-line-height);
  color: var(--gh-fg);
  background-color: var(--gh-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-ligatures: none;
}

code, kbd, pre, samp, tt, .font-mono, .mono {
  font-family: var(--gh-font-mono);
  font-size: 0.9285em; /* 13px at a 14px base, GitHub's ratio */
}

h1, h2, h3, h4, h5, h6,
.ui.header {
  font-family: var(--gh-font-sans);
  color: var(--gh-fg);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.003em;
}

h1, .ui.huge.header { font-size: 2em; }
h2, .ui.large.header { font-size: 1.5em; }
h3 { font-size: 1.25em; }
h4 { font-size: 1em; }
h5 { font-size: 0.875em; }
h6 { font-size: 0.85em; color: var(--gh-fg-muted); }

/* Fluid headings so long repo/issue titles stay readable on small screens. */
.repo-title,
#issue-title,
.issue-title {
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.5rem);
}

a,
.ui.breadcrumb a,
a.ui.label {
  color: var(--gh-accent-fg);
  text-decoration: none;
  transition: color var(--gh-motion-fast) var(--gh-ease);
}

a:hover,
.ui.breadcrumb a:hover {
  color: var(--gh-accent-fg);
  text-decoration: underline;
}

a.muted,
.text.grey a,
a.silenced {
  color: var(--gh-fg-muted);
}

a.muted:hover,
a.silenced:hover {
  color: var(--gh-accent-fg);
  text-decoration: none;
}

hr,
.ui.divider {
  border: 0;
  border-top: 1px solid var(--gh-border-muted);
  background: none;
  margin: var(--gh-block-gap) 0;
}

small, .text.small { font-size: 12px; }
.text.tiny { font-size: 11px; }

/* --------------------------------------------------------------------------
 * Global surfaces — the single biggest win over stock Fomantic.
 * ------------------------------------------------------------------------ */
.page-content {
  padding-top: 0;
}

.ui.segment,
.ui.segments,
.ui.attached.segment,
.ui.card,
.ui.cards > .card,
.ui.menu:not(.tabular):not(.secondary),
.ui.list.divided,
.repository .ui.attached.header {
  background: var(--gh-canvas);
  border-color: var(--gh-border);
  border-radius: var(--gh-radius);
  box-shadow: none;
}

.ui.segment { padding: 16px; }

.ui.attached.segment { border-radius: 0; }
.ui.top.attached.segment,
.ui.top.attached.header { border-radius: var(--gh-radius) var(--gh-radius) 0 0; }
.ui.bottom.attached.segment { border-radius: 0 0 var(--gh-radius) var(--gh-radius); }

.ui.segment.secondary,
.ui.header.attached:not(.segment) {
  background: var(--gh-canvas-subtle);
}

/* Scrollbars — subtle, GitHub-like, both themes. */
* {
  scrollbar-color: var(--gh-border-strong) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gh-border-strong);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--gh-fg-subtle); background-clip: padding-box; }

::selection {
  background: var(--gh-accent-muted, rgb(84 174 255 / 40%));
  color: inherit;
}

/* Images never overflow their container. */
img, svg, video, canvas { max-width: 100%; }

/* Forgejo octicons inherit text colour rather than Fomantic's fixed greys. */
.svg,
svg.svg,
.icon.svg {
  color: inherit;
  vertical-align: text-bottom;
}

/* --------------------------------------------------------------------------
 * Native lazy loading for user content. Forgejo already sets loading="lazy"
 * on avatars; this covers markdown-embedded media without any JS.
 * ------------------------------------------------------------------------ */
.markup img:not([loading]),
.markup iframe:not([loading]) {
  content-visibility: auto;
}

/* --------------------------------------------------------------------------
 * Print — strip chrome, keep content.
 * ------------------------------------------------------------------------ */
@media print {
  #navbar,
  #gh-sidebar,
  #gh-filetree,
  #gh-palette,
  .repo-buttons,
  .ui.pagination.menu,
  #footer {
    display: none !important;
  }

  body { padding: 0 !important; }
  .page-content { padding: 0 !important; }
  a { color: inherit; text-decoration: underline; }
}

/* === 02-layout.css === */
/*!
 * forgejo-github-theme — 02-layout
 * Top navigation, content shell, left navigation, persistent right sidebar,
 * sticky regions and drag-to-resize affordances.
 * SPDX-License-Identifier: MIT
 */

/* ==========================================================================
 * 1. Top navigation
 * ======================================================================== */
#navbar,
.ui.secondary.menu#navbar,
nav#navbar {
  background: var(--gh-header-bg, var(--gh-canvas-subtle));
  color: var(--gh-header-fg, var(--gh-fg));
  border-bottom: 1px solid var(--gh-header-border, var(--gh-border));
  padding: 0 16px;
  min-height: var(--gh-header-height);
  margin: 0;
  box-shadow: none;
  position: relative;
  z-index: 400;
}

html[data-gh-sticky-header="on"] #navbar {
  position: sticky;
  top: 0;
}

#navbar .item,
#navbar a.item,
#navbar .ui.dropdown.item {
  color: var(--gh-header-fg, var(--gh-fg));
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--gh-radius);
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

#navbar .item:hover,
#navbar a.item:hover,
#navbar .ui.dropdown.item:hover {
  background: var(--gh-header-hover, var(--gh-canvas-inset));
  color: var(--gh-header-fg, var(--gh-fg));
}

#navbar .item.active,
#navbar a.item.active {
  background: var(--gh-header-hover, var(--gh-canvas-inset));
}

/* Brand: swap in a custom logo purely with --gh-logo-url. */
#navbar .brand,
#navbar a.item.brand {
  padding-left: 0;
  margin-right: 8px;
}

html[style*="--gh-logo-url"] #navbar .brand img,
:root:not([data-gh-logo="default"]) #navbar .brand img {
  /* When --gh-logo-url resolves to `none` the original image is kept. */
  content: var(--gh-logo-url, normal);
  width: var(--gh-logo-width);
  height: auto;
}

#navbar .brand img,
#navbar .brand svg {
  height: 32px;
  width: auto;
}

/* Navbar search box — GitHub's rounded, keyboard-hinted field. */
#navbar .ui.input > input,
#navbar input[type="search"],
#navbar input[name="q"] {
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  color: var(--gh-fg);
  font-size: 14px;
  height: 30px;
  padding: 0 10px;
  min-width: 240px;
  transition: border-color var(--gh-motion) var(--gh-ease),
              box-shadow var(--gh-motion) var(--gh-ease),
              min-width var(--gh-motion) var(--gh-ease);
}

#navbar .ui.input > input:focus,
#navbar input[name="q"]:focus {
  border-color: var(--gh-accent);
  box-shadow: var(--gh-shadow-focus, 0 0 0 3px rgb(9 105 218 / 30%));
  outline: none;
  min-width: 320px;
}

/* The little "/" hint that theme.js appends to the search field. */
.gh-kbd-hint {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-small);
  color: var(--gh-fg-subtle);
  font-family: var(--gh-font-mono);
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px;
  pointer-events: none;
}

/* Avatar in the navbar */
#navbar .ui.avatar.image,
#navbar img.ui.avatar {
  border-radius: 50%;
  border: 1px solid var(--gh-border-muted);
}

/* ==========================================================================
 * 2. Content shell
 * ======================================================================== */
.full.height > .page-content,
.page-content {
  background: var(--gh-canvas);
}

.page-content > .ui.container,
.ui.container:not(.fluid) {
  max-width: var(--gh-content-max);
  width: 100%;
  margin-inline: auto;
  padding-inline: 16px;
}

/* GitHub keeps the repository chrome full-bleed and the body constrained. */
.repository .repo-header-wrapper,
.repository .ui.tabs.container {
  max-width: none;
}

/* ==========================================================================
 * 3. Persistent right sidebar (#gh-sidebar)
 * Rendered server-side by templates/base/body_inner_pre.tmpl and positioned
 * as a fixed rail so it never fights Forgejo's own grid.
 * ======================================================================== */
#gh-sidebar {
  position: fixed;
  /* Full height. The navbar is a child of <body> and the body padding already
   * insets it from this edge, so the strip beside it belongs to the rail —
   * starting below the navbar left a dead corner above the panel. */
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--gh-sidebar-width);
  z-index: 300;
  display: flex;
  flex-direction: column;
  background: var(--gh-canvas);
  border-left: 1px solid var(--gh-border);
  overflow: hidden;
  contain: layout paint;
}

#gh-sidebar .gh-sidebar-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: var(--gh-block-gap);
  scroll-behavior: smooth;
}

/* Push page content aside so the fixed rail never overlaps it. */
html[data-gh-sidebar="on"] body {
  padding-right: var(--gh-sidebar-width);
}

html[data-gh-sidebar="off"] #gh-sidebar { display: none; }

/* ==========================================================================
 * 3b. Left navigation rail (#gh-nav-rail)
 * The GitLab arrangement: navigation on the left, information on the right.
 * Rendered on every repository page but hidden unless the instance opts in.
 * ======================================================================== */
:root { --gh-navrail-width: 256px; }

#gh-nav-rail { display: none; }

html[data-gh-navrail="on"] #gh-nav-rail {
  position: fixed;
  /* Full height, like GitLab. The navbar is a child of <body> and is already
   * pushed right by the body padding, so the strip beside it belongs to the
   * rail — starting at the navbar's bottom instead left a dead dark corner. */
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--gh-navrail-width);
  z-index: 300;
  display: flex;
  flex-direction: column;
  background: var(--gh-canvas-subtle);
  border-right: 1px solid var(--gh-border);
  overflow: hidden;
  contain: layout paint;
}

html[data-gh-navrail="on"] body { padding-left: var(--gh-navrail-width); }

.gh-navrail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 8px;
  flex: 0 0 auto;
  min-width: 0;
}

.gh-navrail-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: var(--gh-radius);
  background: var(--gh-accent);
  color: var(--gh-fg-on-emphasis);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
}

.gh-navrail-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.gh-navrail-name > a {
  color: var(--gh-fg);
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-navrail-owner a {
  color: var(--gh-fg-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-navrail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0 16px 10px;
  flex: 0 0 auto;
}

.gh-navrail-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border-top: 1px solid var(--gh-border-muted);
}

.gh-navrail-body .gh-links > li > a {
  margin-inline: 0;
  padding: 7px 10px;
  border-radius: var(--gh-radius);
  font-weight: 500;
}

.gh-navrail-body .gh-links > li > a > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gh-navrail-body .gh-links > li > a:hover { background: var(--gh-canvas); }

.gh-navrail-body .gh-links > li > a[aria-current="page"] {
  background: var(--gh-canvas);
  color: var(--gh-fg);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--gh-accent);
}

.gh-navrail-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--gh-border-muted);
  padding: 6px 8px;
}

.gh-navrail-collapse {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--gh-radius);
  background: none;
  color: var(--gh-fg-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

.gh-navrail-collapse:hover { background: var(--gh-canvas); color: var(--gh-fg); }

/* Counters rendered GitLab style: bold number, muted label. */
.gh-stats-links > li > a,
.gh-stats-links > li > .gh-stat-static {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: var(--gh-row-py) 8px;
  margin-inline: -8px;
  border-radius: var(--gh-radius);
  color: var(--gh-fg);
  font-size: 14px;
}

.gh-stats-links > li > a > span,
.gh-stats-links > li > .gh-stat-static > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gh-stats-links b { font-weight: 600; }
.gh-stats-links svg { color: var(--gh-fg-muted); flex: 0 0 auto; }
.gh-stats-links > li > a:hover { background: var(--gh-canvas-subtle); text-decoration: none; }
.gh-stats-links > li > .gh-stat-static { color: var(--gh-fg); cursor: default; }

.gh-block-flush { padding: 0; }
.gh-block-flush + .gh-block { border-top: 0; padding-top: 0; }

/* Clone rows gain a copy button. */
.gh-clone-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.gh-clone-row input { flex: 1 1 auto; min-width: 0; font-family: var(--gh-font-mono); font-size: 12px; }

/* --------------------------------------------------------------------------
 * Left-hand rail.
 * `data-gh-sidebar-side="left"` flips the whole thing: the rail, the body
 * offset, the border it hangs its edge on, the drag handle, and the direction
 * the drawer slides in from on narrow screens.
 * ------------------------------------------------------------------------ */
html[data-gh-sidebar-side="left"] #gh-sidebar {
  right: auto;
  left: 0;
  border-left: 0;
  border-right: 1px solid var(--gh-border);
}

html[data-gh-sidebar-side="left"][data-gh-sidebar="on"] body {
  padding-right: 0;
  padding-left: var(--gh-sidebar-width);
}

html[data-gh-sidebar-side="left"] #gh-sidebar .gh-resizer {
  left: auto;
  right: 0;
}

html[data-gh-sidebar-side="left"] .gh-sidebar-head {
  padding: 10px 16px 10px 12px;
}

/* Drag handle */
#gh-sidebar .gh-resizer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  background: transparent;
  z-index: 2;
  transition: background-color var(--gh-motion) var(--gh-ease);
}

#gh-sidebar .gh-resizer:hover,
#gh-sidebar .gh-resizer[data-dragging="true"] {
  background: var(--gh-accent-muted, var(--gh-accent));
}

#gh-sidebar .gh-resizer:focus-visible {
  outline: 2px solid var(--gh-accent);
  outline-offset: -2px;
}

/* Floating control that brings the rail back. theme.js creates it whenever the
 * rail is hidden or collapsed into a drawer — including on wide screens, which
 * is why these base styles must live outside any media query. Without them the
 * button exists but is invisible, and hiding the sidebar looks permanent. */
.gh-drawer-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 690;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gh-border);
  background: var(--gh-canvas);
  color: var(--gh-fg);
  box-shadow: var(--gh-shadow-large);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--gh-motion-fast) var(--gh-ease),
              transform var(--gh-motion) var(--gh-ease);
}

.gh-drawer-toggle:hover {
  background: var(--gh-canvas-subtle);
  transform: translateY(-1px);
}

.gh-drawer-toggle:focus-visible {
  outline: 2px solid var(--gh-accent);
  outline-offset: 2px;
}

/* Sidebar header with the collapse control */
/* GitLab writes "Project information" as an ordinary heading on the panel's
 * own background. The previous grey uppercase strip read as a separate widget
 * bolted on top of the rail. */
.gh-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 12px 8px 16px;
  border-bottom: 0;
  background: var(--gh-canvas);
  flex: 0 0 auto;
}

.gh-sidebar-head .gh-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--gh-fg);
}

#gh-sidebar .gh-sidebar-scroll { padding-top: 8px; }

/* Sidebar blocks */
.gh-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gh-block + .gh-block {
  border-top: 1px solid var(--gh-border-muted);
  padding-top: var(--gh-block-gap);
}

.gh-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gh-fg);
  margin: 0;
}

.gh-block-title .gh-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--gh-fg-muted);
  background: var(--gh-neutral-subtle, var(--gh-canvas-subtle));
  border-radius: var(--gh-radius-pill);
  padding: 0 7px;
  line-height: 18px;
}

.gh-block p,
.gh-block .gh-muted {
  margin: 0;
  color: var(--gh-fg-muted);
  font-size: 14px;
}

.gh-block a { word-break: break-word; }

.gh-block-empty {
  color: var(--gh-fg-subtle);
  font-size: 13px;
  font-style: italic;
}

/* Key/value rows used by "Repository statistics" */
.gh-kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  font-size: 13px;
}

.gh-kv dt { color: var(--gh-fg-muted); }
.gh-kv dd { margin: 0; color: var(--gh-fg); font-variant-numeric: tabular-nums; }

/* Topic chips */
.gh-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gh-topic {
  display: inline-block;
  padding: 0 10px;
  line-height: 22px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gh-accent-fg);
  background: var(--gh-accent-subtle);
  border-radius: var(--gh-radius-pill);
  transition: background-color var(--gh-motion) var(--gh-ease),
              transform var(--gh-motion) var(--gh-ease);
}

.gh-topic:hover {
  background: var(--gh-accent);
  color: var(--gh-fg-on-emphasis);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Language bar */
.gh-langbar {
  display: flex;
  height: 8px;
  border-radius: var(--gh-radius-pill);
  overflow: hidden;
  background: var(--gh-canvas-subtle);
}

.gh-langbar span { display: block; height: 100%; }

.gh-langlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
}

.gh-langlist li { display: flex; align-items: center; gap: 6px; }

.gh-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}

.gh-langlist .gh-pct { color: var(--gh-fg-muted); font-variant-numeric: tabular-nums; }

/* Contributor / avatar stacks */
.gh-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gh-avatars img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--gh-border-muted);
  transition: transform var(--gh-motion) var(--gh-ease);
}

.gh-avatars a:hover img { transform: scale(1.12); }

/* Latest commit card */
.gh-commit {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
}

.gh-commit .gh-sha {
  font-family: var(--gh-font-mono);
  font-size: 12px;
  color: var(--gh-fg-muted);
}

.gh-commit-msg {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* CI / workflow status pills */
.gh-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--gh-radius-pill);
  border: 1px solid transparent;
}

.gh-status[data-state="success"] { color: var(--gh-success-fg); background: var(--gh-success-subtle); border-color: var(--gh-success-muted, transparent); }
.gh-status[data-state="failure"] { color: var(--gh-danger-fg);  background: var(--gh-danger-subtle);  border-color: var(--gh-danger-muted, transparent); }
.gh-status[data-state="pending"] { color: var(--gh-attention-fg); background: var(--gh-attention-subtle); border-color: var(--gh-attention-muted, transparent); }
.gh-status[data-state="unknown"] { color: var(--gh-fg-muted); background: var(--gh-canvas-subtle); border-color: var(--gh-border); }

/* Sidebar link lists */
.gh-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.gh-links > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: var(--gh-row-py) 8px;
  margin-inline: -8px;
  border-radius: var(--gh-radius);
  color: var(--gh-fg);
  font-size: 14px;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

.gh-links > li > a:hover {
  background: var(--gh-canvas-subtle);
  text-decoration: none;
  color: var(--gh-accent-fg);
}

/* ==========================================================================
 * 4. Left navigation rail (settings / org / admin sub-navigation)
 * ======================================================================== */
.gh-leftnav,
.user.settings .ui.vertical.menu,
.organization.settings .ui.vertical.menu,
.admin .ui.vertical.menu,
.repository.settings .ui.vertical.menu {
  background: transparent;
  border: 0;
  box-shadow: none;
  width: 100%;
}

.user.settings .ui.vertical.menu .item,
.organization.settings .ui.vertical.menu .item,
.admin .ui.vertical.menu .item,
.repository.settings .ui.vertical.menu .item {
  border-radius: var(--gh-radius);
  color: var(--gh-fg);
  font-weight: 500;
  padding: 8px 12px;
  border: 0;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

.user.settings .ui.vertical.menu .item:hover,
.organization.settings .ui.vertical.menu .item:hover,
.admin .ui.vertical.menu .item:hover,
.repository.settings .ui.vertical.menu .item:hover {
  background: var(--gh-canvas-subtle);
}

.user.settings .ui.vertical.menu .item.active,
.organization.settings .ui.vertical.menu .item.active,
.admin .ui.vertical.menu .item.active,
.repository.settings .ui.vertical.menu .item.active {
  background: var(--gh-accent-subtle);
  color: var(--gh-accent-fg);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--gh-accent);
}

html[data-gh-sticky-sidebar="on"] .user.settings .ui.vertical.menu,
html[data-gh-sticky-sidebar="on"] .repository.settings .ui.vertical.menu,
html[data-gh-sticky-sidebar="on"] .admin .ui.vertical.menu {
  position: sticky;
  top: calc(var(--gh-rail-top, var(--gh-header-height)) + 12px);
}

/* ==========================================================================
 * 5. Optional VS Code style file tree (#gh-filetree)
 * ======================================================================== */
#gh-filetree {
  --gh-tree-indent: 14px;
  position: sticky;
  top: calc(var(--gh-rail-top, var(--gh-header-height)) + 12px);
  align-self: flex-start;
  width: var(--gh-filetree-width);
  flex: 0 0 auto;
  max-height: calc(100vh - var(--gh-rail-top, var(--gh-header-height)) - 24px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  background: var(--gh-canvas);
  overflow: hidden;
}

html[data-gh-filetree="off"] #gh-filetree { display: none; }

#gh-filetree .gh-tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gh-border-muted);
  background: var(--gh-canvas-subtle);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gh-fg-muted);
}

#gh-filetree .gh-tree-filter {
  border: 0;
  border-bottom: 1px solid var(--gh-border-muted);
  padding: 6px 10px;
  font-size: 13px;
  background: var(--gh-canvas);
  color: var(--gh-fg);
  width: 100%;
}

#gh-filetree .gh-tree-filter:focus { outline: none; box-shadow: inset 0 -2px 0 var(--gh-accent); }

#gh-filetree .gh-tree-body {
  overflow: auto;
  padding: 4px 0 8px;
  flex: 1 1 auto;
}

#gh-filetree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#gh-filetree li > .gh-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 3px 10px 3px calc(10px + var(--gh-tree-depth, 0) * var(--gh-tree-indent));
  font-size: 13px;
  line-height: 1.6;
  color: var(--gh-fg);
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 0;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

#gh-filetree li > .gh-tree-row:hover { background: var(--gh-canvas-subtle); text-decoration: none; }
#gh-filetree li > .gh-tree-row[aria-current="page"] { background: var(--gh-accent-subtle); color: var(--gh-accent-fg); font-weight: 600; }
#gh-filetree li > .gh-tree-row:focus-visible { outline: 2px solid var(--gh-accent); outline-offset: -2px; }

#gh-filetree .gh-tree-caret {
  flex: 0 0 auto;
  width: 12px;
  transition: transform var(--gh-motion) var(--gh-ease);
}

#gh-filetree li[data-open="true"] > .gh-tree-row .gh-tree-caret { transform: rotate(90deg); }
#gh-filetree li[data-type="blob"] > .gh-tree-row .gh-tree-caret { visibility: hidden; }

#gh-filetree .gh-tree-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
}

.gh-filetree-layout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}

.gh-filetree-layout > .gh-filetree-main { flex: 1 1 auto; min-width: 0; }

/* ==========================================================================
 * 6. Sticky regions
 * ======================================================================== */
html[data-gh-sticky-repo-header="on"] .gh-repo-header {
  position: sticky;
  top: var(--gh-rail-top, 0px);
  z-index: 200;
  background: var(--gh-canvas);
  border-bottom: 1px solid var(--gh-border);
}

html[data-gh-sticky-toolbar="on"] .gh-file-toolbar,
html[data-gh-sticky-toolbar="on"] .repository.file.list .repo-path-wrapper {
  position: sticky;
  top: var(--gh-sticky-offset, var(--gh-header-height));
  z-index: 150;
  background: var(--gh-canvas);
}

/* Diff file headers stay pinned while you scroll through a hunk. */
html[data-gh-sticky-toolbar="on"] .diff-file-box .diff-file-header,
html[data-gh-sticky-toolbar="on"] .file-header.sticky-2nd-row {
  position: sticky;
  top: var(--gh-sticky-offset, var(--gh-header-height));
  z-index: 120;
}

html[data-gh-sticky-review="on"] .gh-review-rail {
  position: sticky;
  top: calc(var(--gh-rail-top, var(--gh-header-height)) + 12px);
  align-self: flex-start;
  max-height: calc(100vh - var(--gh-rail-top, var(--gh-header-height)) - 24px);
  overflow: auto;
}

/* ==========================================================================
 * 7. Footer
 * ======================================================================== */
#footer,
.page-footer {
  background: var(--gh-canvas);
  border-top: 1px solid var(--gh-border-muted);
  color: var(--gh-fg-muted);
  font-size: 12px;
  padding: 32px 16px;
  margin-top: 40px;
}

#footer a { color: var(--gh-accent-fg); }

/* While a resize drag is active, kill text selection everywhere. */
html[data-gh-dragging="true"],
html[data-gh-dragging="true"] * {
  user-select: none !important;
  cursor: col-resize !important;
}

/* ==========================================================================
 * 8. Content spacing when the rails are in play
 *
 * With a fixed rail on each side the available width is already narrow, so
 * centring a 1280px container inside it leaves a wide dead gap on the left —
 * which is what made the content look pushed away from the navigation. Fill
 * the space instead, the way GitLab does.
 * ======================================================================== */
html[data-gh-navrail="on"] .page-content > .ui.container,
html[data-gh-navrail="on"] .ui.container:not(.fluid) {
  max-width: 100%;
  padding-inline: 20px;
}

/* The repository header wrapper is a full-bleed band, not a card: no radius,
 * no separate surface, just a hairline under it. Its background now equals the
 * page canvas (see --color-secondary-nav-bg in the theme files), so the box
 * that used to sit behind the title and tabs is gone. */
.secondary-nav {
  background: var(--gh-canvas);
  border-radius: 0;
  border-bottom: 1px solid var(--gh-border);
  box-shadow: none;
  margin: 0;
}

/* Tighten the vertical rhythm at the top of a repository page. */
.secondary-nav > .ui.container { padding-top: 0; padding-bottom: 0; }

.repository .repo-header,
.gh-repo-header {
  padding-top: 10px;
  padding-bottom: 6px;
}

.repository .ui.tabs.container,
.repository .header-wrapper > .ui.tabs.container { margin-top: 0; }

.page-content.repository { padding-top: 0; }

/* Forgejo's own repository summary sits right under the band. */
.ui.segments.repository-summary { margin-top: 12px !important; }

/* === 03-components.css === */
/*!
 * forgejo-github-theme — 03-components
 * Buttons, dropdowns, badges, labels, forms, dialogs, cards, search,
 * notifications, pagination, breadcrumbs, tables, timeline, tabs, tooltips.
 *
 * Fomantic UI ships very high-specificity rules (`.ui.button` chains). A small
 * number of `!important` declarations below are load-bearing: without them the
 * upstream gradient/box-shadow buttons win. They are deliberate, not lazy.
 * SPDX-License-Identifier: MIT
 */

/* ==========================================================================
 * Buttons
 * ======================================================================== */
.ui.button,
.ui.buttons .button,
button.ui.button,
a.ui.button {
  font-family: var(--gh-font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  padding: 5px 16px;
  border-radius: var(--gh-radius);
  border: 1px solid var(--gh-border);
  background: var(--gh-canvas-subtle) !important;
  color: var(--gh-fg) !important;
  background-image: none !important;
  box-shadow: var(--gh-shadow-small);
  text-shadow: none;
  transition: background-color var(--gh-motion-fast) var(--gh-ease),
              border-color var(--gh-motion-fast) var(--gh-ease),
              transform var(--gh-motion-fast) var(--gh-ease);
}

.ui.button:hover,
a.ui.button:hover {
  background: var(--gh-canvas-inset) !important;
  border-color: var(--gh-border-strong);
  color: var(--gh-fg) !important;
}

.ui.button:active { transform: translateY(0.5px); }

.ui.button:disabled,
.ui.button.disabled,
.ui.disabled.button {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.ui.tiny.button { font-size: 12px; padding: 3px 12px; }
.ui.small.button { font-size: 12px; padding: 3px 12px; }
.ui.large.button { font-size: 16px; padding: 9px 20px; }
.ui.fluid.button { width: 100%; }

/* Primary / green — GitHub's "call to action" button. */
.ui.primary.button,
.ui.green.button,
.ui.positive.button,
button.ui.primary.button {
  background: var(--gh-success) !important;
  border-color: rgb(31 35 40 / 15%);
  color: #fff !important;
  box-shadow: var(--gh-shadow-inset), var(--gh-shadow-small);
}

.ui.primary.button:hover,
.ui.green.button:hover,
.ui.positive.button:hover {
  background: var(--gh-success-strong, var(--gh-success)) !important;
  color: #fff !important;
}

/* Accent (blue) — used for "New pull request" style actions. */
.ui.blue.button,
.ui.button.gh-accent {
  background: var(--gh-accent) !important;
  border-color: rgb(31 35 40 / 15%);
  color: #fff !important;
}

.ui.blue.button:hover,
.ui.button.gh-accent:hover {
  background: var(--gh-accent-strong) !important;
  color: #fff !important;
}

/* Destructive */
.ui.red.button,
.ui.negative.button,
.ui.button.delete-button {
  background: var(--gh-canvas-subtle) !important;
  color: var(--gh-danger-fg) !important;
  border-color: var(--gh-border);
}

.ui.red.button:hover,
.ui.negative.button:hover,
.ui.button.delete-button:hover {
  background: var(--gh-danger) !important;
  color: #fff !important;
  border-color: rgb(31 35 40 / 15%);
}

/* Basic / ghost */
.ui.basic.button {
  background: transparent !important;
  border-color: var(--gh-border);
  box-shadow: none;
  color: var(--gh-fg) !important;
}

.ui.basic.button:hover { background: var(--gh-canvas-subtle) !important; }

/* Grouped buttons — GitHub joins clone/branch controls seamlessly. */
.ui.buttons .button:first-child { border-radius: var(--gh-radius) 0 0 var(--gh-radius); }
.ui.buttons .button:last-child { border-radius: 0 var(--gh-radius) var(--gh-radius) 0; }
.ui.buttons .button:not(:first-child) { margin-left: -1px; }
.ui.buttons .button:hover { z-index: 2; }

/* Icon-only buttons (comment actions, kebab menus) */
.ui.button.compact,
.ui.icon.button:not(.ui.labeled) {
  padding: 5px 8px;
}

/* ==========================================================================
 * Dropdowns / menus
 * ======================================================================== */
.ui.dropdown .menu,
.ui.menu .ui.dropdown .menu,
.ui.selection.dropdown .menu {
  background: var(--gh-canvas-overlay);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-large);
  box-shadow: var(--gh-shadow-large);
  padding: 4px 0;
  margin-top: 4px;
  overflow: hidden;
}

.ui.dropdown .menu > .item {
  color: var(--gh-fg);
  font-size: 14px;
  padding: 6px 12px !important;
  border: 0;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

/* Three different states, three different weights of emphasis:
 *   :hover     pointer feedback           — quiet grey
 *   .active    keyboard cursor            — accent tint
 *   .selected  the value already chosen   — semibold, no fill
 *
 * Filling `.selected` with solid accent painted the current branch as a bright
 * blue bar across the whole branch selector. Only the keyboard cursor earns
 * colour; the current value earns weight. */
.ui.dropdown .menu > .item:hover {
  background: var(--gh-canvas-subtle);
  color: var(--gh-fg);
}

.ui.dropdown .menu > .item.active {
  background: var(--gh-accent-subtle);
  color: var(--gh-accent-fg);
}

.ui.dropdown .menu > .item.selected {
  background: transparent;
  color: var(--gh-fg);
  font-weight: 600;
}

.ui.dropdown .menu > .item.selected:hover,
.ui.dropdown .menu > .item.selected.active {
  background: var(--gh-canvas-subtle);
}

.ui.dropdown .menu > .item:hover a,
.ui.dropdown .menu > .item.active a,
.ui.dropdown .menu > .item.selected a { color: inherit; }

.ui.dropdown .menu > .header {
  color: var(--gh-fg-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  padding: 8px 12px 4px;
}

.ui.dropdown .menu > .divider { border-top: 1px solid var(--gh-border-muted); margin: 4px 0; }

.ui.dropdown .menu > .input,
.ui.dropdown .menu .ui.icon.input > input {
  margin: 4px 8px 8px;
  width: calc(100% - 16px);
}

.ui.selection.dropdown {
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  color: var(--gh-fg);
  min-height: 32px;
  padding: 5px 30px 5px 12px;
  font-size: 14px;
  box-shadow: var(--gh-shadow-small);
}

.ui.selection.dropdown:hover { border-color: var(--gh-border-strong); }

/* ==========================================================================
 * Labels & badges
 * ======================================================================== */
.ui.label,
.ui.labels .label {
  background: var(--gh-neutral-subtle, var(--gh-canvas-subtle));
  border: 1px solid transparent;
  border-radius: var(--gh-radius-pill);
  color: var(--gh-fg-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  padding: 0 10px;
  box-shadow: none;
  text-shadow: none;
  transition: filter var(--gh-motion) var(--gh-ease);
}

a.ui.label:hover { filter: brightness(0.94); text-decoration: none; }

/* Issue labels keep their user-chosen colour but gain GitHub geometry. */
.ui.label.scope-left,
.ui.label.scope-right { border-radius: var(--gh-radius-pill); }
.ui.label.scope-left { border-radius: var(--gh-radius-pill) 0 0 var(--gh-radius-pill); padding-right: 6px; }
.ui.label.scope-right { border-radius: 0 var(--gh-radius-pill) var(--gh-radius-pill) 0; padding-left: 6px; }

.ui.basic.label {
  background: transparent;
  border: 1px solid var(--gh-border);
  color: var(--gh-fg-muted);
}

/* Counter badge — the number next to "Issues" / "Pull requests" tabs. */
.ui.label.gh-counter,
.ui.circular.label,
.ui.tabs .item .ui.label,
.overflow-menu .item .ui.label {
  background: var(--gh-neutral-subtle, var(--gh-canvas-inset));
  color: var(--gh-fg-muted);
  border-radius: var(--gh-radius-pill);
  font-size: 12px;
  font-weight: 500;
  padding: 0 6px;
  min-width: 20px;
  text-align: center;
}

/* State badges (Open / Closed / Merged / Draft) */
.issue-state-label,
.gh-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  padding: 5px 12px;
  border-radius: var(--gh-radius-pill);
  color: #fff;
}

.gh-state[data-state="open"] { background: var(--gh-success); }
.gh-state[data-state="closed"] { background: var(--gh-danger); }
.gh-state[data-state="merged"] { background: var(--gh-done); }
.gh-state[data-state="draft"] { background: var(--gh-neutral-emphasis); }

/* ==========================================================================
 * Forms
 * ======================================================================== */
.ui.form input[type="text"],
.ui.form input[type="email"],
.ui.form input[type="password"],
.ui.form input[type="search"],
.ui.form input[type="url"],
.ui.form input[type="number"],
.ui.form textarea,
.ui.input > input,
input.gh-input,
textarea.gh-input {
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  color: var(--gh-fg);
  font-family: var(--gh-font-sans);
  font-size: 14px;
  line-height: 20px;
  padding: 5px 12px;
  box-shadow: none;
  transition: border-color var(--gh-motion) var(--gh-ease),
              box-shadow var(--gh-motion) var(--gh-ease);
}

.ui.form textarea { min-height: 100px; line-height: 1.5; }

.ui.form input:focus,
.ui.form textarea:focus,
.ui.input > input:focus {
  border-color: var(--gh-accent);
  box-shadow: var(--gh-shadow-focus, 0 0 0 3px rgb(9 105 218 / 30%));
  outline: none;
}

.ui.form input::placeholder,
.ui.form textarea::placeholder { color: var(--gh-fg-subtle); }

.ui.form .field > label {
  color: var(--gh-fg);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.ui.form .field.error input,
.ui.form .field.error textarea {
  border-color: var(--gh-danger);
  background: var(--gh-danger-subtle);
}

.ui.form .ui.checkbox label,
.ui.checkbox label { color: var(--gh-fg); font-size: 14px; }

.ui.checkbox input:checked ~ .box::before,
.ui.checkbox input:checked ~ label::before {
  background: var(--gh-accent);
  border-color: var(--gh-accent);
}

.ui.toggle.checkbox input:checked ~ .box::before,
.ui.toggle.checkbox input:checked ~ label::before { background: var(--gh-accent) !important; }

/* Comment editor toolbar */
.ui.form .combo-markdown-editor,
.combo-markdown-editor {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  background: var(--gh-canvas);
  overflow: hidden;
}

.combo-markdown-editor .markdown-toolbar,
.combo-markdown-editor .editor-toolbar {
  background: var(--gh-canvas-subtle);
  border-bottom: 1px solid var(--gh-border-muted);
  padding: 4px 8px;
}

.combo-markdown-editor textarea { border: 0 !important; box-shadow: none !important; }

/* ==========================================================================
 * Dialogs / modals
 * ======================================================================== */
.ui.modal,
.ui.modal > .content,
dialog.gh-dialog {
  background: var(--gh-canvas-overlay);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-large);
  box-shadow: var(--gh-shadow-large);
  color: var(--gh-fg);
}

.ui.modal > .header {
  background: var(--gh-canvas-subtle);
  border-bottom: 1px solid var(--gh-border-muted);
  color: var(--gh-fg);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--gh-radius-large) var(--gh-radius-large) 0 0;
  padding: 12px 16px;
}

.ui.modal > .actions {
  background: var(--gh-canvas-subtle);
  border-top: 1px solid var(--gh-border-muted);
  padding: 12px 16px;
  border-radius: 0 0 var(--gh-radius-large) var(--gh-radius-large);
}

.ui.dimmer { background: var(--color-overlay-backdrop, rgb(31 35 40 / 50%)); }

/* ==========================================================================
 * Cards
 * ======================================================================== */
.gh-card,
.ui.card {
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  box-shadow: none;
  padding: 16px;
  transition: border-color var(--gh-motion) var(--gh-ease),
              box-shadow var(--gh-motion) var(--gh-ease),
              transform var(--gh-motion) var(--gh-ease);
}

.gh-card:hover {
  border-color: var(--gh-border-strong);
  box-shadow: var(--gh-shadow-medium);
}

.gh-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gh-accent-fg);
  margin: 0 0 4px;
}

.gh-card-desc {
  color: var(--gh-fg-muted);
  font-size: 12px;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gh-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--gh-fg-muted);
  font-size: 12px;
}

/* ==========================================================================
 * Search
 * ======================================================================== */
.ui.search > .results,
.ui.search .results {
  background: var(--gh-canvas-overlay);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-large);
  box-shadow: var(--gh-shadow-large);
}

.ui.search .results .result { border-bottom: 1px solid var(--gh-border-muted); padding: 8px 12px; }
.ui.search .results .result:hover { background: var(--gh-canvas-subtle); }
.ui.search .results .result .title { color: var(--gh-fg); font-weight: 600; }

/* Command palette (Ctrl+K) */
#gh-palette[hidden] { display: none !important; }

#gh-palette {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: var(--color-overlay-backdrop, rgb(31 35 40 / 50%));
  animation: gh-fade var(--gh-motion) var(--gh-ease);
}

.gh-palette-box {
  width: min(640px, 100%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--gh-canvas-overlay);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-large);
  box-shadow: var(--gh-shadow-large);
  overflow: hidden;
  animation: gh-pop var(--gh-motion) var(--gh-ease);
}

.gh-palette-box input {
  border: 0;
  border-bottom: 1px solid var(--gh-border-muted);
  background: transparent;
  color: var(--gh-fg);
  font-size: 16px;
  padding: 14px 16px;
  width: 100%;
}

.gh-palette-box input:focus { outline: none; }

.gh-palette-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.gh-palette-list li { border-radius: var(--gh-radius); }

.gh-palette-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  color: var(--gh-fg);
  font-size: 14px;
  text-align: left;
  border-radius: var(--gh-radius);
  cursor: pointer;
}

.gh-palette-list li[aria-selected="true"] button,
.gh-palette-list button:hover {
  background: var(--gh-accent);
  color: var(--gh-fg-on-emphasis);
}

.gh-palette-list .gh-palette-group {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gh-fg-subtle);
  padding: 10px 10px 4px;
}

.gh-palette-list .gh-palette-hint {
  margin-left: auto;
  font-size: 11px;
  color: inherit;
  opacity: 0.7;
}

.gh-palette-foot {
  border-top: 1px solid var(--gh-border-muted);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--gh-fg-subtle);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.gh-palette-empty { padding: 24px 16px; text-align: center; color: var(--gh-fg-muted); }

@keyframes gh-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gh-pop {
  from { opacity: 0; transform: translateY(-8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
 * Notifications
 * ======================================================================== */
.ui.message,
.ui.info.message,
.ui.warning.message,
.ui.error.message,
.ui.success.message,
.ui.negative.message,
.ui.positive.message {
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  box-shadow: none;
  color: var(--gh-fg);
  font-size: 14px;
  padding: 12px 16px;
}

.ui.info.message { background: var(--color-info-bg); border-color: var(--color-info-border); color: var(--color-info-text); }
.ui.warning.message { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: var(--color-warning-text); }
.ui.error.message,
.ui.negative.message { background: var(--color-error-bg); border-color: var(--color-error-border); color: var(--color-error-text); }
.ui.success.message,
.ui.positive.message { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success-text); }

.notifications-item,
.notification-item {
  border-bottom: 1px solid var(--gh-border-muted);
  padding: var(--gh-row-py) 12px;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

.notifications-item:hover { background: var(--gh-canvas-subtle); }

/* Unread indicator dot on the navbar bell */
#navbar .item .notification_count,
.notification_count {
  background: var(--gh-accent) !important;
  color: #fff !important;
  border-radius: var(--gh-radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  min-width: 16px;
  padding: 0 4px;
}

/* ==========================================================================
 * Pagination
 * ======================================================================== */
.ui.pagination.menu {
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: 4px;
  display: inline-flex;
  margin: 24px auto;
}

.ui.pagination.menu .item {
  background: transparent;
  border: 1px solid transparent !important;
  border-radius: var(--gh-radius);
  color: var(--gh-accent-fg);
  font-size: 14px;
  min-width: 32px;
  justify-content: center;
  padding: 5px 10px;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

.ui.pagination.menu .item:hover { background: var(--gh-canvas-subtle); }

.ui.pagination.menu .item.active {
  background: var(--gh-accent) !important;
  border-color: var(--gh-accent) !important;
  color: #fff !important;
  font-weight: 600;
}

.ui.pagination.menu .item.disabled { color: var(--gh-fg-subtle); opacity: 1; }

/* ==========================================================================
 * Breadcrumbs
 * ======================================================================== */
.ui.breadcrumb,
.repo-path {
  font-size: 16px;
  color: var(--gh-fg-muted);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.ui.breadcrumb .divider,
.repo-path .divider { color: var(--gh-fg-muted); margin: 0 2px; }
.ui.breadcrumb .section { color: var(--gh-fg); }
.ui.breadcrumb a.section { color: var(--gh-accent-fg); font-weight: 400; }
.ui.breadcrumb .active.section { font-weight: 600; color: var(--gh-fg); }

/* ==========================================================================
 * Tables
 * ======================================================================== */
.ui.table {
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  color: var(--gh-fg);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.ui.table thead th {
  background: var(--gh-canvas-subtle);
  border-bottom: 1px solid var(--gh-border);
  color: var(--gh-fg);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 16px;
  text-align: left;
}

.ui.table tbody td {
  border-top: 1px solid var(--gh-border-muted);
  padding: var(--gh-row-py) 16px;
  vertical-align: middle;
}

.ui.table tbody tr:first-child td { border-top: 0; }

.ui.table tbody tr:hover,
.ui.selectable.table tbody tr:hover {
  background: var(--gh-canvas-subtle) !important;
}

.ui.striped.table tbody tr:nth-child(2n) { background: var(--color-markup-table-row); }

/* ==========================================================================
 * Tabs (repo nav, issue nav, PR nav)
 * ======================================================================== */
.ui.tabular.menu,
.ui.tabs.menu,
.overflow-menu.ui.secondary.pointing.menu {
  background: transparent;
  border-bottom: 1px solid var(--gh-border);
  box-shadow: none;
  gap: 8px;
  margin: 0;
  min-height: 0;
}

.ui.tabular.menu .item,
.overflow-menu.ui.secondary.pointing.menu .item {
  background: transparent !important;
  border: 0 !important;
  border-radius: var(--gh-radius) var(--gh-radius) 0 0;
  color: var(--gh-fg);
  font-size: 14px;
  font-weight: 400;
  padding: 8px 12px !important;
  margin: 0 0 -1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

.ui.tabular.menu .item:hover,
.overflow-menu.ui.secondary.pointing.menu .item:hover {
  background: var(--gh-canvas-subtle) !important;
  color: var(--gh-fg);
}

.ui.tabular.menu .item.active,
.overflow-menu.ui.secondary.pointing.menu .item.active {
  font-weight: 600;
  color: var(--gh-fg);
  background: transparent !important;
}

/* The 2px underline is GitHub's tab-selected signature. */
.ui.tabular.menu .item.active::after,
.overflow-menu.ui.secondary.pointing.menu .item.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: #fd8c73;
}

/* ==========================================================================
 * Timeline (issue / PR conversation)
 * ======================================================================== */
.timeline,
.ui.timeline {
  position: relative;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline::before,
.repository .timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gh-border-muted);
  z-index: 0;
}

.timeline-item,
.timeline .event {
  position: relative;
  padding-left: 56px;
  margin-bottom: 16px;
  color: var(--gh-fg-muted);
  font-size: 14px;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-item .badge,
.timeline .event .badge {
  position: absolute;
  left: 4px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gh-canvas-subtle);
  border: 2px solid var(--gh-canvas);
  color: var(--gh-fg-muted);
  z-index: 1;
}

.timeline .event .badge.bg-green { background: var(--gh-success); color: #fff; }
.timeline .event .badge.bg-red { background: var(--gh-danger); color: #fff; }
.timeline .event .badge.bg-purple { background: var(--gh-done); color: #fff; }

/* Comment boxes */
.timeline-item.comment,
.repository .comment .content > .ui.segment,
.comment-body {
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  padding: 0;
  display: block;
}

.comment-header,
.comment .content > .ui.attached.header,
.repository .comment-header {
  background: var(--gh-canvas-subtle);
  border-bottom: 1px solid var(--gh-border-muted);
  border-radius: var(--gh-radius) var(--gh-radius) 0 0;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--gh-fg-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.comment-header .author,
.comment-header a.author { color: var(--gh-fg); font-weight: 600; }

.comment-content,
.comment .render-content { padding: 16px; }

/* Reactions */
.ui.comment .reactions,
.comment-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}

.reactions .ui.label,
.comment-reaction-button {
  background: var(--color-reaction-bg);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-pill);
  color: var(--gh-fg-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 1px 8px;
}

.reactions .ui.label:hover { background: var(--color-reaction-hover-bg); }
.reactions .ui.label.active { background: var(--color-reaction-active-bg); border-color: var(--gh-accent); color: var(--gh-accent-fg); }

/* ==========================================================================
 * Tooltips
 * ======================================================================== */
[data-tooltip]::after,
.tippy-box {
  background: var(--color-tooltip-bg) !important;
  color: var(--color-tooltip-text) !important;
  border-radius: var(--gh-radius) !important;
  font-size: 12px !important;
  box-shadow: var(--gh-shadow-medium) !important;
}

/* ==========================================================================
 * Progress bars
 * ======================================================================== */
.ui.progress {
  background: var(--gh-canvas-inset);
  border-radius: var(--gh-radius-pill);
  height: 8px;
  margin: 8px 0;
  box-shadow: none;
}

.ui.progress .bar {
  background: var(--gh-success);
  border-radius: var(--gh-radius-pill);
  height: 8px;
  min-width: 0;
  transition: width var(--gh-motion) var(--gh-ease);
}

/* ==========================================================================
 * Avatars
 * ======================================================================== */
.ui.avatar.image,
img.ui.avatar,
.avatar {
  border-radius: 50%;
  background: var(--gh-canvas-subtle);
}

.ui.avatar.image[src$=".svg"] { border-radius: var(--gh-radius); }

/* === 04-repo.css === */
/*!
 * forgejo-github-theme — 04-repo
 * Repository header, tabs, clone widget, branch selector, file browser,
 * releases, packages, wiki and activity.
 * SPDX-License-Identifier: MIT
 */

/* ==========================================================================
 * Repository header
 * ======================================================================== */
.repository .repo-header,
.gh-repo-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 12px;
  margin: 0;
  border-bottom: 0;
}

.repository .repo-title,
.gh-repo-header .repo-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-weight: 400;
  margin: 0;
  min-width: 0;
}

.repository .repo-title a { color: var(--gh-accent-fg); font-weight: 600; }
.repository .repo-title .owner + .divider { color: var(--gh-fg-muted); font-weight: 300; }

/* Private / fork / mirror / template chips next to the name */
.repository .repo-title .ui.basic.label,
.repository .repo-title .labelled,
.gh-repo-chip {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-pill);
  color: var(--gh-fg-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  padding: 0 7px;
  background: transparent;
  align-self: center;
}

/* Star / watch / fork counters */
.repository .repo-buttons,
.gh-repo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.repository .repo-buttons .ui.labeled.button > .label,
.gh-repo-actions .ui.labeled.button > .label {
  background: var(--gh-canvas) !important;
  border: 1px solid var(--gh-border) !important;
  border-left: 0 !important;
  color: var(--gh-fg) !important;
  font-weight: 500;
  padding: 5px 10px;
}

/* Sticky variant keeps the name + tabs reachable during long scrolls. */
html[data-gh-sticky-repo-header="on"] .repository .repo-header {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* ==========================================================================
 * Repository tab bar
 * ======================================================================== */
.repository .ui.tabs.container,
.repository .header-wrapper > .ui.tabs.container {
  margin: 0;
  padding: 0;
}

.repository .ui.tabular.menu .item .svg,
.repository .overflow-menu .item .svg {
  color: var(--gh-fg-muted);
}

.repository .ui.tabular.menu .item.active .svg { color: var(--gh-fg); }

/* ==========================================================================
 * Clone widget
 * ======================================================================== */
.repository .clone-panel,
.gh-clone-panel {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.repository .clone-panel input,
.gh-clone-panel input {
  background: var(--gh-canvas-subtle) !important;
  border: 1px solid var(--gh-border) !important;
  border-radius: var(--gh-radius) 0 0 var(--gh-radius) !important;
  color: var(--gh-fg) !important;
  font-family: var(--gh-font-mono);
  font-size: 12px;
  min-width: 0;
  padding: 5px 10px !important;
}

.repository .clone-panel .ui.button {
  border-radius: 0;
}

.repository .clone-panel .ui.button:last-child {
  border-radius: 0 var(--gh-radius) var(--gh-radius) 0;
}

/* The "Code" dropdown body */
.repository .clone-panel .menu,
.gh-clone-menu {
  min-width: 340px;
  padding: 12px !important;
}

.gh-clone-menu .gh-clone-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

/* ==========================================================================
 * Branch / tag selector
 * ======================================================================== */
.repository .branch-selector,
.repository .ui.dropdown.branch-dropdown,
.branch-dropdown {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  background: var(--gh-canvas-subtle);
  color: var(--gh-fg);
  font-size: 14px;
  font-weight: 500;
  padding: 5px 12px;
}

.repository .branch-selector:hover { background: var(--gh-canvas-inset); }

.repository .branch-selector .menu,
.branch-dropdown .menu {
  min-width: 300px;
  max-height: 420px;
  overflow: auto;
}

.repository .branch-selector .menu .item {
  font-family: var(--gh-font-sans);
  font-size: 14px;
}

.repository .branch-selector .menu .item.selected::before {
  content: "";
}

/* Tabs inside the branch dropdown (Branches / Tags) */
.repository .branch-selector .menu .ui.tabular.menu { padding: 0 8px; }

/* ==========================================================================
 * File browser
 * ======================================================================== */
.repository.file.list #repo-files-table,
#repo-files-table,
.repo-file-table {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  width: 100%;
  background: var(--gh-canvas);
}

/* Latest-commit strip above the file list */
#repo-files-table thead th,
.repo-file-table .commit-list {
  background: var(--gh-canvas-subtle) !important;
  border-bottom: 1px solid var(--gh-border) !important;
  padding: 8px 16px !important;
  font-weight: 400;
  font-size: 12px;
  color: var(--gh-fg-muted);
}

#repo-files-table tbody td,
.repo-file-table tbody td {
  border-top: 1px solid var(--gh-border-muted);
  padding: var(--gh-row-py) 16px;
  font-size: 14px;
  line-height: 20px;
}

#repo-files-table tbody tr:hover,
.repo-file-table tbody tr:hover { background: var(--gh-canvas-subtle); }

#repo-files-table .name a,
.repo-file-table .name a { color: var(--gh-fg); }
#repo-files-table .name a:hover { color: var(--gh-accent-fg); text-decoration: underline; }

#repo-files-table .octicon-file-directory-fill,
#repo-files-table .octicon-file-directory,
.repo-file-table svg[class*="directory"] { color: var(--gh-accent); }

#repo-files-table .octicon-file,
.repo-file-table svg.octicon-file { color: var(--gh-fg-muted); }

#repo-files-table .message,
.repo-file-table .message {
  color: var(--gh-fg-muted);
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#repo-files-table .age,
.repo-file-table .age { color: var(--gh-fg-muted); text-align: right; white-space: nowrap; }

/* Path breadcrumb + file toolbar */
.repository.file.list .repo-path-wrapper,
.gh-file-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

/* Single-file view. The header is <h4 class="file-header ui top attached
 * header">; `.file-info` is only the small metadata block inside it, so giving
 * that a border drew a stray box around "98 lines / 2.6 KiB / JSON". */
.repository .file-header,
.file-view .file-header {
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-bottom: 0;
  border-radius: var(--gh-radius) var(--gh-radius) 0 0;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gh-fg-muted);
}

.repository .file-view,
.file-view.code-view {
  border: 1px solid var(--gh-border);
  border-radius: 0 0 var(--gh-radius) var(--gh-radius);
  background: var(--gh-canvas);
  overflow: auto;
}

.file-view.code-view table { width: 100%; border-collapse: collapse; }

.file-view.code-view .lines-num,
.code-view .lines-num {
  background: var(--gh-canvas);
  border-right: 1px solid var(--gh-border-muted);
  color: var(--gh-fg-subtle);
  font-family: var(--gh-font-mono);
  font-size: 12px;
  padding: 0 10px;
  text-align: right;
  user-select: none;
  vertical-align: top;
  width: 1%;
  white-space: nowrap;
}

.file-view.code-view .lines-code,
.code-view .lines-code {
  font-family: var(--gh-font-mono);
  font-size: 12px;
  line-height: 20px;
  padding: 0 10px;
  white-space: pre;
}

.code-view .active,
.code-view .lines-code.active,
.code-view tr.active { background: var(--color-active-line) !important; }

/* ==========================================================================
 * Releases
 * ======================================================================== */
.repository.release #release-list > li,
.release-list .release-entry,
.gh-release {
  border-bottom: 1px solid var(--gh-border-muted);
  padding: 24px 0;
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 24px;
}

.repository.release #release-list .detail,
.gh-release .gh-release-body { min-width: 0; }

.gh-release-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--gh-font-mono);
  font-size: 12px;
  color: var(--gh-fg-muted);
}

.gh-release-latest {
  display: inline-block;
  background: var(--gh-success-subtle);
  border: 1px solid var(--gh-success-muted, var(--gh-success));
  border-radius: var(--gh-radius-pill);
  color: var(--gh-success-fg);
  font-size: 12px;
  font-weight: 500;
  padding: 0 8px;
  line-height: 20px;
}

.repository.release #release-list .download,
.gh-release-assets {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  margin-top: 16px;
  overflow: hidden;
}

.gh-release-assets > summary,
.repository.release #release-list .download > summary {
  background: var(--gh-canvas-subtle);
  border-bottom: 1px solid var(--gh-border-muted);
  cursor: pointer;
  font-weight: 600;
  padding: 8px 16px;
  list-style: none;
}

.gh-release-assets > summary::-webkit-details-marker { display: none; }
.gh-release-assets ul { list-style: none; margin: 0; padding: 0; }
.gh-release-assets li { border-top: 1px solid var(--gh-border-muted); padding: 8px 16px; display: flex; justify-content: space-between; gap: 12px; }
.gh-release-assets li:first-child { border-top: 0; }

/* ==========================================================================
 * Packages
 * ======================================================================== */
.page-content.packages .flex-item,
.gh-package {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--gh-canvas);
  transition: border-color var(--gh-motion) var(--gh-ease);
}

.page-content.packages .flex-item:hover { border-color: var(--gh-border-strong); }

.gh-package-type {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-pill);
  color: var(--gh-fg-muted);
  font-size: 11px;
  padding: 0 8px;
  line-height: 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
 * Wiki
 * ======================================================================== */
.repository.wiki .wiki-content-sidebar,
.repository.wiki #wiki-sidebar {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  padding: 12px 16px;
  background: var(--gh-canvas);
}

.repository.wiki .wiki-content-main { min-width: 0; }

.repository.wiki .ui.dividing.header {
  border-bottom: 1px solid var(--gh-border-muted);
  padding-bottom: 8px;
}

/* ==========================================================================
 * Activity / insights
 * ======================================================================== */
.repository.view.activity .ui.attached.segment,
.gh-activity-block {
  border-color: var(--gh-border);
}

.repository .activity-bar-graph,
#repo-activity-top-authors-chart { background: transparent !important; }

.feeds .news,
#activity-feed .flex-item,
.activity-feed .flex-item {
  border-bottom: 1px solid var(--gh-border-muted);
  padding: 12px 0;
  gap: 12px;
}

.feeds .news:last-child { border-bottom: 0; }

.feeds .news .meta,
.activity-feed .flex-item-body { color: var(--gh-fg-muted); font-size: 12px; }

/* Contributor / commit graphs keep theme colours */
.repository .contributors .ui.segment { border-color: var(--gh-border); }

/* ==========================================================================
 * Repository quick search (theme.js injects .gh-quicksearch into the toolbar)
 * ======================================================================== */
.gh-quicksearch {
  position: relative;
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 320px;
}

.gh-quicksearch input {
  width: 100%;
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  color: var(--gh-fg);
  font-size: 13px;
  padding: 5px 10px;
}

.gh-quicksearch input:focus {
  border-color: var(--gh-accent);
  box-shadow: var(--gh-shadow-focus, 0 0 0 3px rgb(9 105 218 / 30%));
  outline: none;
}

/* Rows hidden by the quick filter */
tr[data-gh-filtered="true"] { display: none !important; }

.gh-quicksearch-empty {
  color: var(--gh-fg-muted);
  font-size: 13px;
  padding: 16px;
  text-align: center;
}

/* ==========================================================================
 * Code view — GitHub geometry
 *
 * Neither this theme nor Forgejo defines a border on individual code rows, yet
 * rows can still end up separated by hairlines (a stray `border` on <td> from
 * a Fomantic reset, or a future Forgejo change). Zeroing them explicitly here
 * is cheap and makes the result independent of where they came from.
 * ======================================================================== */
.file-view.code-view table,
.file-view.code-view tbody,
.file-view.code-view tr,
.file-view.code-view td {
  border: 0;
  box-shadow: none;
}

.file-view.code-view table {
  width: 100%;
  border-collapse: collapse;
  background: var(--gh-canvas);
}

/* The gutter: a quiet column, one subtle rule against the code, numbers that
 * cannot be selected along with the source. */
.file-view.code-view .lines-num,
.code-view .lines-num {
  background: var(--gh-canvas);
  border-right: 1px solid var(--gh-border-muted);
  color: var(--gh-fg-subtle);
  font-family: var(--gh-font-mono);
  font-size: 12px;
  line-height: 20px;
  padding: 0 2px 0 6px;
  text-align: right;
  user-select: none;
  vertical-align: top;
  white-space: nowrap;
  width: 1%;
  min-width: 48px;
}

/* Forgejo already renders the number itself:
 *     .lines-num span:after { content: attr(data-line-number); display: block;
 *                             padding: 0 10px; line-height: 20px }
 * Restating `content` here would win on specificity and silently drop that
 * padding, display and line-height. Leave the pseudo-element alone and only
 * pad the cell around it — hence the small horizontal padding above. */

.file-view.code-view .lines-code,
.code-view .lines-code {
  background: var(--gh-canvas);
  font-family: var(--gh-font-mono);
  font-size: 12px;
  line-height: 20px;
  padding: 0 10px 0 16px;
  vertical-align: top;
  white-space: pre;
}

.file-view.code-view .lines-code code,
.code-view .lines-code code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}

/* Hovering a line highlights the whole row, as on GitHub. */
.file-view.code-view tbody tr:hover .lines-code,
.file-view.code-view tbody tr:hover .lines-num {
  background: var(--gh-canvas-subtle);
}

/* A linked line (#L12) stays marked without shouting. */
.file-view.code-view tr.active .lines-code,
.file-view.code-view tr.active .lines-num,
.code-view .lines-code.active {
  background: var(--color-active-line) !important;
}

/* Header strip above the source: one compact row, actions on the right. */
.repository .file-header,
.file-view .file-header,
.file-info {
  min-height: 40px;
  padding: 6px 16px;
  gap: 8px 12px;
}

.file-info .file-info-entry {
  color: var(--gh-fg-muted);
  font-size: 12px;
  padding: 0;
  border: 0;
}

.file-header .file-header-right .ui.button,
.file-actions .ui.button {
  padding: 3px 10px;
  font-size: 12px;
}

/* The latest-commit strip above a file is reference material, not a headline. */
.repository .commit-header,
.repository .file-view-commit,
.repository .latest-commit {
  padding: 8px 16px;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
 * Commit strip above a file: one row, message left, date right, inside a
 * single box. Forgejo's markup is
 *     .ui.segment.list-header > .latest-commit + .text.grey.age
 * so the box belongs on the segment, not on .latest-commit.
 * ------------------------------------------------------------------------ */
.repository .ui.segment.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  padding: 8px 16px;
  font-size: 12px;
  color: var(--gh-fg-muted);
}

.repository .ui.segment.list-header .latest-commit {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  background: none;
  border: 0;
  padding: 0;
}

.repository .ui.segment.list-header .text.grey.age {
  flex: 0 0 auto;
  color: var(--gh-fg-muted);
  white-space: nowrap;
}

/* The metadata block is plain text inside the header, never a box of its own. */
.file-info,
.file-header .file-info {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--gh-fg-muted);
  font-size: 12px;
}

.file-info .file-info-entry {
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--gh-fg-muted);
}

/* --------------------------------------------------------------------------
 * Kill the per-line rules for good.
 *
 * A plain `border: 0` was not enough on a live instance, so this competes on
 * the same terms as whatever is drawing them. Scoped tightly to the code view
 * so no other table is affected, and the one border worth keeping — the gutter
 * separator — is restored immediately afterwards.
 * ------------------------------------------------------------------------ */
.file-view.code-view table,
.file-view.code-view table tbody,
.file-view.code-view table tr,
.file-view.code-view table td,
.file-view.code-view table th {
  border: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}

.file-view.code-view .lines-num {
  border-right: 1px solid var(--gh-border-muted) !important;
}

/* --------------------------------------------------------------------------
 * Branch / tag selector (Vue component, classes taken from
 * web_src/js/components/RepoBranchTagSelector.vue in Forgejo 16.0.2):
 *   .branch-dropdown-button   the trigger
 *   .branch-tag-tab           the Branches / Tags switch
 *   .scrolling.menu           the list
 *   .item.selected            the ref currently checked out
 *   .item.active              the keyboard cursor
 * ------------------------------------------------------------------------ */
.js-branch-tag-selector .menu {
  min-width: 320px;
  padding: 0;
  overflow: hidden;
}

/* Filter field: full width, flush against the tabs below it. */
.js-branch-tag-selector .ui.icon.search.input {
  width: 100%;
  margin: 0;
  padding: 8px;
}

.js-branch-tag-selector .ui.icon.search.input > input {
  width: 100%;
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  color: var(--gh-fg);
  font-size: 13px;
  padding: 5px 10px;
}

/* Branches / Tags read as tabs, with the GitHub underline for the active one. */
.js-branch-tag-selector .branch-tag-tab {
  display: flex;
  gap: 4px;
  padding: 0 8px;
  border-bottom: 1px solid var(--gh-border-muted);
}

.js-branch-tag-selector .branch-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--gh-fg-muted);
  cursor: pointer;
  position: relative;
  background: none;
  border: 0;
}

.js-branch-tag-selector .branch-tag-item:hover { color: var(--gh-fg); }

.js-branch-tag-selector .branch-tag-item.active {
  color: var(--gh-fg);
  font-weight: 600;
}

.js-branch-tag-selector .branch-tag-item.active::after {
  content: "";
  position: absolute;
  inset: auto 8px -1px 8px;
  height: 2px;
  border-radius: 2px;
  background: #fd8c73;
}

.js-branch-tag-selector .branch-tag-divider { display: none; }

/* The list itself: compact rows, one screenful at a time. */
.js-branch-tag-selector .scrolling.menu {
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 0;
  border-top: 0;
}

.js-branch-tag-selector .scrolling.menu > .item {
  padding: 5px 12px !important;
  font-size: 13px;
  line-height: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The "default" chip beside the default branch. */
.js-branch-tag-selector .scrolling.menu > .item .ui.label {
  background: var(--gh-neutral-subtle, var(--gh-canvas-subtle));
  color: var(--gh-fg-muted);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-pill);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  padding: 0 6px;
  margin-left: auto;
}

.js-branch-tag-selector .message,
.js-branch-tag-selector .loading-indicator {
  padding: 16px;
  color: var(--gh-fg-muted);
  font-size: 13px;
  text-align: center;
}

/* Fomantic positions the icon of a .ui.icon.input absolutely against the
 * WRAPPER. Since the wrapper carries 8px of padding here, the icon landed 8px
 * beyond the field's own right edge. Pull it in by exactly that padding, and
 * reserve room inside the field so the text never runs underneath it. */
.js-branch-tag-selector .ui.icon.search.input > input {
  padding-right: 32px;
}

.js-branch-tag-selector .ui.icon.search.input > .icon,
.js-branch-tag-selector .ui.icon.search.input > i,
.js-branch-tag-selector .ui.icon.search.input > svg {
  right: 8px;
  left: auto;
  color: var(--gh-fg-subtle);
  opacity: 1;
  pointer-events: none;
}

/* === 05-dashboard.css === */
/*!
 * forgejo-github-theme — 05-dashboard
 * Logged-in home: repositories, activity feed, assigned issues/PRs,
 * review requests, organizations, pinned repositories.
 * SPDX-License-Identifier: MIT
 */

.dashboard,
.page-content.dashboard {
  padding-top: 24px;
}

/* Context switcher strip (user / organisation) */
.dashboard .dashboard-navbar,
.dashboard-navbar {
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  margin-bottom: 24px;
  padding: 6px 10px;
  box-shadow: none;
}

.dashboard-navbar .item { color: var(--gh-fg); font-size: 14px; }
.dashboard-navbar .ui.dropdown .text { font-weight: 600; }

/* --------------------------------------------------------------------------
 * Two-column grid: feed on the left, side panels on the right.
 * The theme's own right rail (#gh-sidebar) is repository-scoped, so the
 * dashboard keeps its panels inline.
 * ------------------------------------------------------------------------ */
.gh-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.gh-dashboard-grid > .gh-dash-main { min-width: 0; }

html[data-gh-sticky-sidebar="on"] .gh-dashboard-grid > .gh-dash-aside {
  position: sticky;
  top: calc(var(--gh-rail-top, var(--gh-header-height)) + 16px);
  max-height: calc(100vh - var(--gh-rail-top, var(--gh-header-height)) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* --------------------------------------------------------------------------
 * Panels
 * ------------------------------------------------------------------------ */
.gh-panel {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  background: var(--gh-canvas);
  margin-bottom: var(--gh-block-gap);
  overflow: hidden;
}

.gh-panel > header,
.gh-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--gh-canvas-subtle);
  border-bottom: 1px solid var(--gh-border-muted);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gh-fg);
}

.gh-panel-head .gh-panel-action {
  font-size: 12px;
  font-weight: 400;
  color: var(--gh-accent-fg);
}

.gh-panel-body { padding: 8px 0; }
.gh-panel-body.gh-padded { padding: 16px; }

.gh-panel-list { list-style: none; margin: 0; padding: 0; }

.gh-panel-list > li > a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: var(--gh-row-py) 16px;
  color: var(--gh-fg);
  font-size: 14px;
  line-height: 1.4;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

.gh-panel-list > li > a:hover { background: var(--gh-canvas-subtle); text-decoration: none; }
.gh-panel-list > li + li { border-top: 1px solid var(--gh-border-muted); }

.gh-panel-empty {
  color: var(--gh-fg-muted);
  font-size: 13px;
  padding: 20px 16px;
  text-align: center;
}

/* Counts on the assigned-work panels */
.gh-panel-count {
  background: var(--gh-neutral-subtle, var(--gh-canvas-inset));
  border-radius: var(--gh-radius-pill);
  color: var(--gh-fg-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 0 7px;
  line-height: 18px;
}

/* --------------------------------------------------------------------------
 * Repository list in the left dashboard column (Forgejo's own markup)
 * ------------------------------------------------------------------------ */
.dashboard .repo-owner-name-list,
#repo-search-results,
.dashboard .flex-list {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  overflow: hidden;
}

.dashboard .flex-list .flex-item,
.dashboard .repo-owner-name-list li {
  border-bottom: 1px solid var(--gh-border-muted);
  padding: var(--gh-row-py) 16px;
  margin: 0;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

.dashboard .flex-list .flex-item:last-child,
.dashboard .repo-owner-name-list li:last-child { border-bottom: 0; }

.dashboard .flex-list .flex-item:hover,
.dashboard .repo-owner-name-list li:hover { background: var(--gh-canvas-subtle); }

.dashboard .flex-item-title a { color: var(--gh-accent-fg); font-weight: 600; font-size: 14px; }
.dashboard .flex-item-body { color: var(--gh-fg-muted); font-size: 12px; }

/* --------------------------------------------------------------------------
 * Pinned repositories — GitHub's two-column card grid
 * ------------------------------------------------------------------------ */
.gh-pinned {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.gh-pinned > li {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  padding: 16px;
  background: var(--gh-canvas);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--gh-motion) var(--gh-ease),
              box-shadow var(--gh-motion) var(--gh-ease),
              transform var(--gh-motion) var(--gh-ease);
}

.gh-pinned > li:hover {
  border-color: var(--gh-border-strong);
  box-shadow: var(--gh-shadow-medium);
  transform: translateY(-1px);
}

.gh-pinned .gh-pinned-name {
  font-weight: 600;
  color: var(--gh-accent-fg);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-pinned .gh-pinned-desc {
  color: var(--gh-fg-muted);
  font-size: 12px;
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
 * Activity feed
 * ------------------------------------------------------------------------ */
.dashboard #activity-feed,
.dashboard .feeds {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  overflow: hidden;
}

.dashboard .feeds .news {
  align-items: flex-start;
  border-bottom: 1px solid var(--gh-border-muted);
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  margin: 0;
}

.dashboard .feeds .news:last-child { border-bottom: 0; }
.dashboard .feeds .news .avatar img { border-radius: 50%; }
.dashboard .feeds .news .content { min-width: 0; font-size: 14px; }
.dashboard .feeds .news .content .meta { color: var(--gh-fg-muted); font-size: 12px; display: block; margin-top: 2px; }
.dashboard .feeds .news .issue.title { color: var(--gh-fg-muted); }

/* Push-commit sublists inside a feed entry */
.dashboard .feeds .news .push-news-list {
  border-left: 2px solid var(--gh-border-muted);
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 12px;
  font-size: 12px;
  color: var(--gh-fg-muted);
}

.dashboard .feeds .news .push-news-list .commit-id {
  font-family: var(--gh-font-mono);
  color: var(--gh-accent-fg);
}

/* --------------------------------------------------------------------------
 * Organizations block
 * ------------------------------------------------------------------------ */
.gh-orgs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 16px;
}

.gh-orgs img {
  width: 32px;
  height: 32px;
  border-radius: var(--gh-radius);
  border: 1px solid var(--gh-border-muted);
  transition: transform var(--gh-motion) var(--gh-ease);
}

.gh-orgs a:hover img { transform: scale(1.1); }

/* --------------------------------------------------------------------------
 * Heatmap — recolour Forgejo's contribution calendar to the GitHub greens
 * ------------------------------------------------------------------------ */
#user-heatmap .vch__day__square[data-level="0"] { fill: var(--gh-canvas-inset); }
#user-heatmap .vch__day__square[data-level="1"] { fill: #9be9a8; }
#user-heatmap .vch__day__square[data-level="2"] { fill: #40c463; }
#user-heatmap .vch__day__square[data-level="3"] { fill: #30a14e; }
#user-heatmap .vch__day__square[data-level="4"] { fill: #216e39; }
#user-heatmap text { fill: var(--gh-fg-muted); font-size: 10px; }

html[data-theme="github-dark"] #user-heatmap .vch__day__square[data-level="1"],
.theme-github-dark #user-heatmap .vch__day__square[data-level="1"] { fill: #0e4429; }
html[data-theme="github-dark"] #user-heatmap .vch__day__square[data-level="2"],
.theme-github-dark #user-heatmap .vch__day__square[data-level="2"] { fill: #006d32; }
html[data-theme="github-dark"] #user-heatmap .vch__day__square[data-level="3"],
.theme-github-dark #user-heatmap .vch__day__square[data-level="3"] { fill: #26a641; }
html[data-theme="github-dark"] #user-heatmap .vch__day__square[data-level="4"],
.theme-github-dark #user-heatmap .vch__day__square[data-level="4"] { fill: #39d353; }

/* === 06-explore.css === */
/*!
 * forgejo-github-theme — 06-explore
 * Explore / search results / organisation & user profiles rendered as
 * GitHub repository cards.
 * SPDX-License-Identifier: MIT
 */

/* ==========================================================================
 * Explore navigation
 * ======================================================================== */
.explore .ui.secondary.menu,
.page-content.explore .ui.secondary.menu {
  border-bottom: 1px solid var(--gh-border);
  margin-bottom: 16px;
  gap: 8px;
}

.explore .ui.secondary.menu .item {
  border-radius: var(--gh-radius) var(--gh-radius) 0 0;
  color: var(--gh-fg);
  font-size: 14px;
  padding: 8px 12px;
  position: relative;
}

.explore .ui.secondary.menu .item.active {
  background: transparent;
  font-weight: 600;
}

.explore .ui.secondary.menu .item.active::after {
  content: "";
  position: absolute;
  inset: auto 8px -1px 8px;
  height: 2px;
  background: #fd8c73;
  border-radius: 2px;
}

/* Search + sort toolbar */
.explore .ui.form .ui.input,
.gh-explore-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

/* ==========================================================================
 * Repository cards
 * ======================================================================== */
/* Forgejo's list item is a ROW — .flex-item-leading holds the repository icon
 * and .flex-item-main holds everything else. Forcing the item into a column
 * pushed the icon onto its own line above the name, which is what made the
 * organisation page look broken. Keep the row; card the outside of it.
 *
 * One item per row, like GitHub's organisation and explore listings: two
 * narrow cards side by side left the names cramped against the metadata. */
.gh-repo-cards,
.explore .flex-list,
.user.profile .flex-list,
.organization .flex-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  /* `gap` only spaces the items from each other. Without a top margin the
   * first card sits flush against the divider above the list. */
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.gh-repo-card,
.explore .flex-list .flex-item,
.user.profile .flex-list .flex-item,
.organization .flex-list .flex-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  background: var(--gh-canvas);
  padding: 12px 16px;
  margin: 0;
  min-width: 0;
  transition: border-color var(--gh-motion) var(--gh-ease),
              box-shadow var(--gh-motion) var(--gh-ease);
}

/* Inner structure, matching Forgejo's own markup. */
/* The icon is a 24px square; pinning the title's line box to the same 24px
 * makes the two share a centre line instead of being off by a couple of
 * pixels. Guessing at padding never lines these up reliably. */
.explore .flex-list .flex-item-leading,
.user.profile .flex-list .flex-item-leading,
.organization .flex-list .flex-item-leading {
  flex: 0 0 auto;
  color: var(--gh-fg-muted);
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.explore .flex-list .flex-item-main,
.user.profile .flex-list .flex-item-main,
.organization .flex-list .flex-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.explore .flex-list .flex-item-header,
.user.profile .flex-list .flex-item-header,
.organization .flex-list .flex-item-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 24px;
}

.explore .flex-list .flex-item-trailing,
.user.profile .flex-list .flex-item-trailing,
.organization .flex-list .flex-item-trailing {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gh-fg-muted);
  font-size: 12px;
  margin-left: auto;
}

/* With stars and forks hidden, the trailing block holds nothing but the
 * language chip. Pinning that to the far edge left a wide empty channel across
 * the row, so let it sit next to the name instead. */
html[data-gh-hide-social="on"] .explore .flex-list .flex-item-trailing,
html[data-gh-hide-social="on"] .user.profile .flex-list .flex-item-trailing,
html[data-gh-hide-social="on"] .organization .flex-list .flex-item-trailing {
  margin-left: 0;
}

.gh-repo-card:hover,
.explore .flex-list .flex-item:hover,
.user.profile .flex-list .flex-item:hover,
.organization .flex-list .flex-item:hover {
  border-color: var(--gh-border-strong);
  box-shadow: var(--gh-shadow-medium);
}

.explore .flex-list .flex-item-title,
.organization .flex-list .flex-item-title,
.user.profile .flex-list .flex-item-title,
.gh-repo-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  margin: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.explore .flex-list .flex-item-title a,
.gh-repo-card-title a { color: var(--gh-accent-fg); }

.explore .flex-list .flex-item-body,
.gh-repo-card-desc {
  color: var(--gh-fg-muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  min-width: 0;
}

/* A long description still gets clamped, but the metadata beside it does not. */
.explore .flex-list .flex-item-body > .description,
.organization .flex-list .flex-item-body > .description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 100%;
}

/* Card footer: language dot, stars, forks, updated */
.gh-repo-card-meta,
.explore .flex-list .flex-item-body .flex-item-trailing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  color: var(--gh-fg-muted);
  font-size: 12px;
}

.gh-repo-card-meta .gh-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gh-repo-card-meta .gh-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

/* Topic chips inside a card */
.gh-repo-card .gh-topics { margin-top: 2px; }

/* ==========================================================================
 * User / organisation profile header
 * ======================================================================== */
.user.profile .ui.card,
.organization .ui.card,
.gh-profile-card {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.user.profile .ui.card .image img,
.gh-profile-avatar {
  border-radius: 50%;
  border: 1px solid var(--gh-border-muted);
  width: 100%;
  max-width: 260px;
  height: auto;
}

.gh-profile-name {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  margin: 12px 0 0;
}

.gh-profile-login {
  font-size: 20px;
  font-weight: 300;
  color: var(--gh-fg-muted);
  line-height: 1.25;
  margin: 0 0 12px;
}

.gh-profile-bio { color: var(--gh-fg); font-size: 14px; margin: 0 0 16px; }

.gh-profile-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--gh-fg-muted);
}

.gh-profile-meta li { display: flex; align-items: center; gap: 8px; }

/* Follow button spans the sidebar width on GitHub */
.user.profile .ui.card .extra .ui.button,
.gh-profile-card .ui.button { width: 100%; }

/* Profile tab bar */
.user.profile .ui.tabular.menu,
.organization .ui.tabular.menu { margin-bottom: 16px; }

/* ==========================================================================
 * Org member / team grids
 * ======================================================================== */
/* Members and teams are avatars, not repositories — a grid suits them, so the
 * display has to be restated after the list above switched to a column. */
.organization.members .flex-list,
.organization.teams .flex-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.organization.members .flex-item .avatar img { width: 48px; height: 48px; border-radius: 50%; }

/* ==========================================================================
 * Empty states
 * ======================================================================== */
.gh-empty {
  border: 1px dashed var(--gh-border);
  border-radius: var(--gh-radius);
  color: var(--gh-fg-muted);
  padding: 48px 24px;
  text-align: center;
  grid-column: 1 / -1;
}

.gh-empty h3 { color: var(--gh-fg); margin: 0 0 8px; font-size: 16px; }

/* Forgejo draws a <div class="divider"> hairline directly above the repository
 * list. Each card already carries its own top border, so the two lines stack a
 * few pixels apart and read as one smudged edge glued to the first card.
 * Scoped with :has() so only that specific divider goes — the ones in
 * dropdowns and breadcrumbs are untouched. */
.divider:has(+ .flex-list) {
  display: none;
}

/* Forgejo ships:
 *
 *     .divider + .flex-list > .flex-item:first-child { padding-top: 0 }
 *
 * In its own design these are rows separated by hairlines, so trimming the
 * outer padding is right. Here each item is a self-contained card, and that
 * rule left the first card's content glued to its top edge — measured live:
 * first item pt=0 h=61, second pt=12 h=73.
 *
 * Hiding the divider does NOT stop this: `display: none` keeps the element in
 * the DOM, so the `+` combinator still matches. And matching Forgejo's
 * selector class-for-class only ties it at 0,4,0, leaving the outcome to load
 * order — which a custom stylesheet must never depend on. Adding
 * `.page-content` takes these to 0,5,0 so they win outright. */
.page-content .divider + .flex-list > .flex-item:first-child,
.page-content.organization .flex-list > .flex-item:first-child,
.page-content.explore .flex-list > .flex-item:first-child,
.page-content.profile .flex-list > .flex-item:first-child {
  padding-top: 12px;
}

.page-content.organization .flex-list > .flex-item:last-child,
.page-content.explore .flex-list > .flex-item:last-child,
.page-content.profile .flex-list > .flex-item:last-child {
  padding-bottom: 12px;
}

/* === 07-issues.css === */
/*!
 * forgejo-github-theme — 07-issues
 * Issue list, issue view, labels, milestones, projects, assignees, timeline.
 * SPDX-License-Identifier: MIT
 */

/* ==========================================================================
 * Issue list
 * ======================================================================== */
.repository.issue-list .issue.list,
.issue-list-container,
#issue-list {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  overflow: hidden;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Filter bar sits on top of the list like GitHub's grey strip. */
.repository.issue-list .list-header,
.issue-list-toolbar,
.gh-issue-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-bottom: 0;
  border-radius: var(--gh-radius) var(--gh-radius) 0 0;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gh-fg-muted);
}

.gh-issue-toolbar + .issue.list,
.issue-list-toolbar + #issue-list {
  border-radius: 0 0 var(--gh-radius) var(--gh-radius);
  border-top: 0;
}

/* Open / Closed switch */
.gh-issue-toolbar .gh-state-filter {
  display: inline-flex;
  gap: 16px;
}

.gh-issue-toolbar .gh-state-filter a {
  color: var(--gh-fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gh-issue-toolbar .gh-state-filter a.active,
.gh-issue-toolbar .gh-state-filter a[aria-current="true"] { color: var(--gh-fg); font-weight: 600; }

/* Rows */
.issue.list > .item,
#issue-list .flex-item,
.issue-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--gh-border-muted);
  padding: var(--gh-row-py) 16px;
  margin: 0;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

.issue.list > .item:last-child,
#issue-list .flex-item:last-child { border-bottom: 0; }

.issue.list > .item:hover,
#issue-list .flex-item:hover { background: var(--gh-canvas-subtle); }

.issue.list > .item .title,
#issue-list .flex-item-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--gh-fg);
  margin: 0;
}

.issue.list > .item .title:hover,
#issue-list .flex-item-title a:hover { color: var(--gh-accent-fg); text-decoration: none; }

.issue.list > .item .desc,
#issue-list .flex-item-body {
  color: var(--gh-fg-muted);
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

/* Open / closed leading icon */
.issue.list > .item .issue-item-icon svg,
.issue-list-item .gh-issue-icon { flex: 0 0 auto; margin-top: 2px; }
.issue-list-item[data-state="open"] .gh-issue-icon { color: var(--gh-success-fg); }
.issue-list-item[data-state="closed"] .gh-issue-icon { color: var(--gh-done-fg); }

/* Inline labels on a row */
.issue.list > .item .labels-list,
#issue-list .flex-item-title .ui.label {
  vertical-align: middle;
}

/* Comment-count bubble at the right edge */
.issue.list > .item .comment,
.gh-issue-comments {
  color: var(--gh-fg-muted);
  font-size: 12px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* ==========================================================================
 * Issue / PR view
 * ======================================================================== */
.repository.view.issue .issue-title-header,
.gh-issue-header {
  border-bottom: 1px solid var(--gh-border-muted);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.repository.view.issue #issue-title,
.gh-issue-header h1 {
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 8px;
  word-break: break-word;
}

.repository.view.issue #issue-title .index,
.gh-issue-number { color: var(--gh-fg-muted); font-weight: 300; }

.repository.view.issue .issue-title-meta,
.gh-issue-submeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--gh-fg-muted);
  font-size: 14px;
}

/* Two-column body: conversation + metadata sidebar */
.repository.view.issue .issue-content,
.gh-issue-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 24px;
  align-items: start;
}

.repository.view.issue .issue-content-left,
.gh-issue-main { min-width: 0; }

html[data-gh-sticky-sidebar="on"] .repository.view.issue .issue-content-right,
html[data-gh-sticky-sidebar="on"] .gh-issue-aside {
  position: sticky;
  top: calc(var(--gh-rail-top, var(--gh-header-height)) + 16px);
  max-height: calc(100vh - var(--gh-rail-top, var(--gh-header-height)) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Metadata sidebar sections */
.repository.view.issue .issue-content-right .ui.divider { margin: 12px 0; }

.repository.view.issue .issue-content-right .ui.header,
.gh-issue-aside .gh-meta-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gh-fg-muted);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gh-issue-aside .gh-meta-block + .gh-meta-block {
  border-top: 1px solid var(--gh-border-muted);
  margin-top: 16px;
  padding-top: 16px;
}

.gh-issue-aside .gh-meta-empty { color: var(--gh-fg-muted); font-size: 13px; }

/* Assignee rows */
.gh-assignees { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gh-assignees li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.gh-assignees img { width: 20px; height: 20px; border-radius: 50%; }

/* ==========================================================================
 * Labels
 * ======================================================================== */
.label-list .item,
.repository.labels .label-list > .item {
  border-bottom: 1px solid var(--gh-border-muted);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.label-list .item:last-child { border-bottom: 0; }
.label-list .item .label-title { flex: 0 0 200px; }
.label-list .item .label-description { color: var(--gh-fg-muted); font-size: 12px; flex: 1 1 auto; }

/* Colour swatch used in the label editor */
.gh-label-preview {
  display: inline-block;
  border-radius: var(--gh-radius-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  padding: 0 10px;
}

/* ==========================================================================
 * Milestones
 * ======================================================================== */
.repository.milestones .milestone-list > .item,
.gh-milestone {
  border-bottom: 1px solid var(--gh-border-muted);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gh-milestone-title { font-size: 16px; font-weight: 600; color: var(--gh-accent-fg); }
.gh-milestone-meta { color: var(--gh-fg-muted); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; }

.repository.milestones .milestone-list .ui.progress,
.gh-milestone .ui.progress { margin: 4px 0; }

/* Overdue */
.gh-milestone[data-overdue="true"] .gh-milestone-meta .gh-due { color: var(--gh-danger-fg); font-weight: 600; }

/* ==========================================================================
 * Projects (kanban)
 * ======================================================================== */
.project-column,
.ui.segment.project-column {
  background: var(--color-project-column-bg);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  padding: 8px;
  min-width: 280px;
}

.project-column > .project-column-header,
.project-column > .ui.header {
  color: var(--gh-fg);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-column .card,
.project-column .issue-card {
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  box-shadow: var(--gh-shadow-small);
  margin-bottom: 8px;
  padding: 12px;
  font-size: 13px;
  cursor: grab;
  transition: box-shadow var(--gh-motion) var(--gh-ease),
              transform var(--gh-motion) var(--gh-ease);
}

.project-column .card:hover {
  box-shadow: var(--gh-shadow-medium);
  transform: translateY(-1px);
}

.project-column .card:active { cursor: grabbing; }

/* ==========================================================================
 * Timeline events specific to issues
 * ======================================================================== */
.timeline-item.event .text,
.timeline .event .text { color: var(--gh-fg-muted); }
.timeline-item.event .text a,
.timeline .event .text a { color: var(--gh-fg); font-weight: 600; }

/* Reference / cross-link event boxes */
.timeline-item .ref-issue,
.gh-ref-card {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  background: var(--gh-canvas);
  padding: 8px 12px;
  width: 100%;
  font-size: 13px;
}

/* New-comment form */
.repository.view.issue .comment-form,
#comment-form {
  margin-top: 16px;
  padding-left: 56px;
  position: relative;
}

.repository.view.issue .comment-form .ui.avatar,
#comment-form > .ui.avatar {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
}

/* Close / reopen action row */
.gh-comment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 0 0;
}

/* === 08-pulls.css === */
/*!
 * forgejo-github-theme — 08-pulls
 * Pull request layout: conversation, commits, checks, files changed,
 * review sidebar, approvals, merge box.
 * SPDX-License-Identifier: MIT
 */

/* ==========================================================================
 * PR sub-navigation (Conversation / Commits / Checks / Files changed)
 * ======================================================================== */
.repository.view.issue.pull .pull-desc,
.gh-pr-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--gh-border);
  margin-bottom: 16px;
}

.gh-pr-subnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--gh-fg);
  font-size: 14px;
  border-radius: var(--gh-radius) var(--gh-radius) 0 0;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

.gh-pr-subnav a:hover { background: var(--gh-canvas-subtle); text-decoration: none; }
.gh-pr-subnav a[aria-current="page"] { font-weight: 600; }

.gh-pr-subnav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 8px -1px 8px;
  height: 2px;
  background: #fd8c73;
  border-radius: 2px;
}

/* Branch pill in the PR header: base ← compare */
.gh-pr-branches {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.gh-pr-branch {
  background: var(--gh-accent-subtle);
  border-radius: var(--gh-radius);
  color: var(--gh-accent-fg);
  font-family: var(--gh-font-mono);
  padding: 2px 6px;
}

/* ==========================================================================
 * Merge box
 * ======================================================================== */
.repository .merge-section,
.pull-merge-box,
.gh-merge-box {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  background: var(--gh-canvas);
  margin-top: 16px;
  overflow: hidden;
}

.gh-merge-box .gh-merge-row,
.repository .merge-section .item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gh-border-muted);
  font-size: 14px;
}

.gh-merge-box .gh-merge-row:last-of-type,
.repository .merge-section .item:last-child { border-bottom: 0; }

.gh-merge-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.gh-merge-row[data-state="success"] .gh-merge-icon { background: var(--gh-success); }
.gh-merge-row[data-state="failure"] .gh-merge-icon { background: var(--gh-danger); }
.gh-merge-row[data-state="pending"] .gh-merge-icon { background: var(--gh-attention); }
.gh-merge-row[data-state="neutral"] .gh-merge-icon { background: var(--gh-neutral-emphasis); }

.gh-merge-title { font-weight: 600; color: var(--gh-fg); }
.gh-merge-desc { color: var(--gh-fg-muted); font-size: 13px; }

.gh-merge-actions {
  background: var(--gh-canvas-subtle);
  border-top: 1px solid var(--gh-border-muted);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Merge-state colouring of the whole box */
.gh-merge-box[data-mergeable="false"] { border-color: var(--gh-danger-muted, var(--gh-danger)); }

/* ==========================================================================
 * Checks
 * ======================================================================== */
.gh-checks,
.commit-status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  overflow: hidden;
}

.gh-checks > li,
.commit-status-list > li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gh-border-muted);
  font-size: 14px;
}

.gh-checks > li:last-child { border-bottom: 0; }
.gh-checks .gh-check-name { font-weight: 500; color: var(--gh-fg); }
.gh-checks .gh-check-desc { color: var(--gh-fg-muted); font-size: 12px; }
.gh-checks .gh-check-link { margin-left: auto; font-size: 12px; }

.gh-check-icon[data-state="success"] { color: var(--gh-success-fg); }
.gh-check-icon[data-state="failure"] { color: var(--gh-danger-fg); }
.gh-check-icon[data-state="pending"] { color: var(--gh-attention-fg); }
.gh-check-icon[data-state="skipped"] { color: var(--gh-fg-subtle); }

/* Spinner for running checks — respects reduced motion in 12-a11y.css */
.gh-check-icon[data-state="pending"] svg { animation: gh-spin 1.6s linear infinite; }
@keyframes gh-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
 * Commits tab
 * ======================================================================== */
.repository.commits .commit-list,
.gh-commit-list {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  overflow: hidden;
  width: 100%;
}

.gh-commit-group-date {
  background: var(--gh-canvas-subtle);
  border-bottom: 1px solid var(--gh-border-muted);
  color: var(--gh-fg-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
}

.repository.commits .commit-list tbody td,
.gh-commit-list > li {
  border-bottom: 1px solid var(--gh-border-muted);
  padding: var(--gh-row-py) 16px;
  font-size: 14px;
}

.gh-commit-sha,
.repository .commit-list .sha.label,
.sha.label {
  background: var(--gh-canvas-subtle) !important;
  border: 1px solid var(--gh-border) !important;
  border-radius: var(--gh-radius) !important;
  color: var(--gh-fg-muted) !important;
  font-family: var(--gh-font-mono);
  font-size: 12px;
  padding: 1px 6px !important;
}

/* ==========================================================================
 * Review sidebar / rail
 * ======================================================================== */
.gh-review-rail {
  display: flex;
  flex-direction: column;
  gap: var(--gh-block-gap);
}

.gh-reviewers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.gh-reviewers li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.gh-reviewers img { width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto; }
.gh-reviewers .gh-reviewer-name { font-weight: 600; color: var(--gh-fg); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gh-reviewers .gh-review-state { margin-left: auto; flex: 0 0 auto; }

.gh-review-state[data-state="approved"] { color: var(--gh-success-fg); }
.gh-review-state[data-state="changes_requested"] { color: var(--gh-danger-fg); }
.gh-review-state[data-state="commented"] { color: var(--gh-fg-muted); }
.gh-review-state[data-state="pending"] { color: var(--gh-attention-fg); }

/* Approvals summary bar */
.gh-approvals {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  padding: 10px 12px;
  font-size: 13px;
  background: var(--gh-canvas);
}

.gh-approvals[data-satisfied="true"] {
  border-color: var(--gh-success-muted, var(--gh-success));
  background: var(--gh-success-subtle);
  color: var(--gh-success-fg);
}

/* Review submission panel */
.repository .review-box,
.gh-review-panel {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  background: var(--gh-canvas);
  padding: 16px;
}

.gh-review-panel fieldset { border: 0; margin: 12px 0 0; padding: 0; }
.gh-review-panel legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.gh-review-panel label { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding: 6px 0; }
.gh-review-panel label .gh-review-hint { color: var(--gh-fg-muted); display: block; font-size: 12px; }

/* Pending review counter shown while a review is in progress */
.gh-review-pending-count {
  background: var(--gh-attention-subtle);
  border-radius: var(--gh-radius-pill);
  color: var(--gh-attention-fg);
  font-size: 12px;
  font-weight: 600;
  padding: 0 8px;
  line-height: 20px;
}

/* Inline review comment threads inside the diff */
.repository .comment-code-cloud,
.gh-review-thread {
  background: var(--gh-canvas-subtle);
  border-top: 1px solid var(--gh-border);
  border-bottom: 1px solid var(--gh-border);
  padding: 12px 16px;
}

.gh-review-thread .gh-thread-resolved {
  color: var(--gh-done-fg);
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================================
 * PR list — same skeleton as the issue list plus a draft state
 * ======================================================================== */
.issue-list-item[data-state="merged"] .gh-issue-icon { color: var(--gh-done-fg); }
.issue-list-item[data-state="draft"] .gh-issue-icon { color: var(--gh-fg-subtle); }

/* Diff stat mini-bar (+12 −4) */
.gh-diffstat {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--gh-font-mono);
  font-size: 12px;
}

.gh-diffstat .gh-add { color: var(--gh-success-fg); }
.gh-diffstat .gh-del { color: var(--gh-danger-fg); }

.gh-diffstat-blocks { display: inline-flex; gap: 2px; margin-left: 4px; }

.gh-diffstat-blocks i {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 1px;
  background: var(--gh-border);
}

.gh-diffstat-blocks i[data-kind="add"] { background: var(--gh-success); }
.gh-diffstat-blocks i[data-kind="del"] { background: var(--gh-danger); }

/* === 09-diff.css === */
/*!
 * forgejo-github-theme — 09-diff
 * Diff viewer: spacing, syntax highlighting, file folding, sticky headers,
 * split/unified modes, word-level highlights, expandable context.
 * SPDX-License-Identifier: MIT
 */

/* ==========================================================================
 * Diff summary bar (files changed / additions / deletions)
 * ======================================================================== */
.repository .diff-detail-box,
.diff-detail-box,
.gh-diff-summary {
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  color: var(--gh-fg-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 14px;
  margin-bottom: 16px;
  padding: 10px 16px;
}

.diff-detail-box .diff-stats-add,
.gh-diff-summary .gh-add { color: var(--gh-success-fg); font-weight: 600; }
.diff-detail-box .diff-stats-del,
.gh-diff-summary .gh-del { color: var(--gh-danger-fg); font-weight: 600; }

/* ==========================================================================
 * File box
 * ======================================================================== */
.diff-file-box,
.gh-diff-file {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  background: var(--gh-canvas);
  margin-bottom: 16px;
  overflow: hidden;
  /* Long diffs stay cheap to paint while scrolled out of view. */
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
}

.diff-file-box .diff-file-header,
.gh-diff-file > .gh-diff-file-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--gh-canvas-subtle);
  border-bottom: 1px solid var(--gh-border);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--gh-fg-muted);
  min-height: 40px;
}

.diff-file-box .diff-file-header .file,
.gh-diff-file-name {
  font-family: var(--gh-font-mono);
  font-size: 12px;
  color: var(--gh-fg);
  font-weight: 600;
  word-break: break-all;
  min-width: 0;
}

/* Fold / unfold control */
.diff-file-box .fold-file,
.gh-diff-fold {
  background: transparent;
  border: 0;
  border-radius: var(--gh-radius-small);
  color: var(--gh-fg-muted);
  cursor: pointer;
  flex: 0 0 auto;
  padding: 2px;
  transition: background-color var(--gh-motion-fast) var(--gh-ease),
              transform var(--gh-motion) var(--gh-ease);
}

.diff-file-box .fold-file:hover,
.gh-diff-fold:hover { background: var(--gh-border-muted); }

.diff-file-box[data-folded="true"] .fold-file svg,
.gh-diff-file[data-folded="true"] .gh-diff-fold svg { transform: rotate(-90deg); }

.diff-file-box[data-folded="true"] .diff-file-body,
.gh-diff-file[data-folded="true"] .gh-diff-file-body { display: none; }

/* "Viewed" checkbox on the right of the header */
.gh-diff-viewed {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gh-fg-muted);
}

.gh-diff-file[data-viewed="true"] { opacity: 0.72; }
.gh-diff-file[data-viewed="true"] .gh-diff-file-body { display: none; }

/* ==========================================================================
 * Code table
 * ======================================================================== */
.diff-file-body .file-body,
.diff-file-box table,
.gh-diff-file-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--gh-font-mono);
  font-size: 12px;
  line-height: 20px;
  tab-size: 4;
}

.code-diff td.lines-num,
.diff-file-box .lines-num {
  background: var(--gh-canvas);
  border-right: 1px solid var(--gh-border-muted);
  color: var(--gh-fg-subtle);
  min-width: 44px;
  padding: 0 10px;
  text-align: right;
  user-select: none;
  vertical-align: top;
  white-space: nowrap;
  width: 1%;
}

.code-diff td.lines-type-marker,
.diff-file-box .lines-type-marker {
  padding: 0 4px 0 8px;
  user-select: none;
  vertical-align: top;
  width: 1%;
  color: var(--gh-fg-subtle);
}

.code-diff td.lines-code,
.diff-file-box .lines-code {
  padding: 0 10px;
  vertical-align: top;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Row states */
.code-diff .add-code,
.code-diff tr.added .lines-code,
.diff-file-box .lines-code.add-code {
  background: var(--gh-diff-add-bg);
}

.code-diff .del-code,
.code-diff tr.removed .lines-code,
.diff-file-box .lines-code.del-code {
  background: var(--gh-diff-del-bg);
}

.code-diff .add-code + .lines-num,
.code-diff tr.added .lines-num { background: color-mix(in srgb, var(--gh-diff-add-bg) 65%, var(--gh-canvas)); }
.code-diff tr.removed .lines-num { background: color-mix(in srgb, var(--gh-diff-del-bg) 65%, var(--gh-canvas)); }

/* Word-level highlight inside a changed line */
.code-diff .added-code,
.removed-code ~ .added-code,
span.added-code { background: var(--gh-diff-add-word); border-radius: 2px; }
.code-diff .removed-code,
span.removed-code { background: var(--gh-diff-del-word); border-radius: 2px; }

/* Hunk header (@@ -1,4 +1,6 @@) */
.code-diff .tag-code,
.code-diff tr.tag-code td,
.diff-file-box .tag-code {
  background: var(--gh-diff-hunk-bg) !important;
  color: var(--gh-diff-hunk-fg) !important;
  border-top: 1px solid var(--gh-border-muted);
  border-bottom: 1px solid var(--gh-border-muted);
  font-size: 12px;
  padding: 4px 10px;
}

/* Expand-context buttons */
.code-diff .code-expander-button,
.diff-file-box .code-expander-button {
  background: var(--gh-accent-subtle);
  border: 0;
  color: var(--gh-accent-fg);
  cursor: pointer;
  padding: 2px 6px;
  width: 100%;
  transition: background-color var(--gh-motion-fast) var(--gh-ease);
}

.code-diff .code-expander-button:hover { background: var(--gh-accent); color: var(--gh-fg-on-emphasis); }

/* Split view keeps a visible gutter between the two panes. */
.diff-file-box.file-content.split-diff .lines-code:nth-of-type(2),
.code-diff-split td:nth-child(3) { border-left: 1px solid var(--gh-border); }

.code-diff-split .lines-code.blob-excerpt,
.code-diff .lines-code.blob-excerpt { background: var(--color-diff-inactive); }

/* Empty placeholder cells in split mode */
.code-diff-split tr td.lines-num:empty,
.code-diff-split tr td.lines-code:empty { background: var(--color-diff-inactive); }

/* ==========================================================================
 * Inline comment affordance
 * ======================================================================== */
.code-diff .add-comment-left,
.code-diff .add-comment-right { background: var(--gh-canvas-subtle); }

.code-diff .lines-num .add-code-comment,
.gh-add-comment-button {
  background: var(--gh-accent);
  border: 0;
  border-radius: var(--gh-radius-small);
  color: #fff;
  cursor: pointer;
  display: none;
  height: 20px;
  line-height: 1;
  padding: 0 4px;
  position: absolute;
  transform: translateX(-6px);
  width: 20px;
}

.code-diff tr:hover .add-code-comment { display: inline-flex; align-items: center; justify-content: center; }

/* ==========================================================================
 * Sticky headers
 * ======================================================================== */
html[data-gh-sticky-toolbar="on"] .gh-diff-file > .gh-diff-file-header {
  position: sticky;
  top: var(--gh-sticky-offset, var(--gh-header-height));
  z-index: 20;
  box-shadow: 0 1px 0 var(--gh-border);
}

/* File-list drawer at the top of "Files changed" */
.gh-diff-filelist {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.gh-diff-filelist > summary {
  background: var(--gh-canvas-subtle);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  list-style: none;
}

.gh-diff-filelist > summary::-webkit-details-marker { display: none; }

.gh-diff-filelist ul { list-style: none; margin: 0; padding: 4px 0; max-height: 320px; overflow: auto; }

.gh-diff-filelist li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px;
  font-family: var(--gh-font-mono);
  font-size: 12px;
  color: var(--gh-fg);
}

.gh-diff-filelist li a:hover { background: var(--gh-canvas-subtle); text-decoration: none; }

/* ==========================================================================
 * Blame
 * ======================================================================== */
.repository .file-view.blame .blame-info,
.blame-info {
  background: var(--gh-canvas-subtle);
  border-right: 1px solid var(--gh-border-muted);
  color: var(--gh-fg-muted);
  font-family: var(--gh-font-sans);
  font-size: 12px;
  padding: 0 8px;
  vertical-align: top;
}

/* ==========================================================================
 * Image diffs
 * ======================================================================== */
.diff-file-box .image-diff-container {
  background: var(--gh-canvas-subtle);
  padding: 16px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.diff-file-box .image-diff-container img {
  background: repeating-conic-gradient(var(--gh-canvas-inset) 0% 25%, var(--gh-canvas) 0% 50%) 50% / 16px 16px;
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-small);
}

/* ==========================================================================
 * Binary / too-large notices
 * ======================================================================== */
.diff-file-box .diff-file-body .binary-file-message,
.gh-diff-notice {
  color: var(--gh-fg-muted);
  font-family: var(--gh-font-sans);
  font-size: 13px;
  padding: 24px 16px;
  text-align: center;
}

/* === 10-markdown.css === */
/*!
 * forgejo-github-theme — 10-markdown
 * GitHub Markdown styling for Forgejo's `.markup` container: headings, tables,
 * task lists, alerts/callouts, code blocks, mermaid, footnotes.
 * SPDX-License-Identifier: MIT
 */

.markup {
  color: var(--gh-fg);
  font-family: var(--gh-font-sans);
  font-size: 16px;
  line-height: 1.5;
  word-wrap: break-word;
}

html[data-gh-density="compact"] .markup { font-size: 15px; }

.markup > *:first-child { margin-top: 0 !important; }
.markup > *:last-child { margin-bottom: 0 !important; }

/* ==========================================================================
 * Headings
 * ======================================================================== */
.markup h1,
.markup h2,
.markup h3,
.markup h4,
.markup h5,
.markup h6 {
  font-weight: 600;
  line-height: 1.25;
  margin-top: 24px;
  margin-bottom: 16px;
}

.markup h1 { font-size: 2em; padding-bottom: 0.3em; border-bottom: 1px solid var(--gh-border-muted); }
.markup h2 { font-size: 1.5em; padding-bottom: 0.3em; border-bottom: 1px solid var(--gh-border-muted); }
.markup h3 { font-size: 1.25em; }
.markup h4 { font-size: 1em; }
.markup h5 { font-size: 0.875em; }
.markup h6 { font-size: 0.85em; color: var(--gh-fg-muted); }

/* Anchor link that appears on hover */
.markup h1 .anchor,
.markup h2 .anchor,
.markup h3 .anchor,
.markup h4 .anchor,
.markup h5 .anchor,
.markup h6 .anchor {
  float: left;
  margin-left: -20px;
  padding-right: 4px;
  opacity: 0;
  color: var(--gh-fg-muted);
  transition: opacity var(--gh-motion) var(--gh-ease);
}

.markup h1:hover .anchor,
.markup h2:hover .anchor,
.markup h3:hover .anchor,
.markup h4:hover .anchor,
.markup h5:hover .anchor,
.markup h6:hover .anchor,
.markup .anchor:focus-visible { opacity: 1; }

/* ==========================================================================
 * Text blocks
 * ======================================================================== */
.markup p,
.markup blockquote,
.markup ul,
.markup ol,
.markup dl,
.markup table,
.markup pre,
.markup details { margin-top: 0; margin-bottom: 16px; }

.markup ul,
.markup ol { padding-left: 2em; }

.markup li + li { margin-top: 0.25em; }
.markup li > p { margin-top: 16px; }

.markup dl dt { font-weight: 600; font-style: italic; margin-top: 16px; padding: 0; }
.markup dl dd { margin-left: 0; padding: 0 16px; }

.markup blockquote {
  border-left: 0.25em solid var(--gh-border);
  color: var(--gh-fg-muted);
  padding: 0 1em;
}

.markup blockquote > :first-child { margin-top: 0; }
.markup blockquote > :last-child { margin-bottom: 0; }

.markup hr {
  background: var(--gh-border);
  border: 0;
  height: 0.25em;
  margin: 24px 0;
  padding: 0;
}

.markup a { color: var(--gh-accent-fg); }
.markup a:hover { text-decoration: underline; }

.markup strong { font-weight: 600; }
.markup sup, .markup sub { line-height: 0; }

.markup img {
  background-color: var(--gh-canvas);
  box-sizing: content-box;
  max-width: 100%;
  border-radius: var(--gh-radius-small);
}

.markup kbd {
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-bottom-color: var(--gh-border-strong);
  border-radius: var(--gh-radius-small);
  box-shadow: inset 0 -1px 0 var(--gh-border-strong);
  color: var(--gh-fg);
  display: inline-block;
  font-size: 11px;
  line-height: 10px;
  padding: 3px 5px;
  vertical-align: middle;
}

/* ==========================================================================
 * Tables
 * ======================================================================== */
.markup table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow: auto;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 14px;
}

.markup table th,
.markup table td {
  border: 1px solid var(--gh-border);
  padding: 6px 13px;
}

.markup table th { background: var(--gh-canvas-subtle); font-weight: 600; }
.markup table tr { background: var(--gh-canvas); border-top: 1px solid var(--gh-border-muted); }
.markup table tr:nth-child(2n) { background: var(--color-markup-table-row); }
.markup table img { background-color: transparent; }

/* ==========================================================================
 * Code
 * ======================================================================== */
.markup code,
.markup tt {
  background: var(--color-markup-code-inline, var(--gh-canvas-subtle));
  border-radius: var(--gh-radius-small);
  font-family: var(--gh-font-mono);
  font-size: 85%;
  margin: 0;
  padding: 0.2em 0.4em;
  white-space: break-spaces;
}

.markup pre {
  background: var(--color-markup-code-block, var(--gh-canvas-subtle));
  border-radius: var(--gh-radius);
  font-family: var(--gh-font-mono);
  font-size: 85%;
  line-height: 1.45;
  overflow: auto;
  padding: 16px;
}

.markup pre > code,
.markup pre code {
  background: transparent;
  border: 0;
  font-size: 100%;
  margin: 0;
  padding: 0;
  white-space: pre;
  word-break: normal;
}

/* Copy button Forgejo injects into fenced blocks */
.markup .code-copy,
.markup pre .code-copy {
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-small);
  color: var(--gh-fg-muted);
  cursor: pointer;
  opacity: 0;
  padding: 4px 6px;
  position: absolute;
  right: 8px;
  top: 8px;
  transition: opacity var(--gh-motion) var(--gh-ease);
}

.markup pre:hover .code-copy,
.markup .code-copy:focus-visible { opacity: 1; }

/* ==========================================================================
 * Task lists
 * ======================================================================== */
.markup .task-list-item {
  list-style-type: none;
}

.markup .task-list-item + .task-list-item { margin-top: 4px; }

.markup ul.contains-task-list,
.markup ol.contains-task-list { padding-left: 1.4em; }

.markup .task-list-item input[type="checkbox"],
.markup .task-list-item-checkbox {
  margin: 0 0.2em 0.25em -1.4em;
  vertical-align: middle;
  accent-color: var(--gh-accent);
  cursor: pointer;
}

.markup .task-list-item input[type="checkbox"]:checked + * { color: var(--gh-fg-muted); }

/* ==========================================================================
 * Alerts / callouts  ( > [!NOTE] etc. )
 * Forgejo renders these as .attention-header + .attention-<type> blockquotes.
 * The generic [class*="attention-"] selectors keep this working across the
 * small markup differences between Forgejo point releases.
 * ======================================================================== */
.markup .attention-note,
.markup .attention-tip,
.markup .attention-important,
.markup .attention-warning,
.markup .attention-caution,
.markup blockquote[class*="attention-"],
.markup .markdown-alert {
  border-left: 0.25em solid var(--gh-border);
  color: inherit;
  padding: 8px 16px;
  margin-bottom: 16px;
  border-radius: 0 var(--gh-radius-small) var(--gh-radius-small) 0;
}

.markup .attention-header,
.markup .markdown-alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 4px;
}

.markup .attention-note,
.markup .markdown-alert-note { border-left-color: var(--gh-accent); background: color-mix(in srgb, var(--gh-accent) 6%, transparent); }
.markup .attention-note .attention-header,
.markup .markdown-alert-note .markdown-alert-title { color: var(--gh-accent-fg); }

.markup .attention-tip,
.markup .markdown-alert-tip { border-left-color: var(--gh-success); background: color-mix(in srgb, var(--gh-success) 6%, transparent); }
.markup .attention-tip .attention-header,
.markup .markdown-alert-tip .markdown-alert-title { color: var(--gh-success-fg); }

.markup .attention-important,
.markup .markdown-alert-important { border-left-color: var(--gh-done); background: color-mix(in srgb, var(--gh-done) 6%, transparent); }
.markup .attention-important .attention-header,
.markup .markdown-alert-important .markdown-alert-title { color: var(--gh-done-fg); }

.markup .attention-warning,
.markup .markdown-alert-warning { border-left-color: var(--gh-attention); background: color-mix(in srgb, var(--gh-attention) 8%, transparent); }
.markup .attention-warning .attention-header,
.markup .markdown-alert-warning .markdown-alert-title { color: var(--gh-attention-fg); }

.markup .attention-caution,
.markup .markdown-alert-caution { border-left-color: var(--gh-danger); background: color-mix(in srgb, var(--gh-danger) 6%, transparent); }
.markup .attention-caution .attention-header,
.markup .markdown-alert-caution .markdown-alert-title { color: var(--gh-danger-fg); }

.markup [class*="attention-"] > p:last-child,
.markup .markdown-alert > p:last-child { margin-bottom: 0; }

/* ==========================================================================
 * Details / summary
 * ======================================================================== */
.markup details {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  padding: 0;
}

.markup details > summary {
  background: var(--gh-canvas-subtle);
  cursor: pointer;
  font-weight: 600;
  list-style: revert;
  padding: 8px 12px;
}

.markup details[open] > summary { border-bottom: 1px solid var(--gh-border-muted); }
.markup details > *:not(summary) { margin-left: 12px; margin-right: 12px; }
.markup details > *:not(summary):first-of-type { margin-top: 12px; }

/* ==========================================================================
 * Mermaid
 * ======================================================================== */
.markup .mermaid-chart,
.markup pre.mermaid,
.markup .mermaid {
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  display: flex;
  justify-content: center;
  overflow: auto;
  padding: 16px;
  margin-bottom: 16px;
}

.markup .mermaid-chart svg,
.markup .mermaid svg { max-width: 100%; height: auto; }

/* Mermaid inherits our token colours where it exposes CSS hooks. */
.markup .mermaid .node rect,
.markup .mermaid .node polygon,
.markup .mermaid .node circle { stroke: var(--gh-border-strong); fill: var(--gh-canvas); }
.markup .mermaid .edgePath .path { stroke: var(--gh-fg-muted); }
.markup .mermaid text { fill: var(--gh-fg) !important; }

/* ==========================================================================
 * Footnotes
 * ======================================================================== */
.markup .footnotes {
  border-top: 1px solid var(--gh-border-muted);
  color: var(--gh-fg-muted);
  font-size: 12px;
  margin-top: 32px;
  padding-top: 16px;
}

.markup .footnotes ol { padding-left: 16px; }
.markup .footnotes li:target { background: var(--color-highlight-bg); }

/* ==========================================================================
 * README container on the repository home page
 * ======================================================================== */
.repository #readme,
.repository .ui.segment#readme,
.gh-readme {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius);
  background: var(--gh-canvas);
  padding: 0;
  overflow: hidden;
}

.gh-readme > header,
.repository #readme > .ui.attached.header {
  background: var(--gh-canvas-subtle);
  border-bottom: 1px solid var(--gh-border-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
}

.gh-readme > .markup,
.repository #readme > .markup { padding: 32px; }

@media (max-width: 767px) {
  .gh-readme > .markup,
  .repository #readme > .markup { padding: 16px; }
}

/* README quick links (auto-generated table of contents in the sidebar) */
.gh-readme-toc { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.gh-readme-toc li { padding-left: calc((var(--gh-toc-depth, 1) - 1) * 12px); }
.gh-readme-toc a {
  display: block;
  padding: 3px 0;
  color: var(--gh-fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gh-readme-toc a:hover { color: var(--gh-accent-fg); text-decoration: none; }

/* === 11-responsive.css === */
/*!
 * forgejo-github-theme — 11-responsive
 * Desktop / tablet / mobile behaviour. Breakpoints follow GitHub's:
 *   >= 1280px  wide desktop   (right rail visible)
 *   >= 1012px  desktop        (right rail visible, narrower)
 *   >=  768px  tablet         (right rail becomes a drawer)
 *   <   768px  mobile         (single column, drawer, larger tap targets)
 * SPDX-License-Identifier: MIT
 */

/* ==========================================================================
 * Wide desktop
 * ======================================================================== */
@media (min-width: 1400px) {
  :root { --gh-content-max: 1400px; }
}

/* ==========================================================================
 * Desktop -> tablet: the persistent rail turns into an off-canvas drawer
 * ======================================================================== */
@media (max-width: 1011px) {
  html[data-gh-sidebar="on"] body { padding-right: 0; }

  #gh-sidebar {
    width: min(360px, 88vw);
    transform: translateX(100%);
    transition: transform var(--gh-motion) var(--gh-ease);
    box-shadow: var(--gh-shadow-large);
    z-index: 800;
    top: 0;
  }

  html[data-gh-sidebar-side="left"] #gh-sidebar { transform: translateX(-100%); }

  html[data-gh-drawer="open"] #gh-sidebar { transform: none; }

  /* Backdrop behind the drawer */
  html[data-gh-drawer="open"] body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--color-overlay-backdrop, rgb(31 35 40 / 50%));
    z-index: 700;
    animation: gh-fade var(--gh-motion) var(--gh-ease);
  }

  /* Resizing is pointless in drawer mode. */
  #gh-sidebar .gh-resizer { display: none; }

  /* Base styles for .gh-drawer-toggle live in 02-layout.css so the control is
     visible on wide screens too, where it is the only way to bring a hidden
     rail back. */

  .gh-dashboard-grid,
  .repository.view.issue .issue-content,
  .gh-issue-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-gh-sticky-sidebar="on"] .gh-dashboard-grid > .gh-dash-aside,
  html[data-gh-sticky-sidebar="on"] .repository.view.issue .issue-content-right,
  html[data-gh-sticky-sidebar="on"] .gh-issue-aside {
    position: static;
    max-height: none;
    overflow: visible;
  }

  /* The VS Code style tree costs too much width below 1012px. */
  #gh-filetree { display: none; }
}

/* On a wide screen the toggle is redundant while the rail is actually on
   screen — but it must stay available once the rail has been hidden, otherwise
   there is no way back short of clearing localStorage. */
@media (min-width: 1012px) {
  html[data-gh-sidebar="on"] .gh-drawer-toggle { display: none !important; }
}

/* ==========================================================================
 * Tablet
 * ======================================================================== */
@media (max-width: 991px) {
  .page-content > .ui.container,
  .ui.container:not(.fluid) { padding-inline: 12px; }

  .repository .repo-header { flex-direction: column; align-items: stretch; }
  .repository .repo-buttons { justify-content: flex-start; }

  /* Release rows stop being two-column. */
  .repository.release #release-list > li,
  .gh-release { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* ==========================================================================
 * Mobile
 * ======================================================================== */
@media (max-width: 767px) {
  :root {
    --gh-header-height: 54px;
    --gh-font-size: 14px;
  }

  body { padding-right: 0 !important; }

  /* Navbar collapses to brand + burger; Forgejo already ships the toggle. */
  #navbar { padding: 0 12px; flex-wrap: wrap; }
  #navbar .item { padding: 10px 8px; }
  #navbar .ui.input > input,
  #navbar input[name="q"] { min-width: 0; width: 100%; }
  #navbar .ui.input:focus-within > input { min-width: 0; }

  .page-content > .ui.container,
  .ui.container:not(.fluid) { padding-inline: 12px; }

  /* Tabs scroll horizontally instead of wrapping into a tall stack. */
  .ui.tabular.menu,
  .overflow-menu.ui.secondary.pointing.menu,
  .gh-pr-subnav,
  .explore .ui.secondary.menu {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .ui.tabular.menu::-webkit-scrollbar,
  .gh-pr-subnav::-webkit-scrollbar { display: none; }

  .ui.tabular.menu .item,
  .gh-pr-subnav a { white-space: nowrap; flex: 0 0 auto; }

  /* Cards go single-column. */
  .gh-pinned { grid-template-columns: minmax(0, 1fr); }

  /* Stack the row: icon above the name is fine when width is the constraint. */
  .explore .flex-list .flex-item-header,
  .organization .flex-list .flex-item-header { flex-direction: column; gap: 6px; }

  /* File table: drop the commit-message column, keep name + age. */
  #repo-files-table .message,
  .repo-file-table .message { display: none; }
  #repo-files-table tbody td,
  .repo-file-table tbody td { padding: 10px 12px; }

  /* Diffs read better wrapped and unified on a phone. */
  .code-diff td.lines-num,
  .diff-file-box .lines-num { min-width: 32px; padding: 0 6px; font-size: 11px; }
  .code-diff td.lines-code,
  .diff-file-box .lines-code { font-size: 11px; padding: 0 6px; }
  .diff-file-box .diff-file-header { padding: 8px; }

  /* Comments lose the avatar gutter. */
  .repository.view.issue .comment-form,
  #comment-form { padding-left: 0; }
  .repository.view.issue .comment-form .ui.avatar,
  #comment-form > .ui.avatar { display: none; }

  .timeline::before { left: 12px; }
  .timeline-item,
  .timeline .event { padding-left: 40px; }
  .timeline-item .badge,
  .timeline .event .badge { width: 24px; height: 24px; left: 0; }

  /* Bigger tap targets — WCAG 2.2 target size. */
  .ui.button,
  a.ui.button,
  .ui.pagination.menu .item,
  .gh-links > li > a { min-height: 36px; display: inline-flex; align-items: center; }

  .markup { font-size: 15px; }
  .gh-readme > .markup { padding: 16px; }

  .gh-issue-toolbar { flex-direction: column; align-items: flex-start; }

  /* Modals become near-fullscreen sheets. */
  .ui.modal { width: calc(100vw - 24px) !important; margin: 12px !important; }

  #gh-palette { padding-top: 8vh; }
  .gh-palette-box { max-height: 80vh; }
}

/* ==========================================================================
 * Very small phones
 * ======================================================================== */
@media (max-width: 420px) {
  .repository .repo-buttons .ui.labeled.button > .label { display: none; }
  .gh-diff-summary { font-size: 12px; }
  .gh-profile-name { font-size: 20px; }
}

/* ==========================================================================
 * Touch devices — hover-only affordances become always-visible
 * ======================================================================== */
@media (hover: none) {
  .markup h1 .anchor,
  .markup h2 .anchor,
  .markup h3 .anchor,
  .markup h4 .anchor,
  .markup h5 .anchor,
  .markup h6 .anchor,
  .markup .code-copy { opacity: 1; }

  .gh-card:hover,
  .gh-pinned > li:hover,
  .gh-repo-card:hover { transform: none; box-shadow: none; }
}

/* ==========================================================================
 * Landscape phones — keep the sticky chrome from eating the viewport
 * ======================================================================== */
@media (max-height: 520px) {
  html[data-gh-sticky-header="on"] #navbar,
  html[data-gh-sticky-repo-header="on"] .gh-repo-header,
  html[data-gh-sticky-toolbar="on"] .gh-file-toolbar {
    position: static;
  }
}

/* ==========================================================================
 * The left navigation rail costs too much width below the desktop breakpoint,
 * and everything in it is reachable from Forgejo's own repository tab bar.
 * ======================================================================== */
@media (max-width: 1011px) {
  html[data-gh-navrail="on"] #gh-nav-rail { display: none; }
  html[data-gh-navrail="on"] body { padding-left: 0; }
  .gh-navrail-toggle { display: none !important; }
}

/* Restore control for a collapsed navigation rail. */
.gh-navrail-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 690;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gh-border);
  background: var(--gh-canvas);
  color: var(--gh-fg);
  box-shadow: var(--gh-shadow-large);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gh-navrail-toggle:hover { background: var(--gh-canvas-subtle); }
.gh-navrail-toggle:focus-visible { outline: 2px solid var(--gh-accent); outline-offset: 2px; }

/* === 12-a11y.css === */
/*!
 * forgejo-github-theme — 12-a11y
 * Focus visibility, keyboard affordances, reduced motion, forced colours,
 * screen-reader helpers.
 *
 * Contrast notes (WCAG 2.1 AA, verified against the token values shipped in
 * themes/github.css and themes/github-dark.css):
 *   light  #1f2328 on #ffffff -> 15.3:1   body text            (AAA)
 *   light  #59636e on #ffffff ->  5.1:1   muted text           (AA)
 *   light  #6e7781 on #ffffff ->  4.5:1   subtle text          (AA, min)
 *   light  #0969da on #ffffff ->  4.6:1   links                (AA)
 *   light  #ffffff on #2da44e ->  3.1:1   primary button — large/bold text
 *                                          and a 1px dark border carry it
 *   light  #cf222e on #ffffff ->  5.1:1   danger text          (AA)
 *   light  #1a7f37 on #ffffff ->  4.5:1   success text         (AA)
 *   light  #9a6700 on #ffffff ->  4.6:1   attention text       (AA)
 *   dark   #e6edf3 on #0d1117 -> 14.7:1   body text            (AAA)
 *   dark   #9198a1 on #0d1117 ->  6.6:1   muted text           (AA)
 *   dark   #2f81f7 on #0d1117 ->  5.2:1   links                (AA)
 *   dark   #f85149 on #0d1117 ->  5.3:1   danger text          (AA)
 *   dark   #3fb950 on #0d1117 ->  7.7:1   success text         (AAA)
 *   dark   #d29922 on #0d1117 ->  7.4:1   attention text       (AAA)
 * Never lower --gh-fg-muted below #6e7781 (light) / #8b949e (dark) when
 * rebranding: that is the AA floor for 14px text on the theme canvases.
 *
 * SPDX-License-Identifier: MIT
 */

/* ==========================================================================
 * Focus
 * ======================================================================== */

/* Remove the UA default only where we replace it. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus {
  outline: none;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.ui.button:focus-visible,
.ui.dropdown:focus-visible,
.ui.checkbox input:focus-visible + label::before {
  outline: 2px solid var(--gh-accent);
  outline-offset: 2px;
  border-radius: var(--gh-radius-small);
}

/* Inputs get the ring rather than an offset outline so they don't jump. */
.ui.form input:focus-visible,
.ui.form textarea:focus-visible,
.ui.input > input:focus-visible {
  outline: 2px solid var(--gh-accent);
  outline-offset: -1px;
}

/* Anything the theme makes interactive must be reachable. */
#gh-sidebar .gh-resizer,
#gh-filetree .gh-tree-resizer {
  /* focusable via tabindex="0" set in theme.js */
}

/* ==========================================================================
 * Skip link — injected by theme.js as the first focusable element.
 * ======================================================================== */
.gh-skip-link {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 1000;
  padding: 8px 16px;
  background: var(--gh-canvas);
  border: 1px solid var(--gh-accent);
  border-radius: var(--gh-radius);
  color: var(--gh-accent-fg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--gh-shadow-large);
  transform: translateY(-200%);
  transition: transform var(--gh-motion) var(--gh-ease);
}

.gh-skip-link:focus { transform: none; text-decoration: none; }

/* ==========================================================================
 * Screen-reader-only text
 * ======================================================================== */
.gh-sr-only,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.gh-sr-only:focus-within,
.gh-sr-only-focusable:focus {
  position: static !important;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
}

/* ==========================================================================
 * Keyboard hints
 * ======================================================================== */
kbd,
.gh-kbd {
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-bottom-color: var(--gh-border-strong);
  border-radius: var(--gh-radius-small);
  color: var(--gh-fg-muted);
  display: inline-block;
  font-family: var(--gh-font-mono);
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px;
}

/* ==========================================================================
 * Reduced motion — disable every transition and animation the theme adds.
 * ======================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .gh-card:hover,
  .gh-pinned > li:hover,
  .gh-repo-card:hover,
  .gh-topic:hover,
  .gh-avatars a:hover img,
  .gh-orgs a:hover img,
  .project-column .card:hover {
    transform: none;
  }

  .gh-check-icon[data-state="pending"] svg { animation: none; }
}

/* ==========================================================================
 * Forced colours / Windows high contrast
 * ======================================================================== */
@media (forced-colors: active) {
  .ui.button,
  .gh-card,
  .gh-panel,
  #gh-sidebar,
  .gh-palette-box,
  .diff-file-box {
    border: 1px solid CanvasText;
  }

  .ui.tabular.menu .item.active::after,
  .gh-pr-subnav a[aria-current="page"]::after {
    background: Highlight;
    forced-color-adjust: none;
  }

  :where(a, button, input, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid Highlight;
  }

  .gh-langbar span,
  .gh-dot,
  .gh-diffstat-blocks i { forced-color-adjust: none; }
}

/* ==========================================================================
 * Density / motion preference echo for assistive tech
 * ======================================================================== */
[aria-busy="true"] { cursor: progress; }
[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }

/* Live region used by theme.js to announce drawer / density changes. */
#gh-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

/* ==========================================================================
 * Roving-focus list support (command palette, file tree)
 * ======================================================================== */
[role="listbox"] [role="option"][aria-selected="true"] {
  outline: none;
}

[role="tree"] [role="treeitem"]:focus-visible {
  outline: 2px solid var(--gh-accent);
  outline-offset: -2px;
}

/* Ensure disabled controls still meet 3:1 non-text contrast on both canvases */
:disabled,
.disabled { color: var(--gh-fg-subtle); }

/* === 13-trim.css === */
/*!
 * forgejo-github-theme — 13-trim
 *
 * Optional removal of interface elements an instance does not want. Every rule
 * here is gated behind an attribute on <html>, all of which default to "off":
 * a theme should not delete a forge's features unless it is asked to.
 *
 *   data-gh-hide-social  stars, forks, watchers — counts and the action buttons
 *   data-gh-hide-issues  the issue tracker's entry points
 *   data-gh-hide-feeds   RSS / Atom subscription links
 *
 * Turn them on per instance in gh-theme.config.js, which install.sh creates
 * once and never overwrites:
 *
 *   window.GH_THEME.features.hideSocial = "on";
 *
 * These rules only hide the interface. The routes still exist and still work
 * if someone types the URL. To switch the features off for real, use Forgejo's
 * own configuration instead — [repository] DISABLE_STARS, DISABLED_REPO_UNITS,
 * and [other] ENABLE_FEED — and leave these flags off.
 *
 * SPDX-License-Identifier: MIT
 */

/* ==========================================================================
 * Stars / forks / watchers
 * ======================================================================== */
html[data-gh-hide-social="on"] .repo-buttons {
  display: none !important;
}

/* Anything that survives outside the header block: the counter links and the
 * star/watch action forms, plus the labelled-button wrappers around them. */
html[data-gh-hide-social="on"] a[href$="/stars"],
html[data-gh-hide-social="on"] a[href$="/forks"],
html[data-gh-hide-social="on"] a[href$="/watchers"],
html[data-gh-hide-social="on"] form[action$="/action/star"],
html[data-gh-hide-social="on"] form[action$="/action/watch"],
html[data-gh-hide-social="on"] form[action$="/action/unstar"],
html[data-gh-hide-social="on"] form[action$="/action/unwatch"] {
  display: none !important;
}

html[data-gh-hide-social="on"] .ui.labeled.button:has(> a[href$="/stars"]),
html[data-gh-hide-social="on"] .ui.labeled.button:has(> a[href$="/forks"]),
html[data-gh-hide-social="on"] .ui.labeled.button:has(> a[href$="/watchers"]),
html[data-gh-hide-social="on"] .ui.buttons:has(> form[action$="/action/star"]),
html[data-gh-hide-social="on"] .ui.buttons:has(> form[action$="/action/watch"]) {
  display: none !important;
}

/* Profile tabs and dashboard entries that only exist to surface stars. */
html[data-gh-hide-social="on"] a[href*="tab=stars"],
html[data-gh-hide-social="on"] a[href*="tab=watching"],
html[data-gh-hide-social="on"] a[href*="sort=moststars"],
html[data-gh-hide-social="on"] a[href*="sort=mostforks"] {
  display: none !important;
}

/* ==========================================================================
 * Issues
 * ======================================================================== */
html[data-gh-hide-issues="on"] .overflow-menu a.item[href$="/issues"],
html[data-gh-hide-issues="on"] .ui.tabular.menu a.item[href$="/issues"],
html[data-gh-hide-issues="on"] #navbar a[href$="/issues"],
html[data-gh-hide-issues="on"] #gh-nav-rail a[href$="/issues"],
html[data-gh-hide-issues="on"] #gh-sidebar a[href$="/issues"],
html[data-gh-hide-issues="on"] #gh-sidebar a[href*="/issues?"],
html[data-gh-hide-issues="on"] a[href$="/issues/new"],
html[data-gh-hide-issues="on"] a[href$="/milestones"],
html[data-gh-hide-issues="on"] a[href$="/labels"] {
  display: none !important;
}

/* A sidebar block whose only content was issue links collapses entirely. */
html[data-gh-hide-issues="on"] #gh-sidebar .gh-block:has(> h2[id="gh-b-assigned"]),
html[data-gh-hide-issues="on"] #gh-sidebar .gh-block:has(> h2[id="gh-b-pinned-issues"]) {
  display: none !important;
}

/* ==========================================================================
 * RSS / Atom
 * ======================================================================== */
html[data-gh-hide-feeds="on"] a[href$=".rss"],
html[data-gh-hide-feeds="on"] a[href$=".atom"],
html[data-gh-hide-feeds="on"] a[href*=".rss?"],
html[data-gh-hide-feeds="on"] a[href*=".atom?"],
html[data-gh-hide-feeds="on"] a[data-tooltip-content="RSS feed"],
html[data-gh-hide-feeds="on"] .ui.button:has(> svg.octicon-rss) {
  display: none !important;
}

/* ==========================================================================
 * Left-hand navigation rail: mark the page you are on.
 * theme.js sets aria-current on the matching entry.
 * ======================================================================== */
.gh-repo-nav .gh-links > li > a[aria-current="page"] {
  background: var(--gh-accent-subtle);
  color: var(--gh-accent-fg);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--gh-accent);
}

html[data-gh-sidebar-side="left"] .gh-repo-nav .gh-links > li > a[aria-current="page"] {
  box-shadow: inset -2px 0 0 var(--gh-accent);
}

/* ==========================================================================
 * Commit list grouped by date (GitLab style).
 * The rows are inserted into Forgejo's own #commits-table by theme.js.
 * ======================================================================== */
/* Deliberately NOT sticky.
 *
 * A sticky <td> inside a table with `border-collapse: collapse` does not paint
 * reliably: the cell background fails to cover the rows scrolling underneath,
 * so the date bled straight through the commit messages. GitLab's own date
 * headings scroll with the list too, so nothing is lost by dropping it. */
tr.gh-commit-date-row > td {
  background: var(--gh-canvas-subtle);
  border-top: 1px solid var(--gh-border);
  border-bottom: 1px solid var(--gh-border-muted);
  color: var(--gh-fg-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px !important;
}

tr.gh-commit-date-row:first-child > td { border-top: 0; }

tr.gh-commit-date-row .gh-commit-date-count {
  font-weight: 400;
  color: var(--gh-fg-subtle);
  margin-left: 6px;
}

/* The date column on individual rows is redundant once rows are grouped. */
html[data-gh-commit-groups="on"] #commits-table td.text.right.aligned relative-time {
  color: var(--gh-fg-subtle);
}

/* ==========================================================================
 * Repository header band (title + tab bar)
 *
 * With the left navigation rail on, Forgejo's own .secondary-nav repeats what
 * the rail already shows: the repository name and the section tabs. Hiding it
 * reclaims the whole band.
 *
 * Two safety valves, because navigation must never vanish entirely:
 *   * below the desktop breakpoint the rail is hidden, so the band returns
 *   * if the visitor collapses the rail, the band returns too
 * Both overrides carry an extra attribute so they outrank the rule above.
 * ======================================================================== */
html[data-gh-hide-repo-tabs="on"] .page-content.repository .secondary-nav {
  display: none;
}

html[data-gh-hide-repo-tabs="on"][data-gh-navrail="off"] .page-content.repository .secondary-nav {
  display: block;
}

@media (max-width: 1011px) {
  html[data-gh-hide-repo-tabs="on"] .page-content.repository .secondary-nav {
    display: block;
  }
}

/* Without the band, the page content needs its own breathing room at the top.
 *
 * The previous attempt used `.ui.container:first-of-type`, which never matched:
 * `:first-of-type` selects by element type, not by class, and the first div in
 * .page-content is .secondary-nav. Padding the content element itself is both
 * simpler and immune to that class of mistake. The value is the theme's block
 * rhythm token, so it follows the compact/comfortable density setting. */
html[data-gh-hide-repo-tabs="on"] .page-content.repository {
  padding-top: var(--gh-block-gap);
}

/* === fonts.css === */
/*!
 * forgejo-github-theme — fonts
 *
 * The theme ships NO font binaries and makes NO external requests. It uses the
 * platform UI stack, which is what GitHub itself falls back to and what keeps
 * the first paint free of layout shift and of any CDN dependency.
 *
 * To self-host a webfont instead, drop the .woff2 files next to this file,
 * uncomment the @font-face blocks below, and set --gh-font-sans / --gh-font-mono
 * in your branding stylesheet. Nothing else needs to change.
 *
 * SPDX-License-Identifier: MIT
 */

:root {
  /* Platform UI sans — matches the host OS, zero bytes downloaded. */
  --gh-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

  /* Platform monospace, preferring the compact developer faces. */
  --gh-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Roboto Mono", "DejaVu Sans Mono", monospace;
}

/* Numerals line up in tables, diffs and counters. */
.gh-kv dd,
.gh-langlist .gh-pct,
.lines-num,
.gh-diffstat,
.ui.pagination.menu .item {
  font-variant-numeric: tabular-nums;
}

/*
 * ---------------------------------------------------------------------------
 * Optional self-hosted webfont example
 * ---------------------------------------------------------------------------
 * 1. Place the files here:
 *      assets/fonts/inter-regular.woff2
 *      assets/fonts/inter-semibold.woff2
 *      assets/fonts/jetbrains-mono-regular.woff2
 * 2. install.sh copies the whole directory to
 *      <custom>/public/assets/fonts/
 * 3. Uncomment the blocks below and add to your branding CSS:
 *      :root { --gh-font-sans: "Inter", system-ui, sans-serif; }
 *
 * @font-face {
 *   font-family: "Inter";
 *   font-style: normal;
 *   font-weight: 400;
 *   font-display: swap;
 *   src: url("/assets/fonts/inter-regular.woff2") format("woff2");
 * }
 *
 * @font-face {
 *   font-family: "Inter";
 *   font-style: normal;
 *   font-weight: 600;
 *   font-display: swap;
 *   src: url("/assets/fonts/inter-semibold.woff2") format("woff2");
 * }
 *
 * @font-face {
 *   font-family: "JetBrains Mono";
 *   font-style: normal;
 *   font-weight: 400;
 *   font-display: swap;
 *   src: url("/assets/fonts/jetbrains-mono-regular.woff2") format("woff2");
 * }
 */

