:root {
  --canvas: #eceef5;
  --bg: #ffffff;
  --bg-subtle: #f5f6fa;
  --bg-inset: #eceef5;
  --fg: #1b1d2b;
  --fg-muted: #6c7089;
  --border: #e2e5ef;
  --border-muted: #eef0f6;
  --accent: #3b5bdb;
  --accent-fg: #ffffff;
  --accent-subtle: #e9edff;
  --danger: #cf222e;
  --add-bg: #e6ffec;
  --add-ln: #ccffd8;
  --add-fg: #1a7f37;
  --del-bg: #ffebe9;
  --del-ln: #ffd7d5;
  --del-fg: #cf222e;
  --hunk-bg: #eef1ff;
  --hl-bg: #fff8c5;
  --radius: 16px;
  --card: 0 1px 2px rgba(27, 32, 70, .04), 0 6px 20px rgba(27, 32, 70, .06);
  --pop: 0 16px 40px rgba(27, 32, 70, .18);
  /* section colours: nav icons */
  --c-code: #3b5bdb; --c-commits: #7a52d6; --c-branch: #0e8f7e; --c-tags: #c77a09;
  --c-pr: #1a8a4b; --c-pkg: #b8458b; --c-act: #d9580b; --c-dep: #2f7de1; --c-admin: #6c7089;
  --folder: #f0a92e;
  --mono: "Fragment Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --display: "Bricolage Grotesque", "Onest", -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #10121c;
    --bg: #181b28;
    --bg-subtle: #1e2231;
    --bg-inset: #252a3c;
    --fg: #e9eaf2;
    --fg-muted: #9296ad;
    --border: #2a2f43;
    --border-muted: #22263a;
    --accent: #8ca1ff;
    --accent-fg: #10121c;
    --accent-subtle: #232b4d;
    --danger: #f85149;
    --add-bg: #12261b;
    --add-ln: #1a3a26;
    --add-fg: #3fb950;
    --del-bg: #2c1618;
    --del-ln: #45191c;
    --del-fg: #f85149;
    --hunk-bg: #1c2240;
    --hl-bg: #3a3212;
    --card: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --pop: 0 16px 40px rgba(0, 0, 0, .5);
    --c-code: #8ca1ff; --c-commits: #b394ff; --c-branch: #4fd1bd; --c-tags: #f2b24a;
    --c-pr: #5ad08c; --c-pkg: #f08cc8; --c-act: #ff9a5a; --c-dep: #6fb0ff; --c-admin: #9296ad;
    --folder: #f2b24a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--fg); font: 14.5px/1.55 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono, .sha { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3 { line-height: 1.25; }
h2 { font: 700 19px var(--display); letter-spacing: -.01em; margin: 0 0 12px; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--fg-muted); }
.small { font-size: 12px; }
.muted-link { color: var(--fg); }
.muted-link:hover { color: var(--accent); }
.text-add { color: var(--add-fg); }
.text-del { color: var(--del-fg); }
.icon { vertical-align: text-bottom; flex-shrink: 0; }

/* ---- top bar and the navigation dock ---- */
.topbar-inner { display: flex; align-items: center; height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font: 700 18px var(--display); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; opacity: .85; }
.brand .logo { color: var(--accent); width: 26px; height: 26px; }
.topbar .btn { background: var(--bg); }
.user-menu > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; background: var(--bg); padding: 4px 12px 4px 4px;
  border-radius: 999px; box-shadow: var(--card); font-weight: 500; }
.user-menu > summary .avatar { width: 28px; height: 28px; font-size: 13px; }
.tabs { margin-bottom: 24px; }
.tabs .container { display: flex; gap: 4px; overflow-x: auto; background: var(--bg); border-radius: 999px; padding: 6px; box-shadow: var(--card);
  max-width: max-content; margin: 0 auto; scrollbar-width: none; }
.tabs a { display: flex; flex-shrink: 0; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; color: var(--fg-muted);
  font-weight: 500; white-space: nowrap; }
