:root {
  /* GitHub Primer dark palette */
  --gh-canvas-default: #0d1117;
  --gh-canvas-subtle: #161b22;
  --gh-canvas-inset: #161b22;
  --gh-border-default: #30363d;
  --gh-border-muted: #21262d;
  --gh-fg-default: #e6edf3;
  --gh-fg-muted: #8b949e;
  --gh-fg-subtle: #6e7681;
  --gh-accent-fg: #4493f8;
  --gh-accent-emphasis: #4493f8;
  --gh-accent-muted: #4493f866;
  --gh-accent-subtle: #388bfd26;
  --gh-success-fg: #3fb950;
  --gh-success-emphasis: #238636;
  --gh-success-muted: #2ea04366;
  --gh-success-subtle: #2ea04326;
  --gh-danger-fg: #f85149;
  --gh-danger-emphasis: #f85149;
  --gh-danger-muted: #f8514966;
  --gh-danger-subtle: #f851491a;
  --gh-attention-fg: #d29922;
  --gh-attention-emphasis: #d29922;
  --gh-attention-subtle: #bb800926;
  --gh-done-fg: #a371f7;
  --gh-done-emphasis: #a371f7;
  --gh-neutral-muted: #6e768133;
  --gh-neutral-subtle: #161b2280;

  /* Forgejo base zinc/steel scales kept for widgets that reference them directly */
  --steel-900: #10161d;
  --steel-800: #171e26;
  --steel-700: #242d38;
  --steel-500: #515f70;
  --steel-400: #6d7d8f;
  --steel-300: #8c9caf;
  --steel-200: #aebed0;
  --steel-100: #d2e0f0;
  --zinc-50: #fafafa;
  --zinc-100: #f4f4f5;
  --zinc-150: #ececee;
  --zinc-200: #e4e4e7;
  --zinc-250: #dcdce0;
  --zinc-300: #d4d4d8;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;
  --zinc-600: #52525b;
  --zinc-700: #3f3f46;
  --zinc-800: #27272a;
  --zinc-900: #18181b;

  /* Primary → GitHub accent blue */
  --color-primary: #4493f8;
  --color-primary-contrast: #ffffff;
  --color-primary-dark-1: #316dca;
  --color-primary-dark-2: #2a5fb3;
  --color-primary-dark-3: #24529b;
  --color-primary-dark-4: #1e4684;
  --color-primary-dark-5: #183a6d;
  --color-primary-dark-6: #122e56;
  --color-primary-dark-7: #0d2340;
  --color-primary-light-1: #58a6ff;
  --color-primary-light-2: #79c0ff;
  --color-primary-light-3: #a5d6ff;
  --color-primary-light-4: #388bfd66;
  --color-primary-light-5: #388bfd26;
  --color-primary-light-6: #121d2f;
  --color-primary-light-7: #0d1a2b;
  --color-primary-alpha-10: #4493f819;
  --color-primary-alpha-20: #4493f833;
  --color-primary-alpha-30: #4493f84b;
  --color-primary-alpha-40: #4493f866;
  --color-primary-alpha-50: #4493f880;
  --color-primary-alpha-60: #4493f899;
  --color-primary-alpha-70: #4493f8b3;
  --color-primary-alpha-80: #4493f8cc;
  --color-primary-alpha-90: #4493f8e1;
  --color-primary-hover: var(--color-primary-dark-1);
  --color-primary-active: var(--color-primary-dark-2);

  /* Secondary neutrals */
  --color-secondary: #30363d;
  --color-secondary-dark-1: #6e7681;
  --color-secondary-dark-2: #6e7681;
  --color-secondary-dark-3: #6e7681;
  --color-secondary-dark-4: #8b949e;
  --color-secondary-dark-5: #b1bac4;
  --color-secondary-dark-6: #32383f;
  --color-secondary-dark-7: #6e7681;
  --color-secondary-dark-8: #e6edf3;
  --color-secondary-dark-9: #1b1f24;
  --color-secondary-dark-10: #14171c;
  --color-secondary-dark-11: #21262d;
  --color-secondary-dark-12: #010409;
  --color-secondary-dark-13: #010409;
  --color-secondary-light-1: #21262d;
  --color-secondary-light-2: #161b22;
  --color-secondary-light-3: #161b22;
  --color-secondary-light-4: #0d1117;
  --color-secondary-alpha-10: #30363d19;
  --color-secondary-alpha-20: #30363d33;
  --color-secondary-alpha-30: #30363d4b;
  --color-secondary-alpha-40: #30363d66;
  --color-secondary-alpha-50: #30363d80;
  --color-secondary-alpha-60: #30363d99;
  --color-secondary-alpha-70: #30363db3;
  --color-secondary-alpha-80: #30363dcc;
  --color-secondary-alpha-90: #30363de1;
  --color-secondary-hover: var(--color-secondary-dark-1);
  --color-secondary-active: var(--color-secondary-dark-2);

  /* Console (dark tone, GitHub-like) */
  --color-console-fg: #f0f6fc;
  --color-console-fg-subtle: #8b949e;
  --color-console-bg: #0d1117;
  --color-console-border: #30363d;
  --color-console-hover-bg: #ffffff16;
  --color-console-active-bg: #21262d;
  --color-console-menu-bg: #161b22;
  --color-console-menu-border: #30363d;

  /* Named colors — Primer-aligned */
  --color-red: #f85149;
  --color-orange: #db6d28;
  --color-yellow: #d29922;
  --color-olive: #bcc927;
  --color-green: #3fb950;
  --color-teal: #39c5cf;
  --color-blue: #4493f8;
  --color-violet: #986ee2;
  --color-purple: #a371f7;
  --color-pink: #db61a2;
  --color-brown: #bd8b6b;
  --color-grey: #8b949e;
  --color-black: #e6edf3;

  --color-red-light: #ff7b72;
  --color-orange-light: #f0883e;
  --color-yellow-light: #e3b341;
  --color-olive-light: #c9d613;
  --color-green-light: #3fb950;
  --color-teal-light: #56d4dd;
  --color-blue-light: #58a6ff;
  --color-violet-light: #bc8cff;
  --color-purple-light: #d2a8ff;
  --color-pink-light: #f778ba;
  --color-brown-light: #cfa080;
  --color-grey-light: #6e7681;
  --color-black-light: #6e7681;

  --color-red-dark-1: #da3633;
  --color-orange-dark-1: #ffa657;
  --color-yellow-dark-1: #d29922;
  --color-olive-dark-1: #8a9a10;
  --color-green-dark-1: #7ee787;
  --color-teal-dark-1: #248f99;
  --color-blue-dark-1: #2a5fb3;
  --color-violet-dark-1: #8957e5;
  --color-purple-dark-1: #986ee2;
  --color-pink-dark-1: #bf4b8a;
  --color-brown-dark-1: #9a6f52;
  --color-black-dark-1: #21262d;

  --color-red-dark-2: #b62324;
  --color-orange-dark-2: #984b10;
  --color-yellow-dark-2: #845306;
  --color-olive-dark-2: #6c7a0e;
  --color-green-dark-2: #196c2e;
  --color-teal-dark-2: #1b7c83;
  --color-blue-dark-2: #1e4684;
  --color-violet-dark-2: #6e40c9;
  --color-purple-dark-2: #8957e5;
  --color-pink-dark-2: #9e3670;
  --color-brown-dark-2: #7d5a42;
  --color-black-dark-2: #010409;

  /* ANSI — keep Forgejo defaults */
  --color-ansi-black: #1f2326;
  --color-ansi-red: #cc4848;
  --color-ansi-green: #87ab63;
  --color-ansi-yellow: #cc9903;
  --color-ansi-blue: #3a8ac6;
  --color-ansi-magenta: #d22e8b;
  --color-ansi-cyan: #00918a;
  --color-ansi-white: var(--color-console-fg-subtle);
  --color-ansi-bright-black: #46494d;
  --color-ansi-bright-red: #d15a5a;
  --color-ansi-bright-green: #93b373;
  --color-ansi-bright-yellow: #eaaf03;
  --color-ansi-bright-blue: #4e96cc;
  --color-ansi-bright-magenta: #d74397;
  --color-ansi-bright-cyan: #00b6ad;
  --color-ansi-bright-white: var(--color-console-fg);

  /* Misc */
  --color-gold: #daaa3f;
  --color-white: #ffffff;

  /* Diff (GitHub diff colors) */
  --color-diff-added-word-bg: #2ea04366;
  --color-diff-removed-word-bg: #f8514966;
  --color-diff-added-row-bg: #2ea04326;
  --color-diff-removed-row-bg: #f851491a;
  --color-diff-moved-row-bg: #bb800926;
  --color-diff-added-row-border: #2ea04366;
  --color-diff-removed-row-border: #f8514966;
  --color-diff-moved-row-border: #bb800966;
  --color-diff-inactive: #161b22;

  /* Banners */
  --color-error-border: #f8514966;
  --color-error-bg: #f851491a;
  --color-error-bg-active: #f8514966;
  --color-error-bg-hover: #f8514966;
  --color-error-text: #ffa198;
  --color-success-border: #2ea04366;
  --color-success-bg: #2ea04326;
  --color-success-text: #56d364;
  --color-warning-border: #bb800966;
  --color-warning-bg: #bb800926;
  --color-warning-text: #e3b341;
  --color-info-border: #388bfd66;
  --color-info-bg: #388bfd26;
  --color-info-text: #a5d6ff;

  /* Badges */
  --color-red-badge: #f85149;
  --color-red-badge-bg: #f8514922;
  --color-red-badge-hover-bg: #f8514944;
  --color-green-badge: #3fb950;
  --color-green-badge-bg: #3fb95022;
  --color-green-badge-hover-bg: #3fb95044;
  --color-yellow-badge: #d29922;
  --color-yellow-badge-bg: #d2992222;
  --color-yellow-badge-hover-bg: #d2992244;
  --color-orange-badge: #db6d28;
  --color-orange-badge-bg: #db6d2822;
  --color-orange-badge-hover-bg: #db6d2844;

  /* Body / surfaces */
  --color-body: #0d1117;
  --color-box-header: #161b22;
  --color-box-body: #0d1117;
  --color-box-body-highlight: #161b22;
  --color-text-dark: #e6edf3;
  --color-text: #e6edf3;
  --color-text-light: #b1bac4;
  --color-text-light-1: #8b949e;
  --color-text-light-2: #8b949e;
  --color-text-light-3: #6e7681;
  --color-footer: #161b22;
  --color-timeline: #21262d;
  --color-input-text: #e6edf3;
  --color-input-background: #0d1117;
  --color-input-toggle-background: #0d1117;
  --color-input-border: #30363d;
  --color-input-border-hover: #6e7681;
  --color-header-wrapper: #010409;
  --color-header-wrapper-transparent: #0d111700;
  --color-light: #161b22cc;
  --color-light-mimic-enabled: rgba(255, 255, 255, calc(10 / 255 * 222 / 255 / var(--opacity-disabled)));
  --color-light-border: #30363d;
  --color-hover: #6e768133;
  --color-active: #6e768155;
  --color-menu: #161b22;
  --color-card: #161b22;
  --fancy-card-bg: #161b22;
  --fancy-card-border: #30363d;
  --color-markup-table-row: #161b2280;
  --color-markup-code-block: #161b22;
  --color-markup-code-inline: #6e768140;
  --color-button: #161b22;
  --color-code-bg: #161b22;
  --color-shadow: #010409aa;
  --color-secondary-bg: #161b22;
  --color-text-focus: #ffffff;
  --color-expand-button: #161b22;
  --color-placeholder-text: #6e7681;
  --color-editor-line-highlight: #161b22;
  --color-project-board-bg: #161b22;
  --color-project-board-dark-label: #6e7681;
  --color-caret: #e6edf3;
  --color-reaction-bg: #6e768122;
  --color-reaction-active-bg: #4493f833;
  --color-reaction-hover-bg: #4493f822;
  --color-tooltip-text: #ffffff;
  --color-tooltip-bg: #6e7681e6;
  --color-nav-bg: #010409;
  --color-nav-hover-bg: #161b22;
  --color-secondary-nav-bg: #0d1117;
  --color-label-text: #e6edf3;
  --color-label-bg: #6e768133;
  --color-label-hover-bg: #6e768155;
  --color-label-active-bg: #6e768177;
  --color-label-bg-alt: #6e768166;
  --color-accent: #4493f8;
  --color-small-accent: #388bfd26;
  --color-highlight-fg: #58a6ff;
  --color-highlight-bg: #bb800926;
  --color-overlay-backdrop: #010409cc;
  --color-selection-bg: #4493f8;
  --color-selection-fg: #ffffff;

  --checkerboard-color-1: #0d1117;
  --checkerboard-color-2: #161b22;
  --color-indicator-offline: #6e7681;
  --color-indicator-offline-20: #6e768133;
  --color-indicator-idle: #d29922;
  --color-indicator-idle-20: #d2992233;
  --color-indicator-active: #3fb950;
  --color-indicator-active-20: #3fb95033;

  accent-color: var(--color-accent);
  color-scheme: dark;
}

