:root {
  --gf-bg: #08090b;
  --gf-surface: #0d1014;
  --gf-elevated: #12161c;
  --gf-ember: #ff6a1a;
  --gf-amber: #ff9d3d;
  --gf-hot: #ff3d2e;
  --gf-text: #f2f4f7;
  --gf-muted: #9ca6b4;
  --gf-border: rgba(255, 255, 255, 0.07);
  --gf-radius-sm: 5px;
  --gf-radius: 8px;
  --gf-radius-lg: 12px;
  --gf-shadow: 0 16px 46px rgba(0, 0, 0, 0.28);
  --gf-fast: 120ms cubic-bezier(0.2, 0, 0, 1);
}

html {
  background: var(--gf-bg);
  scrollbar-color: #343b46 #090b0e;
}

body {
  background:
    radial-gradient(circle at 50% -18rem, rgba(255, 106, 26, 0.045), transparent 38rem),
    var(--gf-bg);
  color: var(--gf-text);
  letter-spacing: -0.006em;
}

::selection {
  background: rgba(255, 106, 26, 0.3);
  color: #fff;
}

a,
.ui.breadcrumb a,
.markup a {
  text-underline-offset: 0.17em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gf-amber) !important;
  outline-offset: 2px;
}

.full.height {
  min-height: calc(100vh - 42px);
}

.page-content {
  padding-top: 18px;
}

.ui.container {
  width: min(94%, 1500px);
}

/* Compact product navigation */
#navbar {
  min-height: 48px;
  background: rgba(9, 11, 14, 0.94);
  border-bottom: 1px solid var(--gf-border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

#navbar .navbar-left,
#navbar .navbar-right {
  min-height: 48px;
}

#navbar .item {
  min-height: 48px;
  padding: 0 12px;
  color: #b8c0ca;
  font-size: 13px;
  font-weight: 560;
  transition: color var(--gf-fast), background-color var(--gf-fast);
}

#navbar .item:hover,
#navbar .item.active {
  color: #f4f6f8;
  background: rgba(255, 255, 255, 0.035);
}

#navbar .item.active {
  box-shadow: inset 0 -2px var(--gf-ember);
}

#navbar a[href^="https://docs.gitea.com"] {
  display: none !important;
}

#navbar-logo {
  gap: 9px;
  padding-left: 14px !important;
  padding-right: 16px !important;
}

#navbar-logo img {
  width: 29px;
  height: 29px;
}

#navbar-logo::after {
  content: "GitFire";
  color: var(--gf-text);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.35px;
}

.navbar-avatar img {
  border: 1px solid rgba(255, 106, 26, 0.28);
}

/* Controls */
.ui.button,
.ui.buttons .button {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: var(--gf-radius-sm);
  border: 1px solid var(--gf-border);
  background: #171b21;
  color: #dce1e7;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  font-weight: 600;
  transition: transform 80ms ease, border-color var(--gf-fast), background-color var(--gf-fast), color var(--gf-fast);
}