.tabs a:hover { text-decoration: none; background: var(--bg-subtle); color: var(--fg); }
.tabs a.active { background: var(--fg); color: var(--bg); font-weight: 600; }
.tabs .icon { color: var(--tc, var(--fg-muted)); }
.tabs a.active .icon { color: var(--bg); }
.tabs a:nth-child(1) { --tc: var(--c-code); } .tabs a:nth-child(2) { --tc: var(--c-commits); }
.tabs a:nth-child(3) { --tc: var(--c-branch); } .tabs a:nth-child(4) { --tc: var(--c-tags); }
.tabs a:nth-child(5) { --tc: var(--c-pr); } .tabs a:nth-child(6) { --tc: var(--c-pkg); }
.tabs a:nth-child(7) { --tc: var(--c-act); } .tabs a:nth-child(8) { --tc: var(--c-dep); }
.tabs a.tab-right { --tc: var(--c-admin); margin-left: 4px; }
.tabs .counter { background: var(--c-pr); color: #fff; }
.tabs a.active .counter { background: var(--bg); color: var(--fg); }
main { min-height: calc(100vh - 190px); }
.footer { color: var(--fg-muted); font-size: 12px; padding-top: 32px; padding-bottom: 32px; text-align: center; }

/* ---- avatars ---- */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  background: hsl(var(--hue, 220) 55% 55%); color: #fff; font-size: 11px; font-weight: 600; flex-shrink: 0; vertical-align: middle; }
.avatar-lg { width: 32px; height: 32px; font-size: 14px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; font: 500 14px/20px var(--sans); color: var(--fg);
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg-subtle); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-sm { padding: 4px 12px; font-size: 12.5px; }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; box-shadow: 0 4px 12px rgba(59, 91, 219, .3); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-block { width: 100%; justify-content: center; }
.btn.ok { color: var(--add-fg); border-color: var(--add-fg); }
.btn-group { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--bg-inset); border-radius: 999px; padding: 3px; }
.btn-group .btn { border: 0; background: transparent; }
.btn-group .btn:hover { background: var(--bg-subtle); }
.btn-group .btn.active { background: var(--bg); font-weight: 600; box-shadow: var(--card); }
.badge { display: inline-block; padding: 0 9px; border-radius: 999px; font-size: 12px; line-height: 21px; background: var(--bg-inset); color: var(--fg); font-weight: 500; }
.badge-admin { color: var(--accent); border-color: var(--accent); }
.badge-off { color: var(--danger); border-color: var(--danger); }

/* ---- dropdowns ---- */
details.dropdown { position: relative; }
details.dropdown > summary { list-style: none; }
details.dropdown > summary::-webkit-details-marker { display: none; }
.caret { display: inline-block; width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; }
.menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 220px; max-height: 420px; overflow: auto;
  background: var(--bg); border: 1px solid var(--border-muted); border-radius: 14px; box-shadow: var(--pop); padding: 6px; color: var(--fg); }
.menu-right { left: auto; right: 0; }
.menu a, .menu .menu-item { display: block; width: 100%; padding: 6px 10px; border-radius: 8px; color: var(--fg); text-align: left; background: none; border: 0; font: inherit; cursor: pointer; }
.menu a:hover, .menu .menu-item:hover { background: var(--bg-subtle); text-decoration: none; }
.menu a.selected { font-weight: 600; background: var(--accent-subtle); }
.menu-header { padding: 6px 14px 8px; border-bottom: 1px solid var(--border-muted); margin-bottom: 4px; color: var(--fg-muted); }
.menu-section { padding: 8px 14px 4px; font-size: 12px; font-weight: 600; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .03em; }
.menu-filter { width: calc(100% - 16px); margin: 4px 8px; }
.refmenu { min-width: 280px; }
.ref-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.clone-menu { width: 400px; padding: 12px; }
.clone-menu label { display: block; font-size: 12px; font-weight: 600; margin: 4px 0; }