/* ---------- Component tweaks ---------- */

/* Top navbar — flat GitHub look */
.full.height > .ui.top.secondary.menu,
#navbar {
  background-color: #0d1117 !important;
  border-bottom: 1px solid #30363d !important;
  box-shadow: none !important;
  padding: 8px 16px !important;
}

#navbar .item {
  font-size: 14px;
  font-weight: 500;
  color: #e6edf3 !important;
}

#navbar .item:hover {
  color: #4493f8 !important;
  background: transparent !important;
}

/* Secondary (repo) nav bar — no extra border (tabs already have one) */
.secondary-nav,
.repository > .header,
.repo-header {
  background-color: #0d1117 !important;
  border-bottom: none !important;
}

/* Buttons — GitHub Primer style */
.ui.button,
.ui.basic.button,
.ui.basic.buttons .button {
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  padding: 5px 16px;
  line-height: 20px;
  transition: background-color .2s cubic-bezier(.3,0,.5,1),
              border-color .2s cubic-bezier(.3,0,.5,1),
              box-shadow .2s cubic-bezier(.3,0,.5,1);
}

/* Default (grey) button — GitHub "btn" look */
.ui.button:not(.primary):not(.blue):not(.green):not(.red):not(.negative):not(.basic):not(.labeled):not(.icon) {
  background-color: #161b22 !important;
  color: #e6edf3 !important;
  border: 1px solid #30363d !important;
  box-shadow: 0 1px 0 rgba(1,4,9,0.3) !important;
}
.ui.button:not(.primary):not(.blue):not(.green):not(.red):not(.negative):not(.basic):not(.labeled):not(.icon):hover {
  background-color: #30363d !important;
  border-color: #6e7681 !important;
}