.ui.button:hover,
.ui.buttons .button:hover {
  background: #20252d;
  border-color: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.ui.button:active,
.ui.buttons .button:active {
  transform: translateY(1px);
  background: #12161b;
}

.ui.primary.button,
.ui.primary.buttons .button,
.ui.green.button {
  background: var(--gf-ember) !important;
  border-color: #ff7d32 !important;
  color: #090a0c !important;
  box-shadow: 0 0 0 1px rgba(255, 165, 94, 0.12), 0 5px 18px rgba(255, 86, 20, 0.13);
}

.ui.primary.button:hover,
.ui.primary.buttons .button:hover,
.ui.green.button:hover {
  background: #ff7b2b !important;
}

.ui.red.button,
.ui.negative.button {
  background: #3a1d21 !important;
  border-color: #73343b !important;
  color: #ff9a96 !important;
}

.ui.basic.button {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.ui.form input:not([type="checkbox"]):not([type="radio"]),
.ui.form textarea,
.ui.input > input,
.ui.selection.dropdown {
  border-radius: var(--gf-radius-sm) !important;
  border: 1px solid #303741 !important;
  background: #0a0d11 !important;
  color: #edf0f4 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018) !important;
  transition: border-color var(--gf-fast), box-shadow var(--gf-fast), background var(--gf-fast);
}

.ui.form input:focus,
.ui.form textarea:focus,
.ui.input > input:focus,
.ui.selection.dropdown:focus {
  border-color: #b95b25 !important;
  background: #0d1014 !important;
  box-shadow: 0 0 0 3px rgba(255, 106, 26, 0.12) !important;
}

.ui.dropdown .menu,
.ui.menu .dropdown.item .menu {
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: var(--gf-radius) !important;
  background: #101319 !important;
  box-shadow: var(--gf-shadow) !important;
  padding: 5px !important;
}

.ui.dropdown .menu > .item {
  min-height: 32px !important;
  border-radius: 5px !important;
  color: #cbd2db !important;
}

.ui.dropdown .menu > .item:hover,
.ui.dropdown .menu > .selected.item {
  background: #1a1f26 !important;
  color: #fff !important;
}

/* Surfaces and density */
.ui.segment,
.ui.segments,
.ui.card,
.ui.cards > .card,
.ui.attached.segment,
.ui.menu,
.repository .ui.segment {
  border-color: var(--gf-border);
  border-radius: var(--gf-radius);
  box-shadow: none;
}

.ui.segment,
.ui.card,
.ui.cards > .card,
.ui.attached.segment {
  background: var(--gf-surface);
}

.ui.top.attached.header,
.ui.attached.header,
.ui.block.header {
  border-color: var(--gf-border);
  background: #101319;
  color: #e9edf1;
  font-weight: 650;
}

.ui.table,
.ui.table tr,
.ui.table td,
.ui.table th {
  border-color: rgba(255, 255, 255, 0.055) !important;
}

.ui.table {
  background: transparent;
  color: #d5dbe2;
}

.ui.table thead th {
  padding: 9px 11px;
  background: #101319;
  color: #aab3bf;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.ui.table tbody td {
  padding: 8px 11px;
}

.ui.table.selectable tbody tr:hover,
.ui.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025) !important;
}

.ui.label {
  border-radius: 999px;
  font-weight: 600;
}

.ui.message {
  border-radius: var(--gf-radius);
  border-width: 1px;
  box-shadow: none;
}