/* ---- forms ---- */
input, textarea, select { font: inherit; color: var(--fg); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 10px; padding: 6px 11px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { resize: vertical; width: 100%; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.form label input, .form label select { font-weight: normal; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: normal; }
.form.narrow { max-width: 360px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: end; }
.copy-field { display: flex; gap: 6px; margin-bottom: 8px; }
.copy-field input { flex: 1; font-family: var(--mono); font-size: 12.5px; background: var(--bg-subtle); }

/* ---- boxes ---- */
.box { border-radius: var(--radius); background: var(--bg); box-shadow: var(--card); margin-bottom: 16px; overflow: hidden; }
.box.pad { padding: 18px 22px; }
.box-header { display: flex; align-items: center; gap: 8px; padding: 14px 20px; background: var(--bg); border-bottom: 1px solid var(--border-muted); }
.box-header + .box-header { background: var(--bg-subtle); }
.flash { padding: 12px 18px; margin-bottom: 16px; border: 0; background: var(--accent-subtle); border-radius: 14px; }
.flash p { margin: 0 0 8px; }
.flash-error { background: var(--del-bg); color: var(--del-fg); }
.flash-success { border-color: var(--add-fg); background: var(--add-bg); }
.blob-note { padding: 24px; text-align: center; color: var(--fg-muted); }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumbs { font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; min-width: 0; }
.breadcrumbs .sep { color: var(--fg-muted); padding: 0 4px; }
.group-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--fg-muted); margin: 20px 0 8px; }
.pager { display: flex; justify-content: center; gap: 8px; margin: 16px 0; }
.snippet { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; overflow-x: auto; }

/* ---- commit line ---- */
.commitline { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.commitline .subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sha { color: var(--fg-muted); }

/* ---- file tree ---- */
.files { width: 100%; border-collapse: collapse; }
.files td { padding: 10px 20px; border-top: 1px solid var(--border-muted); }
.files tr:first-child td { border-top: 0; }
.files tr:hover { background: var(--bg-subtle); }
.files .name { width: 30%; white-space: nowrap; }
.files .name a, .files .name span { margin-left: 8px; }
.files .msg { color: var(--fg-muted); max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .age { text-align: right; white-space: nowrap; color: var(--fg-muted); width: 1%; }
.icon-folder { color: var(--folder); }
.icon-folder-dot { color: var(--fg-muted); opacity: .7; }
.icon-file { color: var(--fg-muted); }
.ficon { color: var(--fc, var(--fg-muted)); }
@media (prefers-color-scheme: dark) { .ficon { filter: brightness(1.12); } }
.file-header .ficon, .readme .ficon { margin-right: 2px; }
.filelist .ficon { margin-right: 2px; vertical-align: -3px; }

/* ---- markdown ---- */
.markdown { padding: 28px 36px; overflow-wrap: break-word; }
.markdown > :first-child { margin-top: 0; }
.markdown h1, .markdown h2 { padding-bottom: .3em; font-family: var(--display); letter-spacing: -.02em; }
.markdown h1 { font-size: 2em; }
.markdown h2 { font-size: 1.5em; margin-top: 24px; }
.markdown code { background: var(--bg-inset); padding: .2em .4em; border-radius: 6px; }
.markdown pre { background: var(--bg-subtle); padding: 16px; border-radius: 12px; overflow: auto; }
.markdown pre code { background: none; padding: 0; }
.markdown table { border-collapse: collapse; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 6px 13px; }
.markdown blockquote { margin: 0 0 16px; padding: 10px 16px; background: var(--accent-subtle); border-radius: 12px; }
.markdown blockquote > :last-child { margin-bottom: 0; }
.markdown blockquote > :first-child { margin-top: 0; }
.markdown img { max-width: 100%; }

/* ---- blob view ---- */
.file-header { font-size: 12.5px; }
.blob-code { overflow-x: auto; }
.blob-code .chroma { background: var(--bg); margin: 0; padding: 8px 0; }
.blob-code table.lntable { border-spacing: 0; width: 100%; }
.blob-code .lntd { vertical-align: top; padding: 0; }
.blob-code .lntd:first-child { width: 1%; }
.blob-code pre { margin: 0; font-size: 12.5px; line-height: 20px; }
.blob-code .lnt { display: block; padding: 0 12px 0 16px; text-align: right; color: var(--fg-muted); user-select: none; }
.blob-code .lnt a, .blob-code .lnlinks { color: var(--fg-muted); }
.blob-code .line { display: block; padding: 0 16px; }
.blob-code .line-hl { background: var(--hl-bg); }
.blob-image { padding: 24px; text-align: center; background: var(--bg-subtle); }
.blob-image img { max-width: 100%; }

/* ---- commits ---- */
.commit-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border-muted); }
.commit-row:first-child { border-top: 0; }
.commit-row:hover { background: var(--bg-subtle); }
.commit-main { flex: 1; min-width: 0; }
.commit-main .subject { color: var(--fg); font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commit-main .muted { font-size: 12.5px; }
.commit-actions { display: flex; gap: 6px; }
.commit-head { padding: 16px 20px; }
.commit-title { display: flex; align-items: flex-start; gap: 12px; }
.commit-title h2 { flex: 1; margin: 0 0 8px; font-size: 22px; }
.commit-body { white-space: pre-wrap; margin: 0 0 12px; color: var(--fg-muted); font-size: 13px; }
.commit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border-muted); }