.ui.primary.button,
.ui.primary.buttons .button,
.ui.blue.button,
.ui.blue.buttons .button {
  background-color: #1f6feb !important;
  color: #ffffff !important;
  border: 1px solid #f0f6fc1a !important;
}
.ui.primary.button:hover,
.ui.primary.buttons .button:hover,
.ui.blue.button:hover,
.ui.blue.buttons .button:hover {
  background-color: var(--color-primary-dark-1) !important;
}

.ui.basic.primary.button,
.ui.basic.primary.buttons .button,
.ui.basic.blue.button,
.ui.basic.blue.buttons .button {
  background-color: #161b22 !important;
  color: var(--color-primary) !important;
  box-shadow: inset 0 0 0 1px var(--color-border, #30363d) !important;
}
.ui.basic.primary.button:hover,
.ui.basic.primary.buttons .button:hover,
.ui.basic.blue.button:hover,
.ui.basic.blue.buttons .button:hover {
  background-color: #30363d !important;
  box-shadow: inset 0 0 0 1px #6e7681 !important;
}

.ui.green.button,
.ui.green.buttons .button {
  background-color: #238636 !important;
  color: #ffffff !important;
  border: 1px solid rgba(240,246,252,0.1) !important;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(1,4,9,0.3), inset 0 1px 0 rgba(255,255,255,0.03) !important;
}
.ui.green.button:hover,
.ui.green.buttons .button:hover {
  background-color: #2ea043 !important;
  border-color: rgba(240,246,252,0.1) !important;
}
.ui.green.button:active,
.ui.green.buttons .button:active {
  background-color: #2ea043 !important;
}

.ui.basic.green.button,
.ui.basic.green.buttons .button {
  background-color: #0d1117 !important;
  color: #3fb950 !important;
  box-shadow: inset 0 0 0 1px #30363d !important;
}

.ui.red.button,
.ui.red.buttons .button,
.ui.negative.button {
  background-color: #f85149 !important;
  color: #ffffff !important;
  border-radius: 6px;
}
.ui.basic.red.button,
.ui.basic.red.buttons .button {
  color: #f85149 !important;
  background-color: #0d1117 !important;
  box-shadow: inset 0 0 0 1px #30363d !important;
}

/* Labels / tags */
.ui.label {
  border-radius: 2em;
  padding: 0 7px;
  line-height: 18px;
  font-weight: 500;
}
.ui.basic.label {
  background-color: #0d1117;
  border: 1px solid #30363d;
  color: var(--color-text);
}
.ui.primary.label,
.ui.primary.labels .label,
.ui.blue.label,
.ui.blue.labels .label {
  background-color: #388bfd26 !important;
  color: #4493f8 !important;
  border: 1px solid #4493f833 !important;
}

/* sha labels — GitHub monospace chip */
.ui .sha.label {
  background-color: #6e768133;
  color: var(--color-text) !important;
  border-radius: 6px;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Repo file list */
.repository.file.list #repo-files-table tbody .svg.octicon-file-directory,
.repository.file.list #repo-files-table tbody .svg.octicon-file-directory-fill,
.repository.file.list #repo-files-table tbody .svg.octicon-file-submodule,
.svg-icon.directory[data-v-0fac5124] {
  color: #79c0ff !important;
}
.repository.file.list #repo-files-table tr:hover {
  background-color: #161b22 !important;
}
.repository.file.list #repo-files-table td.name a,
.repository.file.list #repo-files-table td.name a.muted {
  color: var(--color-text) !important;
  font-weight: 400;
}
.repository.file.list #repo-files-table td.message a,
.repository.file.list #repo-files-table td.message a.muted,
.repository.file.list #repo-files-table td.message a.default-link {
  color: var(--color-text-light-2) !important;
}
.repository.file.list #repo-files-table td.name a:hover,
.repository.file.list #repo-files-table td.message a:hover {
  color: var(--color-primary) !important;
  text-decoration: underline;
}