[role="tooltip"],
.tippy-box {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.ui.modal {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--gf-radius-lg);
  background: #0d1014;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

/* Sign-in: compact, recognizable and lightweight */
.page-content.gitfire-signin {
  position: relative;
  display: grid;
  min-height: calc(100vh - 96px);
  place-items: center;
  overflow: hidden;
  padding: 32px 16px 54px;
}

.page-content.gitfire-signin::before,
.page-content.gitfire-signin::after {
  position: absolute;
  z-index: 0;
  content: "";
  pointer-events: none;
}

.page-content.gitfire-signin::before {
  inset: 0;
  opacity: 0.31;
  background-image:
    radial-gradient(circle at 18% 28%, #ff9d3d 0 2px, transparent 2.5px),
    radial-gradient(circle at 38% 56%, #ff6a1a 0 2px, transparent 2.5px),
    radial-gradient(circle at 72% 34%, #ff6a1a 0 2px, transparent 2.5px),
    radial-gradient(circle at 83% 68%, #ff3d2e 0 2px, transparent 2.5px),
    linear-gradient(28deg, transparent 49.84%, rgba(255, 106, 26, 0.12) 49.9% 50.1%, transparent 50.16%),
    linear-gradient(152deg, transparent 49.87%, rgba(255, 255, 255, 0.045) 49.94% 50.06%, transparent 50.13%);
  mask-image: radial-gradient(ellipse at center, #000 0, transparent 72%);
}

.page-content.gitfire-signin::after {
  width: 580px;
  height: 580px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 83, 22, 0.09), transparent 68%);
}

.gitfire-signin > .grid {
  position: relative;
  z-index: 1;
  width: 100%;
}

.gitfire-signin .column {
  width: 420px !important;
  max-width: calc(100vw - 32px) !important;
  flex: 0 1 420px !important;
}

.gitfire-auth-brand {
  margin: 0 auto 8px;
  text-align: center;
}

.gitfire-auth-brand img {
  width: 180px;
  height: auto;
}

.gitfire-auth-brand p {
  margin: 8px 0 0;
  color: #8f9aa8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

.gitfire-signin .ui.top.attached.header {
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: rgba(17, 21, 27, 0.94);
  padding: 14px 18px 4px;
  color: #aab3bf;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gitfire-signin .ui.attached.segment {
  border-radius: 0 0 12px 12px;
  background: rgba(13, 16, 20, 0.96);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.34), inset 0 1px rgba(255, 255, 255, 0.025);
  padding: 18px;
}

.gitfire-signin .ui.form .field > label {
  color: #aeb7c2;
  font-size: 12px;
}

/* Dashboard */
.dashboard .dashboard-navbar,
.dashboard .feeds .news,
.dashboard .ui.list .item,
.dashboard .repos-search,
.dashboard .ui.segment {
  border-color: var(--gf-border) !important;
}

.dashboard .feeds .news {
  padding: 10px 12px;
}

.dashboard .repo-list .item {
  padding: 9px 10px;
  border-radius: 6px;
}

.dashboard .repo-list .item:hover {
  background: rgba(255, 255, 255, 0.025);
}

/* Repository identity and navigation */
.repository .repo-header {
  margin-top: -18px;
  padding-top: 15px;
  background: linear-gradient(180deg, rgba(255, 106, 26, 0.035), transparent 75%);
}

.repository .repo-header .repo-title {
  letter-spacing: -0.025em;
}

.repository .repo-header .repo-title a:last-of-type {
  color: #f5f6f8;
  font-weight: 720;
}

.repository .repo-header .ui.tabular.menu {
  min-height: 40px;
  border-bottom: 1px solid var(--gf-border);
  gap: 2px;
}

.repository .repo-header .ui.tabular.menu .item {
  min-height: 39px;
  padding: 9px 12px;
  border: 0 !important;
  border-radius: 5px 5px 0 0 !important;
  color: #9ea8b5;
  font-size: 12px;
  font-weight: 600;
}

.repository .repo-header .ui.tabular.menu .item:hover {
  background: rgba(255, 255, 255, 0.025);
  color: #e8ebef;
}

.repository .repo-header .ui.tabular.menu .item.active {
  background: transparent !important;
  color: #fff !important;
  box-shadow: inset 0 -2px var(--gf-ember);
}

.repository .repo-header .ui.tabular.menu .item .ui.label {
  background: rgba(255, 255, 255, 0.07);
  color: #aeb7c2;
}

.repository .branch-dropdown .text,
.repository .choose.reference .text {
  font-family: var(--fonts-monospace);
  font-size: 12px;
}

/* File browser */
.repository.file.list #repo-files-table,
.repository.file.list .repo-file-list,
#repo-files-table {
  border: 1px solid var(--gf-border) !important;
  border-radius: var(--gf-radius);
  overflow: hidden;
  background: #0b0e12;
}

#repo-files-table thead th,
.repo-file-list thead th {
  background: #11151a !important;
  padding-top: 9px !important;
  padding-bottom: 9px !important;
}

#repo-files-table tbody tr,
.repo-file-list tbody tr {
  height: 39px;
  transition: background-color var(--gf-fast);
}

#repo-files-table tbody tr:hover,
.repo-file-list tbody tr:hover {
  background: #12161c !important;
}

#repo-files-table .name a,
.repo-file-list .name a {
  color: #dfe4e9;
  font-weight: 560;
}

#repo-files-table .name .svg,
.repo-file-list .name .svg {
  color: #d9984b;
}

#repo-files-table .commit,
#repo-files-table .age,
.repo-file-list .commit,
.repo-file-list .age {
  color: #7f8996;
  font-size: 12px;
}

.repository .latest-commit {
  border: 1px solid var(--gf-border);
  border-radius: var(--gf-radius);
  background: #101319;
}

/* Code and diffs */
.repository.file .file-view,
.repository.file .file-header,
.repository .diff-file-box {
  border-color: var(--gf-border) !important;
}

.repository.file .file-header,
.repository .diff-file-header {
  min-height: 42px;
  background: #101319 !important;
}

.repository.file .code-view,
.repository .diff-file-body {
  background: #090b0e;
}

.code-view table,
.code-view code,
.diff-file-body,
.diff-file-body code,
.blame-code {
  font-family: var(--fonts-monospace) !important;
  font-size: 12.5px !important;
  line-height: 1.58 !important;
  font-variant-ligatures: contextual;
}

.code-view .lines-num,
.code-view .lines-escape,
.diff-line-num {
  color: #4f5966 !important;
  background: #080a0c !important;
  border-color: #1d2229 !important;
  user-select: none;
}

.code-view tr:hover td {
  background-color: rgba(255, 255, 255, 0.018);
}

.diff-file-box {
  border-radius: var(--gf-radius) !important;
  overflow: clip;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
}

.diff-code-add {
  box-shadow: inset 2px 0 #489a65;
}

.diff-code-del {
  box-shadow: inset 2px 0 #c6535a;
}

.commit-summary,
.commit-header {
  border-color: var(--gf-border) !important;
  background: #0f1217 !important;
}

.commit-list .sha,
.commit-summary .sha,
.commit-header .sha {
  color: #ff9d5c;
  font-family: var(--fonts-monospace);
}

/* Commit graph becomes a brand motif without animation */
.repository.network .flow-color-0 { stroke: #ff6a1a !important; fill: #ff6a1a !important; }
.repository.network .flow-color-1 { stroke: #ff9d3d !important; fill: #ff9d3d !important; }
.repository.network .flow-color-2 { stroke: #ff3d2e !important; fill: #ff3d2e !important; }
.repository.network .flow-color-3 { stroke: #69b985 !important; fill: #69b985 !important; }
.repository.network .flow-color-4 { stroke: #63a6dc !important; fill: #63a6dc !important; }

/* Issues, pull requests and activity */
.issue.list > .item,
.pull.list > .item,
.commit-list .item,
.activity-list .item {
  padding-top: 9px !important;
  padding-bottom: 9px !important;
  border-color: rgba(255, 255, 255, 0.055) !important;
}

.issue.list > .item:hover,
.pull.list > .item:hover,
.commit-list .item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.timeline-item .timeline-avatar {
  box-shadow: 0 0 0 3px var(--gf-bg);
}

/* Admin remains dense and operational */
.admin .admin-setting-content,
.admin .ui.segment {
  background: #0b0e12;
}

.admin .ui.vertical.menu .item {
  min-height: 36px;
  padding: 9px 11px;
}

.admin .ui.vertical.menu .item.active {
  background: rgba(255, 106, 26, 0.11);
  color: #ff9d5c;
  box-shadow: inset 2px 0 var(--gf-ember);
}

/* Empty and status states */
.empty-placeholder,
.ui.placeholder.segment {
  min-height: 150px;
  border: 1px dashed rgba(255, 255, 255, 0.11) !important;
  background: radial-gradient(circle at center, rgba(255, 106, 26, 0.035), transparent 60%) !important;
}

.status-page-error {
  color: #9ca6b4;
}

.gitfire-status-page {
  display: flex;
  min-height: 54vh;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.gitfire-status-page .status-page-error-title {
  margin-top: 10px;
  color: #f2f4f7;
  font-size: clamp(46px, 7vw, 78px);
  font-weight: 760;
  letter-spacing: -0.06em;
}

.gitfire-status-kicker {
  color: #ff7a29;
  font-family: var(--fonts-monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.045) !important;
  color: #697381 !important;
  font-size: 11px;
}

@media (min-width: 1900px) {
  .ui.container {
    width: min(86vw, 1760px);
  }

  .repository.file .code-view {
    max-width: none;
  }
}

@media (min-width: 3000px) {
  .ui.container {
    width: min(78vw, 2200px);
  }
}

@media (max-width: 900px) {
  .ui.container {
    width: calc(100% - 22px);
  }

  #navbar-logo::after {
    display: none;
  }

  .repository .repo-header .ui.tabular.menu {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .repository .repo-header .ui.tabular.menu .item {
    white-space: nowrap;
  }

  #repo-files-table .commit,
  .repo-file-list .commit {
    max-width: 190px;
  }
}

@media (max-width: 600px) {
  .page-content {
    padding-top: 12px;
  }

  .page-content.gitfire-signin {
    min-height: calc(100vh - 60px);
    padding: 24px 10px 40px;
  }

  .gitfire-auth-brand img {
    width: 158px;
  }

  .repository .repo-header {
    margin-top: -12px;
  }

  .code-view table,
  .code-view code,
  .diff-file-body,
  .diff-file-body code {
    font-size: 11.5px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