/* ---- diffs ---- */
.diffstat-summary { margin: 16px 0 8px; }
.filelist { margin-bottom: 16px; border-radius: var(--radius); background: var(--bg); box-shadow: var(--card); overflow: hidden; }
.filelist summary { padding: 12px 20px; cursor: pointer; font-weight: 600; }
.filelist ul { list-style: none; margin: 0; padding: 4px 0; max-height: 320px; overflow: auto; }
.filelist li { display: flex; justify-content: space-between; padding: 3px 16px; font-family: var(--mono); font-size: 12.5px; }
.filelist .status { display: inline-block; width: 16px; margin-right: 6px; text-transform: uppercase; font-weight: 700; }
.status-added { color: var(--add-fg); }
.status-deleted { color: var(--del-fg); }
.status-modified { color: #9a6700; }
.status-renamed, .status-copied { color: var(--accent); }
.difffile { border-radius: var(--radius); background: var(--bg); box-shadow: var(--card); margin-bottom: 16px; overflow: hidden; }
.difffile-header { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--bg); cursor: pointer; position: sticky; top: 0; z-index: 1; }
.difffile[open] .difffile-header { border-bottom: 1px solid var(--border-muted); }
.difffile-header .path { font-family: var(--mono); font-size: 12.5px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.difffile-header .status { font-size: 11px; text-transform: uppercase; font-weight: 700; }
.diff-note { padding: 16px; color: var(--fg-muted); text-align: center; }
table.diff { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; line-height: 20px; table-layout: fixed; }
table.diff td { padding: 0; vertical-align: top; }
table.diff .ln { width: 50px; padding: 0 8px; text-align: right; color: var(--fg-muted); user-select: none; }
table.diff .code { white-space: pre-wrap; word-break: break-all; padding-right: 16px; }
table.diff .marker { display: inline-block; width: 20px; padding-left: 8px; user-select: none; }
table.diff tr.add { background: var(--add-bg); }
table.diff tr.add .ln { background: var(--add-ln); }
table.diff tr.del { background: var(--del-bg); }
table.diff tr.del .ln { background: var(--del-ln); }
table.diff tr.hunk td { background: var(--hunk-bg); color: var(--fg-muted); padding-top: 4px; padding-bottom: 4px; }
table.diff tr.hunk .code { padding-left: 8px; }
.noeol { color: var(--del-fg); }
.stat { font-family: var(--mono); font-size: 12px; white-space: nowrap; }

/* ---- branches ---- */
.branch-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border-muted); }
.branch-row:first-child { border-top: 0; }
.branch-name { font-family: var(--mono); font-size: 12.5px; font-weight: 500; background: var(--accent-subtle); color: var(--accent); padding: 1px 8px; border-radius: 8px; }
.aheadbehind { display: inline-flex; font-size: 12px; font-family: var(--mono); }
.aheadbehind span { padding: 0 8px; min-width: 40px; }
.aheadbehind .behind { text-align: right; border-right: 1px solid var(--border); }

/* ---- settings / admin ---- */
.with-sidenav { display: flex; gap: 24px; align-items: flex-start; }
.sidenav { display: flex; flex-direction: column; width: 220px; flex-shrink: 0; }
.sidenav a { padding: 7px 12px; border-radius: 10px; color: var(--fg); }
.sidenav a:hover { background: var(--bg); text-decoration: none; }
.sidenav a.active { background: var(--bg); font-weight: 600; box-shadow: var(--card); }
.key-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--border-muted); }
.key-row:first-of-type { border-top: 0; }
.key-row > .icon { width: 24px; height: 24px; color: var(--fg-muted); }
.props { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 0; }
.props dt { color: var(--fg-muted); }
.props dd { margin: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--fg-muted); padding: 12px 20px; border-bottom: 1px solid var(--border-muted); background: var(--bg); }
.table td { padding: 11px 20px; border-top: 1px solid var(--border-muted); }
.table tr.inactive td { opacity: .55; }
.danger-zone { box-shadow: var(--card), inset 0 0 0 1px var(--danger); }
.table td.right { text-align: right; }
.table td .icon { vertical-align: text-bottom; color: var(--fg-muted); }