/* Links — exclude buttons so `<a class="ui ... button">` keeps its own text color */
a:not(.button):not(.ui.button):not(.item):not(.label),
.ui.breadcrumb a {
  color: var(--color-primary) !important;
}
a:not(.button):not(.ui.button):not(.item):not(.label):hover,
.ui.breadcrumb a:hover {
  text-decoration: underline;
}
a.muted {
  color: var(--color-text) !important;
}
a.muted:hover {
  color: var(--color-primary) !important;
}

/* Ensure button-like anchors keep white text on colored backgrounds */
a.ui.primary.button,
a.ui.blue.button,
a.ui.green.button,
a.ui.red.button,
a.ui.negative.button {
  color: #ffffff !important;
}
a.ui.primary.button:hover,
a.ui.blue.button:hover,
a.ui.green.button:hover,
a.ui.red.button:hover,
a.ui.negative.button:hover {
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Repo menu tabs — GitHub style with orange underline */
.ui.tabular.menu {
  border-bottom: 1px solid #30363d !important;
}
.ui.tabular.menu .item {
  color: #e6edf3 !important;
  padding: 8px 16px !important;
  font-size: 14px;
  border-radius: 6px 6px 0 0;
  margin-bottom: -1px;
}
.ui.tabular.menu .item:hover {
  background-color: #161b22 !important;
}
.ui.tabular.menu .active.item {
  border-bottom: 2px solid #f78166 !important;
  font-weight: 600;
  background: transparent !important;
}
.ui.tabular.menu .item .label,
.ui.tabular.menu .item .ui.label {
  background-color: #6e768133 !important;
  color: #e6edf3 !important;
  border: none !important;
  margin-left: 4px;
  font-weight: 500;
}

/* Commit/info segment */
.ui .info.segment.top {
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 6px 6px 0 0 !important;
}

/* Repository header / stats row */
.repository .header-wrapper {
  background-color: #0d1117 !important;
  border-bottom: 1px solid #30363d !important;
}

/* Clone URL field — monospace with subtle border */
.clone-panel input,
.repo-clone-url,
input.url-field {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace !important;
  font-size: 12px !important;
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
  color: #e6edf3 !important;
}

/* PR branch chips */
.issue.list .branches .branch,
.issue-meta-branch,
.flex-text-inline .branch {
  background-color: #6e768133;
  border-radius: 6px;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
}
.issue.list .branches .truncated-name {
  color: var(--color-text);
}

/* ---------- Issue / PR list (Forgejo 15 flex layout) — GitHub row look ---------- */
/* Outer bordered container */
.issue-list-container,
.page-content.repository.issue-list .flex-list {
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  background-color: #0d1117 !important;
  overflow: hidden;
}

/* Top toolbar (Open / Closed / search) — gray header strip */
.issue-list-toolbar {
  background-color: #161b22 !important;
  border-bottom: 1px solid #30363d !important;
  padding: 12px 16px !important;
  border-radius: 6px 6px 0 0 !important;
}
.issue-list-toolbar .ui.buttons .button,
.issue-list-toolbar .ui.compact.buttons .button {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #8b949e !important;
  font-weight: 600 !important;
  padding: 4px 8px !important;
}
.issue-list-toolbar .ui.buttons .button.active,
.issue-list-toolbar .ui.compact.buttons .button.active {
  color: #e6edf3 !important;
  background-color: transparent !important;
}

/* Each row */
.flex-list .flex-item,
.issue.list > .item {
  padding: 8px 16px !important;
  border-top: 1px solid #21262d !important;
  background-color: #0d1117 !important;
  transition: background-color .1s ease;
}
.flex-list .flex-item:hover,
.issue.list > .item:hover {
  background-color: #161b22 !important;
}
.flex-list .flex-item:first-child,
.issue.list > .item:first-child {
  border-top: none !important;
}

/* Left icon column */
.flex-item-icon {
  padding-top: 4px;
}
.flex-item-icon .svg {
  width: 16px;
  height: 16px;
}
/* Open PR = green, merged = purple, closed = red */
.flex-item-icon .octicon-git-pull-request,
.flex-item-icon .octicon-issue-opened {
  color: #3fb950 !important;
}
.flex-item-icon .octicon-git-merge {
  color: #a371f7 !important;
}
.flex-item-icon .octicon-git-pull-request-closed,
.flex-item-icon .octicon-issue-closed {
  color: #f85149 !important;
}

/* Title — large, bold, dark */
.flex-item-title .issue-title,
a.issue-title,
.issue.list .item .title a {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #e6edf3 !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
}
.flex-item-title .issue-title:hover,
a.issue-title:hover,
.issue.list .item .title a:hover {
  color: #4493f8 !important;
  text-decoration: none !important;
}

/* PR/issue number chip inside title — muted */
.flex-item-title .issue-index,
.issue-title .index {
  color: #8b949e !important;
  font-weight: 400 !important;
}

/* Meta / description row */
.flex-item-body.issue-meta,
.issue-meta,
.issue.list .item .desc {
  font-size: 12px !important;
  color: #8b949e !important;
  margin-top: 4px !important;
}
.flex-item-body.issue-meta a,
.issue-meta a,
.issue.list .item .desc a {
  color: #8b949e !important;
}
.flex-item-body.issue-meta a:hover,
.issue-meta a:hover,
.issue.list .item .desc a:hover {
  color: #4493f8 !important;
  text-decoration: underline;
}
.flex-item-body .text.grey {
  color: #8b949e !important;
}

/* Labels block — slight spacing */
.flex-item-title .labels-list {
  margin-left: 4px;
}

/* Trailing (milestone, assignees, comment count) */
.flex-item-trailing {
  color: #8b949e !important;
  font-size: 12px;
}
.flex-item-trailing a {
  color: #8b949e !important;
}
.flex-item-trailing a:hover {
  color: #4493f8 !important;
}

/* ---------- Repo header: Watch / Star / Fork as GitHub counter buttons ---------- */
.repo-buttons .ui.labeled.button {
  border-radius: 6px !important;
  overflow: hidden;
}
.repo-buttons .ui.labeled.button > .button,
.repo-buttons .ui.labeled.button > .ui.compact.small.basic.button {
  background-color: #161b22 !important;
  color: #e6edf3 !important;
  border: 1px solid #30363d !important;
  border-right: none !important;
  font-weight: 500 !important;
  font-size: 12px !important;
  padding: 3px 12px !important;
  box-shadow: none !important;
  border-radius: 6px 0 0 6px !important;
}
.repo-buttons .ui.labeled.button > .button:hover,
.repo-buttons .ui.labeled.button > .ui.compact.small.basic.button:hover {
  background-color: #30363d !important;
  border-color: #6e7681 !important;
}
.repo-buttons .ui.labeled.button > .ui.basic.label {
  background-color: #0d1117 !important;
  color: #e6edf3 !important;
  border: 1px solid #30363d !important;
  font-weight: 500 !important;
  font-size: 12px !important;
  padding: 3px 10px !important;
  border-radius: 0 6px 6px 0 !important;
}

/* ---------- PR / Issue detail — header ---------- */
.issue-title-header {
  padding-bottom: 8px;
  border-bottom: 1px solid #30363d;
  margin-bottom: 16px;
}
.issue-title-header .issue-title h1,
.issue-title #issue-title-display h1 {
  font-size: 32px !important;
  font-weight: 400 !important;
  color: #e6edf3 !important;
  line-height: 1.25 !important;
  margin: 0 !important;
}
.issue-title-header .issue-title .index,
#issue-title-display .index {
  color: #8b949e !important;
  font-weight: 300 !important;
  margin-left: 8px;
}

/* Status pill — Open/Merged/Closed/Draft */
.issue-state-label.ui.label {
  font-size: 14px !important;
  font-weight: 500 !important;
  padding: 5px 12px !important;
  border-radius: 2em !important;
  border: 1px solid transparent !important;
  line-height: 20px;
}
.issue-state-label.ui.green.label {
  background-color: #238636 !important;
  color: #ffffff !important;
}
.issue-state-label.ui.purple.label {
  background-color: #a371f7 !important;
  color: #ffffff !important;
}
.issue-state-label.ui.red.label {
  background-color: #f85149 !important;
  color: #ffffff !important;
}
.issue-state-label.ui.grey.label {
  background-color: #6e7681 !important;
  color: #ffffff !important;
}

.issue-title-meta,
.time-desc,
.pull-desc {
  color: #8b949e !important;
  font-size: 14px;
}
.issue-title-meta a,
.time-desc a,
.pull-desc a {
  color: #e6edf3 !important;
  font-weight: 500;
}

/* ---------- PR / Issue comments (timeline) ---------- */
.conversation-holder,
.timeline-item.comment {
  position: relative;
}

/* Timeline vertical line (Forgejo uses ::before on .timeline) */
.timeline {
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30px;
  width: 2px;
  background-color: #30363d;
  z-index: 0;
}