/* ---- packages ---- */
.registry-help p { margin: 0 0 10px; }
.registry-help .copy-field:last-child { margin-bottom: 0; }
.pull-cmd { max-width: 640px; margin: 12px 0 16px; }
.label { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 20px; background: var(--bg-inset); color: var(--fg); }
.search-input { width: 320px; max-width: 100%; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.version-layout { display: flex; gap: 16px; align-items: flex-start; }
.version-main { flex: 1; min-width: 0; }
.version-side { width: 300px; flex-shrink: 0; }
.side-props { grid-template-columns: 80px 1fr; }
.side-title { font-weight: 600; margin-bottom: 8px; }
.table tr.selected td { background: var(--accent-subtle); }
.table.layers td { vertical-align: top; }
.table.layers .num { width: 1%; }
.table.layers .cmd { white-space: pre-wrap; word-break: break-all; }
.table tr.empty-layer .cmd { color: var(--fg-muted); }
.nowrap { white-space: nowrap; }
.wrap { word-break: break-all; }
@media (max-width: 900px) { .version-layout { flex-direction: column; } .version-side { width: 100%; } }
.btn-icon { padding: 1px 5px; vertical-align: middle; border-color: transparent; background: transparent; }

/* ---- auth / errors ---- */
.auth-box { max-width: 360px; margin: 64px auto; }
.auth-box h1 { font: 700 26px var(--display); letter-spacing: -.02em; text-align: center; margin-bottom: 24px; }
.auth-logo { text-align: center; color: var(--accent); }
.auth-logo .icon { width: 48px; height: 48px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--fg-muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.error-page { text-align: center; padding: 64px 0; }
.error-code { font: 700 88px var(--display); letter-spacing: -.04em; color: var(--fg-muted); }
.empty-repo { padding: 24px 32px; }
.empty-repo h3 { font-size: 14px; margin: 20px 0 8px; }

@media (max-width: 720px) {
  .files .msg { display: none; }
  .with-sidenav { flex-direction: column; }
  .sidenav { width: 100%; flex-direction: row; overflow-x: auto; }
  .clone-menu { width: min(400px, calc(100vw - 32px)); }
  .markdown { padding: 16px; }
  table.diff .ln { width: 36px; padding: 0 4px; }
}
.center { text-align: center; }
.linklike { background: none; border: 0; padding: 8px; color: var(--accent); font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }

/* ---- pull requests ---- */
:root { --merged: #8250df; --open: #1a7f37; --closed: #cf222e; }
@media (prefers-color-scheme: dark) { :root { --merged: #a371f7; --open: #3fb950; --closed: #f85149; } }
.counter { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; font-size: 12px; font-weight: 600; line-height: 18px;
  text-align: center; background: var(--bg-inset); border-radius: 999px; color: var(--fg); }
.pull-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border-muted); }
.pull-row:first-child { border-top: 0; }
.pull-row:hover { background: var(--bg-subtle); }
.pull-title { font-weight: 600; font-size: 15.5px; }
.pr-icon { padding-top: 2px; }
.pr-open { color: var(--open); }
.pr-merged { color: var(--merged); }
.pr-closed { color: var(--closed); }
.branch-pair { white-space: nowrap; font-size: 12px; color: var(--fg-muted); }
.branch-pair .branch-name { font-size: 12px; font-weight: 500; }
.branch-name.deleted { text-decoration: line-through; opacity: .7; }
.compare-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
.compare-bar label { display: flex; align-items: center; gap: 6px; }
.compare-bar .icon { color: var(--fg-muted); }
.pull-header { margin-bottom: 16px; }
.pull-title-row { display: flex; align-items: flex-start; gap: 12px; }
.pull-h1 { flex: 1; font: 700 30px/1.2 var(--display); letter-spacing: -.02em; margin: 0 0 10px; }
.pull-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--fg-muted); }
.pull-sub strong { color: var(--fg); }
.state { display: inline-flex; align-items: center; gap: 4px; padding: 5px 14px; border-radius: 999px; color: #fff; font-weight: 600; }
.state-open { background: var(--open); }
.state-merged { background: var(--merged); }
.state-closed { background: var(--closed); }
.state .icon { color: #fff; }
.subtabs { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.subtabs > a { display: flex; align-items: center; gap: 6px; padding: 7px 14px; color: var(--fg); border-radius: 999px; }
.subtabs > a:hover { text-decoration: none; background: var(--bg); }
.subtabs > a.active { background: var(--bg); box-shadow: var(--card); font-weight: 600; }
.subtabs .icon { color: var(--fg-muted); }
.review-pop { width: 380px; padding: 12px; }
.edit-pop { width: 520px; padding: 12px; }
.review-pop label.check, .edit-pop label.check { align-items: flex-start; font-weight: normal; }
.review-pop label.check input { margin-top: 4px; }
.timeline { max-width: 920px; }
.tl-comment .box-header { font-size: 13px; }
.tl-comment .markdown { padding: 12px 16px; }
.tl-indent { margin-left: 40px; }
.tl-event { display: flex; align-items: center; gap: 10px; padding: 6px 0 6px 12px; margin: 0 0 12px 12px; border-left: 2px solid var(--border); color: var(--fg-muted); flex-wrap: wrap; }
.tl-event strong { color: var(--fg); }
.tl-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: -27px; border-radius: 50%;
  background: var(--bg-inset); color: var(--fg-muted); border: 2px solid var(--canvas); flex-shrink: 0; }
.merge-box .tl-badge, .tl-badge.inline { margin-left: 0; width: 24px; height: 24px; }
.tl-ok { background: var(--open); color: #fff; }
.tl-bad { background: var(--closed); color: #fff; }
.tl-merged { background: var(--merged); color: #fff; }
.thread { border-radius: 14px; margin: 0 0 16px; background: var(--bg); box-shadow: var(--card); overflow: hidden; }
.thread-row > td { padding: 8px 12px !important; background: var(--bg-subtle); font-family: var(--sans); font-size: 14px; white-space: normal; }
.thread-row .thread { margin: 0; max-width: 820px; }
.thread-head { padding: 8px 12px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); font-size: 12.5px; }
.snippet-diff { border-bottom: 1px solid var(--border); }
.snippet-diff td.code { padding-left: 4px; }
.thread-comment { padding: 8px 12px; border-top: 1px solid var(--border-muted); }
.thread-comment:first-of-type { border-top: 0; }
.thread-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.thread-comment .markdown { padding: 4px 0 0 26px; }
.thread-comment .markdown > :last-child { margin-bottom: 0; }
.thread .form { padding: 8px 12px; }
.thread-reply { border-top: 1px solid var(--border-muted); }
.thread-reply summary { padding: 8px 12px; cursor: pointer; font-size: 13px; }
table.diff td.ln { position: relative; }
.add-comment { display: none; position: absolute; right: -10px; top: 1px; z-index: 2; width: 20px; height: 18px; padding: 0; border: 0; border-radius: 4px;
  background: var(--accent); color: var(--accent-fg); font: 700 14px/18px var(--sans); cursor: pointer; }
table.diff tr:hover .add-comment { display: block; }
.merge-box.merge-ok { box-shadow: var(--card), inset 0 0 0 2px var(--open); }
.merge-section { padding: 12px 16px; border-top: 1px solid var(--border-muted); }
.merge-section:first-child { border-top: 0; }
.merge-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.merge-sub { display: flex; align-items: center; gap: 6px; margin: 6px 0 0 32px; flex-wrap: wrap; }
.merge-sub.owners { display: block; }
.merge-sub.owners summary { cursor: pointer; }
.merge-sub ul, .conflict-list { margin: 4px 0 0 32px; padding-left: 16px; }
.blockers { margin: 0 0 12px; padding-left: 20px; color: var(--closed); }
.merge-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.merge-msg { display: flex; flex-direction: column; gap: 6px; }
.merge-msg input { font-weight: 600; }
.merge-form label.check { font-weight: normal; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.state-box { display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.state-box-merged { box-shadow: var(--card), inset 0 0 0 2px var(--merged); }
.state-box-merged > .icon { color: var(--merged); }
.state-box-closed > .icon { color: var(--closed); }
.comment-form .form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.protection-form label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: normal; }
.protection-form label.inline input { width: 80px; }
.pad { padding: 16px 20px; }
@media (max-width: 720px) {
  .review-pop, .edit-pop { width: min(380px, calc(100vw - 32px)); }
  .branch-pair { display: none; }
  .tl-indent { margin-left: 0; }
}

/* ---- actions & deployments ---- */
.st { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; vertical-align: middle; }
.st .icon, .table td .st .icon { width: 12px; height: 12px; color: #fff; }
.st-ok { background: var(--open); }
.st-bad { background: var(--closed); }
.st-run { background: #d29922; animation: st-pulse 1.2s ease-in-out infinite; }
.st-wait { background: var(--border); }
.st-wait .icon, .table td .st-wait .icon { color: var(--fg-muted); }
.st-skip { background: transparent; }
.st-skip .icon, .table td .st-skip .icon { width: 16px; height: 16px; color: var(--fg-muted); }
@keyframes st-pulse { 50% { opacity: .45; } }
.tl-pending { background: #d29922; color: #fff; }
.page-title { font: 700 26px var(--display); letter-spacing: -.02em; margin: 0; }
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
form.inline { display: inline; }
.btn-link { background: none; border: 0; padding: 0 2px; color: var(--fg-muted); cursor: pointer; font: inherit; }
.btn-link:hover { color: var(--danger); }
.btn.btn-link { color: var(--accent); font-weight: normal; }
.run-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border-muted); }
.run-row:first-child, .box-header + .run-row { border-top: 0; }
.run-main { flex: 1; min-width: 0; }
.run-main > div { margin-top: 2px; }
.run-jobs { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 40%; }
.run-header { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.run-header > .st, .run-header > span > .st { width: 24px; height: 24px; margin-top: 4px; }
.run-header h2 { margin: 0; font-size: 24px; }
.run-header form { display: inline; }
.job-layout .sidenav a { display: flex; align-items: center; gap: 8px; }
.job-main { flex: 1; min-width: 0; }
.job-steps { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.job-steps li { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.job-steps li.step-skipped, .job-steps li.step-pending { color: var(--fg-muted); }
.job-log { background: #141726; color: #e6e8f2; border-radius: var(--radius); padding: 12px 0; min-height: 120px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; margin: 0; }
.job-log .log-line { padding: 0 16px; white-space: pre-wrap; word-break: break-all; min-height: 1.5em; }
.job-log .log-step { padding: 6px 16px; margin-top: 8px; color: #8ca1ff; font-weight: 600; border-top: 1px solid #262b40; }
.job-log .log-step:first-child { margin-top: 0; border-top: 0; }
.deploy-matrix td { white-space: nowrap; }
.deploy-dims { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.deploy-dims fieldset { border: 1px solid var(--border); border-radius: 12px; background: var(--bg); padding: 8px 12px; margin: 0; min-width: 200px; flex: 1; }
.deploy-dims legend { font-weight: 600; padding: 0 4px; }
.deploy-dims .choices { display: flex; flex-wrap: wrap; gap: 4px 14px; max-height: 260px; overflow-y: auto; }
.deploy-form .box.pad { display: flex; flex-direction: column; gap: 12px; }
.form-actions { display: flex; gap: 8px; }
.eval-target { padding: 10px 16px; border-top: 1px solid var(--border-muted); }
.eval-target:first-of-type { border-top: 0; }
.eval-checks { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.eval-checks li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rule-row { padding: 12px 16px; border-top: 1px solid var(--border-muted); display: grid; grid-template-columns: 1fr; gap: 8px; }
.rule-row:first-of-type { border-top: 0; }
.rule-row > input[name=description] { font-weight: 600; }
.rule-new { background: var(--bg-subtle); }
.rule-actions { display: flex; gap: 8px; }
.team-members { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dim-form .src-paths { display: none; }
.dim-form[data-src=paths] .src-paths { display: inline-block; }
.dim-form[data-src=paths] .src-list { display: none; }

/* ---- status badges (deployments) ---- */
.badge-success { background: color-mix(in srgb, var(--open) 16%, transparent); color: var(--open); }
.badge-failure, .badge-rejected { background: color-mix(in srgb, var(--closed) 16%, transparent); color: var(--closed); }
.badge-running, .badge-pending { background: color-mix(in srgb, #d29922 20%, transparent); color: #b7791f; }
.badge-cancelled { background: var(--bg-inset); color: var(--fg-muted); }

@media (max-width: 900px) {
  .tabs .container { max-width: none; margin: 0 16px; }
}