/* Comment card */
.timeline-item .comment.box,
.conversation-holder.ui.segments,
.ui.segments.conversation-holder {
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  background-color: #0d1117 !important;
  box-shadow: none !important;
  overflow: hidden;
}

/* Comment header strip */
.timeline-item .comment .header,
.conversation-holder .comment > .header,
.ui.segment.comment-header,
.comment > .header {
  background-color: #161b22 !important;
  border-bottom: 1px solid #30363d !important;
  padding: 8px 16px !important;
  color: #e6edf3 !important;
  font-weight: 400 !important;
}
.comment > .header a.author,
.comment-header .author {
  color: #e6edf3 !important;
  font-weight: 600 !important;
}

/* Comment body */
.comment .text.comment-content,
.comment .render-content {
  padding: 16px !important;
  color: #e6edf3;
}

/* Author role badge (Owner/Member/Contributor) — GitHub pill */
.comment .role-labels .ui.label,
.timeline-item .role-labels .ui.label {
  background-color: transparent !important;
  border: 1px solid #6e7681 !important;
  color: #8b949e !important;
  border-radius: 2em !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 0 7px !important;
  line-height: 18px !important;
}

/* Merge box — large call-to-action panel */
.merge-section,
#pull-request-merge-form,
.pull-merge-box {
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  background-color: #0d1117 !important;
  padding: 16px !important;
}
.merge-section .merge-button,
#pull-request-merge-form .ui.green.button {
  background-color: #238636 !important;
  color: #ffffff !important;
  font-weight: 500;
}

/* ---------- Diff view ---------- */
.diff-file-box {
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  overflow: hidden;
  margin-bottom: 16px;
  background-color: #0d1117 !important;
}
.diff-file-header {
  background-color: #161b22 !important;
  border-bottom: 1px solid #30363d !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  color: #e6edf3 !important;
}
.diff-file-header .file {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: #e6edf3;
}

/* Hunk header — @@ -N,M +N,M @@ */
.blob-hunk,
td.blob-hunk,
tr.section .blob-hunk {
  background-color: #388bfd26 !important;
  color: #8b949e !important;
  font-size: 12px !important;
  padding: 4px 10px !important;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Added / removed line rows */
tr.add-code td.lines-code,
td.lines-code.add-code,
tr.add-code .lines-code {
  background-color: #2ea04326 !important;
}
tr.del-code td.lines-code,
td.lines-code.del-code,
tr.del-code .lines-code {
  background-color: #f851491a !important;
}
tr.add-code td.lines-num,
tr.add-code .lines-num {
  background-color: #3fb9504d !important;
  color: #3fb950 !important;
}
tr.del-code td.lines-num,
tr.del-code .lines-num {
  background-color: #f851494d !important;
  color: #ffa198 !important;
}
td.lines-num,
.lines-num {
  color: #6e7681 !important;
  background-color: #0d1117 !important;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Inline added/removed word highlight */
td.lines-code.add-code .added-code,
.added-code {
  background-color: #2ea04366 !important;
}
td.lines-code.del-code .removed-code,
.removed-code {
  background-color: #f8514966 !important;
}

/* ---------- Form inputs — Primer focus rings ---------- */
.ui.input > input,
.ui.form input[type="text"],
.ui.form input[type="password"],
.ui.form input[type="email"],
.ui.form input[type="search"],
.ui.form input[type="number"],
.ui.form input[type="url"],
.ui.form textarea,
.ui.selection.dropdown {
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  padding: 5px 12px !important;
  font-size: 14px !important;
  color: #e6edf3 !important;
  background-color: #0d1117 !important;
  box-shadow: none !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ui.input > input:focus,
.ui.form input[type="text"]:focus,
.ui.form input[type="password"]:focus,
.ui.form input[type="email"]:focus,
.ui.form input[type="search"]:focus,
.ui.form input[type="number"]:focus,
.ui.form input[type="url"]:focus,
.ui.form textarea:focus,
.ui.selection.dropdown:focus,
.ui.selection.dropdown.active {
  border-color: #4493f8 !important;
  box-shadow: 0 0 0 3px #4493f833 !important;
  outline: none !important;
}

/* ---------- Dropdown menus — tight GitHub look ---------- */
.ui.dropdown .menu,
.ui.selection.dropdown .menu {
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  box-shadow: 0 8px 24px rgba(1,4,9,0.85) !important;
  padding: 4px 0 !important;
  margin-top: 4px !important;
}
.ui.dropdown .menu > .item,
.ui.selection.dropdown .menu > .item {
  padding: 6px 12px !important;
  font-size: 14px !important;
  color: #e6edf3 !important;
  border-bottom: none !important;
}
.ui.dropdown .menu > .item:hover,
.ui.selection.dropdown .menu > .item:hover {
  background-color: #1f6feb !important;
  color: #ffffff !important;
}
.ui.dropdown .menu > .divider {
  border-top: 1px solid #30363d !important;
  margin: 4px 0 !important;
}
.ui.dropdown .menu > .header {
  background-color: #161b22 !important;
  color: #e6edf3 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 8px 12px !important;
}

/* Code blocks — GitHub font stack */
code,
pre,
.monospace {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #6e7681 transparent;
}
::-webkit-scrollbar-thumb {
  background-color: #6e7681;
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #6e7681;
}

/* ---------- Syntax highlighting (chroma) — GitHub Light palette ---------- */
/* File viewer only — fenced code in markdown should inherit pre bg */
.file-view.code-view .chroma,
.code-view .chroma {
  background-color: #0d1117 !important;
  color: #e6edf3 !important;
}
.markup .chroma,
.markdown .chroma,
.markup pre .chroma,
.markdown pre .chroma {
  background-color: transparent !important;
  color: #e6edf3 !important;
}
/* Fenced code blocks in README — flat GitHub gray */
.markup pre,
.markdown pre,
.markup .code-block,
.markdown .code-block {
  background-color: var(--color-markup-code-block) !important;
  border-radius: 6px !important;
  padding: 16px !important;
}

/* Line numbers */
.chroma .ln,
.chroma .lnt,
.file-view .lines-num,
.file-view .lines-num span {
  color: #6e7681 !important;
}

/* Comments */
.chroma .c,  .chroma .ch, .chroma .cm, .chroma .c1,
.chroma .cs, .chroma .cp, .chroma .cpf {
  color: #6e7681 !important;
  font-style: normal !important;
}

/* Keywords */
.chroma .k,  .chroma .kc, .chroma .kd, .chroma .kn,
.chroma .kp, .chroma .kr, .chroma .kt {
  color: #f85149 !important;
}

/* Strings */
.chroma .s,  .chroma .sa, .chroma .sb, .chroma .sc,
.chroma .dl, .chroma .sd, .chroma .s2, .chroma .se,
.chroma .sh, .chroma .si, .chroma .sx, .chroma .sr,
.chroma .s1, .chroma .ss {
  color: #a5d6ff !important;
}

/* Numbers */
.chroma .m,  .chroma .mb, .chroma .mf, .chroma .mh,
.chroma .mi, .chroma .il, .chroma .mo {
  color: #79c0ff !important;
}

/* Functions / names */
.chroma .nf { color: #a371f7 !important; }
.chroma .nx { color: #e6edf3 !important; }
.chroma .nc, .chroma .nn { color: #ffa657 !important; }
.chroma .nb, .chroma .bp { color: #79c0ff !important; }
.chroma .nv, .chroma .vc, .chroma .vg, .chroma .vi {
  color: #ffa657 !important;
}

/* Operators / punctuation */
.chroma .o, .chroma .ow { color: #f85149 !important; }
.chroma .p { color: #e6edf3 !important; }

/* HTML / XML tags & attributes */
.chroma .nt { color: #7ee787 !important; }
.chroma .na { color: #79c0ff !important; }

/* Generic (diff, errors, headings inside code) */
.chroma .gd { color: #ffa198; background-color: #f851491a !important; }
.chroma .gi { color: #7ee787; background-color: #2ea04326 !important; }
.chroma .gh { color: #79c0ff !important; font-weight: 600; }
.chroma .gu { color: #79c0ff !important; }
.chroma .err { color: #ffa198 !important; background-color: #f851491a !important; }

/* Highlighted line */
.chroma .hl,
.file-view .lines-code .active,
.file-view .active {
  background-color: #bb800926 !important;
}

/* Signed commit accents */
.repository #commits-table td.sha .sha.label.isSigned.isVerified .detail.icon,
.repository #repo-files-table .sha.label.isSigned.isVerified .detail.icon,
.repository #rev-list .sha.label.isSigned.isVerified .detail.icon {
  border-left: 1px solid #3fb950;
  color: #3fb950;
}
.repository .ui.attached.isSigned.isVerified.message {
  background-color: #2ea04326;
  color: var(--color-text);
  box-shadow: none;
}

.page-content.user.signin > .ui.container {
  max-width: 672px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
