/* GitWall — general stylesheet (design tokens, themes, shared components). */
/* Extracted from layout.html; contains no template interpolation. */

    @font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/vendor/inter/Inter-Regular.woff2') format('woff2'); }
    @font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/vendor/inter/Inter-Medium.woff2') format('woff2'); }
    @font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/vendor/inter/Inter-SemiBold.woff2') format('woff2'); }
    @font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/vendor/inter/Inter-Bold.woff2') format('woff2'); }

    /* ── Neutral dark theme ─────────────────────────────────────────────────── */
    :root, [data-bs-theme="dark"] {
      --gw-bg:               #17181c;
      --gw-surface:          #1f2025;
      --gw-surface-variant:  #262930;
      --gw-border:           #343842;
      --gw-primary:          #aab8ff;
      --gw-primary-hover:    #c0cbff;
      --gw-primary-container:#283055;
      --gw-on-primary:       #10131b;
      --gw-tonal-bg:         rgba(170,184,255,.10);
      --gw-tonal-hover:      rgba(170,184,255,.16);
      --gw-text:             #e6e1e5;
      --gw-muted:            #a0a6b0;
      --gw-accent:           var(--gw-primary);
      --gw-accent-hover:     var(--gw-primary-hover);
      --gw-link:             #aab8ff;
      --gw-danger:           #ffb4ab;
      --gw-danger-container: #5e1a1f;
      --gw-success:          #8bc79d;
      --gw-warning:          #d7ba73;
      --gw-merged:           #bda9ea;
      --gw-btn-close-filter: invert(1);
      --gw-overlay:          rgba(255,255,255,.03);
      --gw-overlay-hover:    rgba(255,255,255,.06);
      --gw-elev1:            0 1px 2px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.3);
      --gw-elev2:            0 2px 4px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
      --gw-elev3:            0 4px 8px rgba(0,0,0,.4), 0 8px 20px rgba(0,0,0,.3);
    }
    /* ── Neutral light theme ────────────────────────────────────────────────── */
    [data-bs-theme="light"] {
      --gw-bg:               #fbfcfe;
      --gw-surface:          #ffffff;
      --gw-surface-variant:  #f2f4f7;
      --gw-border:           #d8dde5;
      --gw-primary:          #3858d6;
      --gw-primary-hover:    #2747bd;
      --gw-primary-container:#e8edff;
      --gw-on-primary:       #ffffff;
      --gw-tonal-bg:         rgba(56,88,214,.08);
      --gw-tonal-hover:      rgba(56,88,214,.13);
      --gw-text:             #1c1b1f;
      --gw-muted:            #66707c;
      --gw-accent:           var(--gw-primary);
      --gw-accent-hover:     var(--gw-primary-hover);
      --gw-link:             #3858d6;
      --gw-danger:           #ba1a1a;
      --gw-danger-container: #ffdad6;
      --gw-success:          #2f6b46;
      --gw-warning:          #876100;
      --gw-merged:           #6d4aa5;
      --gw-btn-close-filter: none;
      --gw-overlay:          rgba(0,0,0,.04);
      --gw-overlay-hover:    rgba(0,0,0,.08);
      --gw-elev1:            0 1px 2px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.08);
      --gw-elev2:            0 2px 4px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.08);
      --gw-elev3:            0 4px 8px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.08);
    }
    /* ── Base ───────────────────────────────────────────────────────────────── */
    body { background: var(--gw-bg); color: var(--gw-text); font-family: 'Inter', system-ui, -apple-system, sans-serif; }
    label, .form-label { color: var(--gw-text); }
    ::placeholder { color: var(--gw-muted) !important; opacity: 1; }
    .btn-close { filter: var(--gw-btn-close-filter); }
    /* ── Navbar ─────────────────────────────────────────────────────────────── */
    .navbar {
      background: var(--gw-surface) !important;
      box-shadow: var(--gw-elev1);
      border-bottom: none;
      padding-top: .6rem;
      padding-bottom: .6rem;
    }
    .navbar-brand {
      font-weight: 700;
      font-size: 1.15rem;
      letter-spacing: -.01em;
      color: var(--gw-text) !important;
    }
    .gw-logo {
      width: 1.75rem;
      height: 1.75rem;
      object-fit: contain;
      border-radius: .4rem;
      box-shadow: 0 1px 2px rgba(0,0,0,.18);
    }
    .navbar .nav-link { color: var(--gw-text) !important; border-radius: 8px; padding: .35rem .6rem !important; }
    .navbar .nav-link:hover { color: var(--gw-primary) !important; background: var(--gw-tonal-bg); text-decoration: none; }
    .navbar .form-control {
      border-radius: 8px;
      background: var(--gw-bg);
      border-color: var(--gw-border);
      color: var(--gw-text);
      font-size: .875rem;
    }
    .navbar .form-control:focus { border-color: var(--gw-primary); box-shadow: 0 0 0 3px var(--gw-tonal-bg); }
    /* ── Links ──────────────────────────────────────────────────────────────── */
    a { color: var(--gw-link); text-decoration: none; }
    a:hover { text-decoration: underline; color: var(--gw-accent-hover); }
    /* ── Cards ──────────────────────────────────────────────────────────────── */
    .card {
      background: var(--gw-surface);
      border: 1px solid var(--gw-border);
      border-radius: 10px !important;
      color: var(--gw-text);
    }
    .card-header {
      background: var(--gw-surface-variant);
      border-bottom: 1px solid var(--gw-border);
      color: var(--gw-text);
      border-radius: 10px 10px 0 0 !important;
    }
    .card-body, .card-footer { color: var(--gw-text); }
    .card-footer { border-top: 1px solid var(--gw-border); border-radius: 0 0 10px 10px !important; }
    /* ── Elevated card (higher elevation) ──────────────────────────────────── */
    .gw-card-elevated { box-shadow: var(--gw-elev2) !important; }
    /* ── Copy button for code blocks ───────────────────────────────────── */
    .gw-copy-btn {
      position:absolute;top:.5rem;right:.5rem;
      background:var(--gw-surface-variant);border:1px solid var(--gw-border);
      color:var(--gw-muted);border-radius:6px;padding:2px 7px;
      font-size:.8rem;cursor:pointer;opacity:0;transition:opacity .15s;z-index:2;
    }
    pre:hover .gw-copy-btn { opacity:1; }
    .gw-copy-btn:hover { color:var(--gw-text);background:var(--gw-tonal-hover); }
    /* ── Tonal surface ──────────────────────────────────────────────────────── */
    .gw-surface { background: var(--gw-surface-variant); border-radius: 12px; }
    /* ── Buttons ────────────────────────────────────────────────────────────── */
    .btn { border-radius: 8px !important; font-weight: 500; letter-spacing: .01em; }
    .btn-sm { border-radius: 6px !important; }
    .btn-lg { border-radius: 10px !important; }
    .btn-primary {
      background: var(--gw-primary);
      border-color: var(--gw-primary);
      color: var(--gw-on-primary);
    }
    .btn-primary:hover, .btn-primary:focus {
      background: var(--gw-primary-hover);
      border-color: var(--gw-primary-hover);
      color: var(--gw-on-primary);
      box-shadow: 0 2px 8px rgba(56,88,214,.22);
    }
    .btn-outline-secondary {
      color: var(--gw-text);
      border-color: var(--gw-border);
    }
    .btn-outline-secondary:hover {
      background: var(--gw-tonal-bg);
      border-color: var(--gw-primary);
      color: var(--gw-primary);
    }
    .btn-outline-danger { color: var(--gw-danger); border-color: var(--gw-danger); }
    .btn-outline-danger:hover { background: rgba(255,180,171,.1); }
    /* MD3 tonal button */
    .btn-tonal {
      background: var(--gw-tonal-bg);
      border-color: transparent;
      color: var(--gw-primary);
    }
    .btn-tonal:hover {
      background: var(--gw-tonal-hover);
      border-color: transparent;
      color: var(--gw-primary);
    }
    /* ── Forms ──────────────────────────────────────────────────────────────── */
    .form-control, .form-select {
      background: var(--gw-bg);
      border-color: var(--gw-border);
      color: var(--gw-text);
      border-radius: 8px;
    }
    .form-control:focus, .form-select:focus {
      background: var(--gw-bg);
      color: var(--gw-text);
      border-color: var(--gw-primary);
      box-shadow: 0 0 0 3px var(--gw-tonal-bg);
    }
    .form-check-label { color: var(--gw-text); }
    .input-group-text {
      background: var(--gw-surface);
      border-color: var(--gw-border);
      color: var(--gw-text);
      border-radius: 8px;
    }
    .input-group > :first-child { border-radius: 8px 0 0 8px !important; }
    .input-group > :last-child  { border-radius: 0 8px 8px 0 !important; }
    textarea.form-control { border-radius: 12px; }
    /* ── Lists ──────────────────────────────────────────────────────────────── */
    .list-group-item { background: var(--gw-surface); border-color: var(--gw-border); color: var(--gw-text); }
    .list-group-item:first-child { border-radius: 12px 12px 0 0 !important; }
    .list-group-item:last-child  { border-radius: 0 0 12px 12px !important; }
    .list-group-item:hover { background: var(--gw-overlay-hover); }
    /* ── Text helpers ───────────────────────────────────────────────────────── */
    .text-muted { color: var(--gw-muted) !important; }
    .text-body { color: var(--gw-text) !important; }
    .border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--gw-border) !important; }
    /* ── Dropdowns ──────────────────────────────────────────────────────────── */
    .dropdown-menu {
      background: var(--gw-surface);
      border-color: var(--gw-border);
      border-radius: 12px;
      box-shadow: var(--gw-elev3);
      padding: .5rem;
    }
    .dropdown-item { color: var(--gw-text); border-radius: 8px; padding: .45rem .75rem; }
    .dropdown-item:hover, .dropdown-item:focus { background: var(--gw-tonal-bg); color: var(--gw-primary); }
    .dropdown-divider { border-color: var(--gw-border); margin: .35rem 0; }
    .dropdown-header { color: var(--gw-muted); padding-left: .75rem; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
    .gw-bell-link { position: relative; display: inline-flex; align-items: center; justify-content: center; }
    .gw-bell-badge {
      position: absolute;
      top: -2px;
      right: -1px;
      min-width: 1.1rem;
      height: 1.1rem;
      padding: 0 .28rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      background: var(--gw-danger);
      color: var(--gw-on-primary);
      font-size: .68rem;
      font-weight: 700;
      line-height: 1;
      box-shadow: var(--gw-elev1);
    }
    .gw-bell-badge.d-none { display: none !important; }
    .gw-notif-toast-wrap {
      position: fixed;
      top: 1rem;
      right: 1rem;
      z-index: 1095;
      display: flex;
      flex-direction: column;
      gap: .75rem;
      max-width: min(380px, calc(100vw - 2rem));
    }
    .gw-notif-toast {
      background: var(--gw-surface);
      border: 1px solid var(--gw-border);
      color: var(--gw-text);
      box-shadow: var(--gw-elev3);
      border-radius: 14px;
      overflow: hidden;
    }
    .gw-notif-toast .toast-header {
      background: var(--gw-surface-variant);
      color: var(--gw-text);
      border-bottom: 1px solid var(--gw-border);
    }
    .gw-notif-toast .btn-close { filter: var(--gw-btn-close-filter); }
    .gw-notif-toast-title {
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .gw-notif-toast-bodytext {
      color: var(--gw-muted);
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    /* ── Tables ─────────────────────────────────────────────────────────────── */
    .table { color: var(--gw-text); --bs-table-bg: transparent; --bs-table-border-color: var(--gw-border); --bs-table-striped-bg: var(--gw-overlay); }
    .table > :not(caption) > * > * { background: transparent; color: var(--gw-text); }
    .markdown-rendered table {
      width: 100%;
      margin: 1rem 0;
      border-collapse: collapse;
      border: 1px solid var(--gw-border);
      border-radius: 12px;
      overflow: hidden;
    }
    .markdown-rendered th, .markdown-rendered td {
      padding: .65rem .8rem;
      border: 1px solid var(--gw-border);
      vertical-align: top;
    }
    .markdown-rendered thead th {
      background: var(--gw-overlay);
      font-weight: 600;
    }
    /* ── Badges / Chips ─────────────────────────────────────────────────────── */
    .badge { border-radius: 8px; font-weight: 500; }
    .badge-open    { background: rgba(139,199,157,.14); color: var(--gw-success); border: 1px solid rgba(139,199,157,.22); }
    .badge-closed  { background: var(--gw-surface-variant); color: var(--gw-muted); border: 1px solid var(--gw-border); }
    .badge-merged  { background: rgba(189,169,234,.16); color: var(--gw-merged); border: 1px solid rgba(189,169,234,.24); }
    /* Fix Bootstrap utility badges for dark mode */
    .bg-light.text-dark { background: var(--gw-surface-variant) !important; color: var(--gw-text) !important; border-color: var(--gw-border) !important; }
    .bg-warning.text-dark { background: rgba(215,186,115,.14) !important; color: var(--gw-warning) !important; }
    .bg-info.text-dark { background: rgba(56,88,214,.12) !important; color: var(--gw-primary) !important; }
    .text-bg-light { background: var(--gw-surface-variant) !important; color: var(--gw-text) !important; }
    /* Override Bootstrap's table-dark to work in both themes */
    .table-dark { background: var(--gw-surface-variant) !important; color: var(--gw-text) !important; }
    .table-dark thead { background: var(--gw-overlay) !important; }
    .table-dark th { color: var(--gw-text) !important; }
    .table-dark td { color: var(--gw-text) !important; border-color: var(--gw-border) !important; }
    /* MD3 Chip — for topics and labels */
    .gw-chip {
      display: inline-flex;
      align-items: center;
      gap: .3rem;
      padding: .2rem .65rem;
      border-radius: 8px;
      font-size: .75rem;
      font-weight: 500;
      background: var(--gw-tonal-bg);
      color: var(--gw-primary);
      border: 1px solid var(--gw-primary-container);
      text-decoration: none;
      line-height: 1.5;
    }
    .gw-chip:hover { background: var(--gw-tonal-hover); color: var(--gw-primary); text-decoration: none; }
    /* ── Repo nav ───────────────────────────────────────────────────────────── */
    .repo-header { padding: 1rem 0 .75rem; border-bottom: 1px solid var(--gw-border); margin-bottom: 1rem; }
    .repo-nav .nav-link { color: var(--gw-muted); padding: .45rem .8rem; border-radius: 8px; font-size: .9rem; transition: color .15s, background .15s; }
    .repo-nav .nav-link:hover { color: var(--gw-text) !important; background: var(--gw-overlay-hover); text-decoration: none; }
    .repo-nav .nav-link.active {
      color: var(--gw-primary) !important;
      font-weight: 600;
      background: var(--gw-tonal-bg);
      border-bottom: 2px solid var(--gw-primary);
      border-radius: 8px 8px 0 0;
    }
    /* ── Code ───────────────────────────────────────────────────────────────── */
    .code-block { background: var(--gw-bg); border: 1px solid var(--gw-border); border-radius: 12px; overflow-x: auto; }
    .code-block pre { margin: 0; padding: 1rem; color: var(--gw-text); }
    pre, code { color: var(--gw-text); }
    /* Log blocks — theme aware */
    .run-log, .raw-run-log { background: var(--gw-bg) !important; color: var(--gw-text) !important; border: 1px solid var(--gw-border); border-radius: 8px; }
    /* ── Syntax highlighting (chroma) ───────────────────────────────────────── */
    .markdown-rendered pre,
    .markdown-rendered .highlight,
    .markdown-rendered .chroma {
      background: var(--gw-surface-variant);
      color: var(--gw-text);
      border: 1px solid var(--gw-border);
      border-radius: 12px;
      overflow-x: auto;
      box-shadow: var(--gw-elev1);
    }
    .markdown-rendered pre {
      margin: 1rem 0;
      padding: 1rem;
      white-space: pre;
    }
    .markdown-rendered pre code {
      padding: 0;
      background: transparent;
      border: 0;
      color: inherit;
      white-space: inherit;
    }
    .chroma { font-size: .85rem; line-height: 1.5; margin: 0; }
    .chroma table { border-collapse: collapse; width: 100%; }
    .chroma .lntd:first-child { width: 1%; padding-right: .75rem; text-align: right; user-select: none; border-right: 1px solid var(--gw-border); }
    .chroma .lntd { padding: .5rem .75rem; vertical-align: top; }
    .chroma .lntd pre { margin: 0; padding: 0; background: transparent; border: none; }
    /* Markdown code blocks from goldmark */
    .highlight { margin: 1rem 0; }
    .highlight pre { margin: 0; padding: .75rem 1rem; font-size: .85rem; line-height: 1.5; }
    .markdown-rendered img {
      display: block;
      max-width: min(100%, 720px);
      max-height: 32rem;
      width: auto;
      height: auto;
      object-fit: contain;
      margin: 1rem auto;
      border-radius: 12px;
      border: 1px solid var(--gw-border);
      box-shadow: var(--gw-elev1);
      background: var(--gw-surface);
    }
    /* ── Diff ───────────────────────────────────────────────────────────────── */
    .diff-add  { background: rgba(139,199,157,.10); }
    .diff-del  { background: rgba(255,180,171,.10); }
    .diff-hunk { background: var(--gw-tonal-bg); color: var(--gw-muted); padding: .25rem .5rem; font-size: .8rem; }
    .diff-line code {
      display: block;
      white-space: pre-wrap;
      word-break: break-word;
      font-family: 'JetBrains Mono', 'Fira Code', monospace;
    }
    .diff-file-block { background: var(--gw-bg); }
    .repo-sidebar .card,
    .repo-sidebar .input-group,
    .repo-sidebar .small {
      font-size: .9rem;
    }
    .repo-sidebar .card-header {
      font-size: .78rem;
      letter-spacing: .02em;
      text-transform: uppercase;
    }
    .repo-sidebar .repo-description {
      line-height: 1.5;
    }
    .repo-toolbar {
      gap: .5rem;
    }
    .repo-toolbar details > summary {
      list-style: none;
    }
    .repo-toolbar details > summary::-webkit-details-marker {
      display: none;
    }
    .repo-init-panel {
      min-width: min(100%, 36rem);
    }
    /* ── File tree ──────────────────────────────────────────────────────────── */
    .file-tree-item { display: flex; align-items: center; gap: .5rem; padding: .4rem .85rem; border-bottom: 1px solid var(--gw-border); color: var(--gw-text); transition: background .12s; }
    .file-tree-item:last-child { border-bottom: none; }
    .file-tree-item:hover { background: var(--gw-overlay); }
    .file-tree-item .bi-folder-fill { color: var(--gw-primary); }
    .file-tree-item .bi-file-earmark-text { color: var(--gw-muted); }
    /* ── Repo code bar (branch / commits / branches / tags) ──────────────────── */
    .repo-codebar { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; padding: .55rem .7rem; background: var(--gw-surface); border: 1px solid var(--gw-border); border-radius: 12px; margin-bottom: 1rem; box-shadow: var(--gw-elev1); }
    .repo-branch-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; font-size: .85rem; font-weight: 600; color: var(--gw-text); background: var(--gw-surface-variant); border: 1px solid var(--gw-border); border-radius: 8px; }
    .repo-branch-btn:hover { border-color: var(--gw-primary); color: var(--gw-primary); }
    .repo-branch-btn .bi-git { color: var(--gw-primary); }
    .repo-stats { display: inline-flex; border: 1px solid var(--gw-border); border-radius: 8px; overflow: hidden; }
    .repo-stat { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; font-size: .82rem; color: var(--gw-text); text-decoration: none; background: var(--gw-surface); border-left: 1px solid var(--gw-border); transition: background .12s, color .12s; white-space: nowrap; }
    .repo-stat:first-child { border-left: none; }
    .repo-stat:hover { background: var(--gw-tonal-bg); color: var(--gw-primary); }
    .repo-stat .repo-stat-num { font-weight: 700; }
    .repo-stat .repo-stat-lbl { color: var(--gw-muted); }
    .repo-stat:hover .repo-stat-lbl { color: inherit; }
    /* ── Repo right sidebar ──────────────────────────────────────────────────── */
    .repo-side-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gw-muted); font-weight: 700; margin-bottom: .55rem; display: flex; align-items: center; gap: .4rem; }
    .repo-side-block { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--gw-border); }
    .repo-side-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
    .lang-bar { display: flex; overflow: hidden; border-radius: 6px; height: 10px; background: var(--gw-border); margin-bottom: .7rem; }
    .lang-bar > span { transition: width .3s ease; }
    .lang-row { display: flex; align-items: center; gap: .5rem; font-size: .8rem; padding: .12rem 0; }
    .lang-row .lang-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
    .lang-row .lang-name { flex: 1; color: var(--gw-text); }
    .lang-row .lang-pct { color: var(--gw-muted); font-variant-numeric: tabular-nums; }
    /* ── Misc ───────────────────────────────────────────────────────────────── */
    .avatar { border-radius: 50%; }
    .commit-sha {
      font-family: 'JetBrains Mono', 'Fira Code', monospace;
      font-size: .78rem;
      background: var(--gw-tonal-bg);
      padding: .15rem .45rem;
      border-radius: 6px;
      color: var(--gw-primary);
    }
    .htmx-indicator { display: none; }
    .htmx-request .htmx-indicator { display: inline-block; }
    .htmx-indicator.htmx-request  { display: inline-block; }
    .sidebar { border-right: 1px solid var(--gw-border); min-height: calc(100vh - 60px); }
    .issue-state-open   { color: var(--gw-success); }
    .issue-state-closed { color: var(--gw-muted); }
    .issue-state-merged { color: var(--gw-merged); }
    .nav-pills .nav-link { color: var(--gw-muted); border-radius: 20px; }
    .nav-pills .nav-link.active { background: var(--gw-primary); color: var(--gw-on-primary); }
    .alert { border-radius: 12px; }
    .alert-danger  { background: rgba(255,180,171,.08); border-color: rgba(255,180,171,.25); color: var(--gw-danger); }
    .alert-success { background: rgba(139,199,157,.08); border-color: rgba(139,199,157,.24); color: var(--gw-success); }
    .ci-success { color: var(--gw-success); }
    .ci-failed  { color: var(--gw-danger); }
    .ci-running { color: var(--gw-warning); }
    .ci-pending { color: var(--gw-muted); }
    /* ── Matrix theme ───────────────────────────────────────────────────────── */
    [data-bs-theme="matrix"] {
      --gw-bg:               #000000;
      --gw-surface:          #030f03;
      --gw-surface-variant:  #051405;
      --gw-border:           #0d4a0d;
      --gw-primary:          #00ff41;
      --gw-primary-hover:    #39ff6e;
      --gw-primary-container:#001a00;
      --gw-on-primary:       #000000;
      --gw-tonal-bg:         rgba(0,255,65,.07);
      --gw-tonal-hover:      rgba(0,255,65,.14);
      --gw-text:             #c8ffc8;
      --gw-muted:            #3a7a3a;
      --gw-accent:           var(--gw-primary);
      --gw-accent-hover:     var(--gw-primary-hover);
      --gw-link:             #00ff41;
      --gw-danger:           #ff4444;
      --gw-danger-container: #330000;
      --gw-success:          #00ff41;
      --gw-warning:          #ffcc00;
      --gw-merged:           #00ccff;
      --gw-btn-close-filter: invert(1) sepia(1) saturate(10) hue-rotate(90deg);
      --gw-overlay:          rgba(0,255,65,.04);
      --gw-overlay-hover:    rgba(0,255,65,.08);
      --gw-elev1:            0 1px 2px rgba(0,255,65,.15), 0 2px 6px rgba(0,0,0,.8);
      --gw-elev2:            0 2px 4px rgba(0,255,65,.15), 0 4px 12px rgba(0,0,0,.8);
      --gw-elev3:            0 4px 8px rgba(0,255,65,.20), 0 8px 20px rgba(0,0,0,.8);
    }
    [data-bs-theme="matrix"] body {
      font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
      text-shadow: 0 0 6px rgba(0,255,65,.35);
    }
    [data-bs-theme="matrix"] .dropdown-item:hover,
    [data-bs-theme="matrix"] .dropdown-item:focus,
    [data-bs-theme="matrix"] .list-group-item-action:hover,
    [data-bs-theme="matrix"] .list-group-item-action:focus {
      background: var(--gw-tonal-hover) !important;
      color: var(--gw-primary) !important;
      text-shadow: 0 0 8px rgba(0,255,65,.5);
    }
    [data-bs-theme="matrix"] .dropdown-item { color: var(--gw-text); }
    [data-bs-theme="matrix"] .list-group-item-action { color: var(--gw-text) !important; }
    [data-bs-theme="matrix"] .form-text,
    [data-bs-theme="matrix"] .text-muted { color: #4db84d !important; text-shadow: none; }
    [data-bs-theme="matrix"] .modal-content {
      background: var(--gw-surface) !important;
      border: 1px solid var(--gw-primary) !important;
      box-shadow: 0 0 30px rgba(0,255,65,.2) !important;
      color: var(--gw-text) !important;
    }
    [data-bs-theme="matrix"] .modal-header {
      background: var(--gw-surface-variant) !important;
      border-bottom-color: var(--gw-border) !important;
      color: var(--gw-text) !important;
    }
    [data-bs-theme="matrix"] .modal-footer {
      background: var(--gw-surface-variant) !important;
      border-top-color: var(--gw-border) !important;
    }
    [data-bs-theme="matrix"] .modal-backdrop { background: rgba(0,0,0,.85) !important; }
    /* Rust logo is black — invert to white on dark backgrounds */
    [data-bs-theme="dark"] img[src*="langs/rust"],
    [data-bs-theme="matrix"] img[src*="langs/rust"] { filter: invert(1); }
    [data-bs-theme="matrix"] .list-group-item.active,
    [data-bs-theme="matrix"] .list-group-item-action.active {
      background: var(--gw-primary-container) !important;
      border-color: var(--gw-primary) !important;
      color: var(--gw-primary) !important;
      text-shadow: 0 0 8px rgba(0,255,65,.5);
    }
    [data-bs-theme="matrix"] .navbar {
      border-bottom: 1px solid var(--gw-border) !important;
      box-shadow: 0 0 20px rgba(0,255,65,.15) !important;
    }
    [data-bs-theme="matrix"] .card {
      box-shadow: 0 0 12px rgba(0,255,65,.08) !important;
    }
    [data-bs-theme="matrix"] .btn-primary {
      box-shadow: 0 0 10px rgba(0,255,65,.4) !important;
      text-shadow: none;
    }
    [data-bs-theme="matrix"] .btn-primary:hover {
      box-shadow: 0 0 18px rgba(0,255,65,.6) !important;
    }
    [data-bs-theme="matrix"] .form-control:focus,
    [data-bs-theme="matrix"] .form-select:focus {
      box-shadow: 0 0 0 3px rgba(0,255,65,.2), 0 0 12px rgba(0,255,65,.15) !important;
    }
    [data-bs-theme="matrix"] .navbar-brand,
    [data-bs-theme="matrix"] .nav-link {
      text-shadow: 0 0 8px rgba(0,255,65,.5) !important;
    }
    [data-bs-theme="matrix"] a:hover {
      text-shadow: 0 0 8px rgba(0,255,65,.6);
    }
    /* CRT scanline overlay */
    [data-bs-theme="matrix"] body::after {
      content: '';
      position: fixed;
      inset: 0;
      background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,.08) 2px,
        rgba(0,0,0,.08) 4px
      );
      pointer-events: none;
      z-index: 9999;
    }
    /* Matrix rain canvas */
    #gw-matrix-canvas {
      display: none;
      position: fixed;
      inset: 0;
      z-index: -1;
      opacity: .18;
    }
    [data-bs-theme="matrix"] #gw-matrix-canvas { display: block; }
    /* ── Theme toggle ───────────────────────────────────────────────────────── */
    #theme-toggle {
      background: none;
      border: 1px solid var(--gw-border);
      color: var(--gw-text);
      border-radius: 20px;
      padding: .3rem .55rem;
      cursor: pointer;
      line-height: 1;
      transition: background .15s, border-color .15s;
    }
    #theme-toggle:hover { background: var(--gw-tonal-bg); border-color: var(--gw-primary); color: var(--gw-primary); }
    .dropdown-toggle-no-caret::after { display: none !important; }
    /* ── Search dropdown ────────────────────────────────────────────────────── */
    .gw-search-dropdown {
      position: absolute;
      top: calc(100% + 4px);
      left: 0; right: 0;
      background: var(--gw-surface);
      border: 1px solid var(--gw-border);
      border-radius: 12px;
      box-shadow: var(--gw-elev3);
      z-index: 1060;
      overflow: hidden;
      display: none;
    }
    .gw-search-dropdown:not(:empty) { display: block; }
    .gw-suggest-section {
      padding: .35rem .85rem .15rem;
      font-size: .7rem;
      font-weight: 600;
      letter-spacing: .06em;
      text-transform: uppercase;
      color: var(--gw-muted);
    }
    .gw-suggest-item {
      display: flex;
      align-items: center;
      padding: .45rem .85rem;
      color: var(--gw-text);
      text-decoration: none;
      font-size: .875rem;
      gap: .25rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .gw-suggest-item:hover { background: var(--gw-tonal-bg); color: var(--gw-primary); text-decoration: none; }
    .gw-suggest-icon { color: var(--gw-muted); flex-shrink: 0; }
    .gw-suggest-sub { color: var(--gw-muted); font-size: .78rem; margin-left: .4rem; overflow: hidden; text-overflow: ellipsis; }
    .gw-suggest-all {
      display: flex; align-items: center;
      padding: .5rem .85rem;
      border-top: 1px solid var(--gw-border);
      font-size: .8rem;
      color: var(--gw-primary);
      text-decoration: none;
    }
    .gw-suggest-all:hover { background: var(--gw-tonal-bg); text-decoration: none; }
    .gw-suggest-empty { padding: .75rem .85rem; color: var(--gw-muted); font-size: .875rem; }
    /* ── Page-level spacing ─────────────────────────────────────────────────── */
    main { padding-top: .25rem; }
    /* ── Sticky footer ──────────────────────────────────────────────────────── */
    body { display: flex; flex-direction: column; min-height: 100vh; }
    body > main { flex: 1 0 auto; }
    .gw-footer { flex-shrink: 0; border-top: 1px solid var(--gw-border); padding: .6rem 1rem; font-size: .8rem; color: var(--gw-muted); }

/* ── Admin sidebar (from partials/admin-sidebar.html) ───────────────────── */
    #adminSidebar .group-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.35rem 0.75rem;
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: var(--gw-muted);
      cursor: pointer;
      user-select: none;
      border-radius: 6px;
      margin-top: 0.5rem;
      transition: background 0.15s;
    }
    #adminSidebar .group-header:hover { background: var(--gw-tonal-bg); }
    #adminSidebar .group-header .bi-chevron-down {
      transition: transform 0.2s;
      font-size: 0.75rem;
    }
    #adminSidebar .group-header.collapsed .bi-chevron-down { transform: rotate(-90deg); }
    #adminSidebar .list-group { margin-bottom: 0.25rem; }
    #adminSidebar .list-group-item {
      padding: 0.4rem 0.85rem;
      font-size: 0.88rem;
      border-radius: 6px !important;
      border: none;
      margin-bottom: 1px;
    }
    #adminSidebar .list-group-item-action { background: transparent; }
    #adminSidebar .list-group-item-action:hover { background: var(--gw-tonal-bg); }
    #adminSidebar .list-group-item.active {
      background: var(--gw-primary);
      color: var(--gw-on-primary);
    }

/* ── Repo settings sidebar (from partials/repo-settings-sidebar.html) ───── */
  #repoSettingsSidebar .list-group-item {
    padding: .4rem .85rem;
    font-size: .88rem;
    border-radius: 6px !important;
    border: none;
    margin-bottom: 1px;
  }
  #repoSettingsSidebar .list-group-item-action { background: transparent; }
  #repoSettingsSidebar .list-group-item-action:hover { background: var(--gw-tonal-bg); }
  #repoSettingsSidebar .list-group-item.active {
    background: var(--gw-primary);
    color: var(--gw-on-primary);
  }
  #repoSettingsSidebar .list-group-item.danger-item { color: var(--bs-danger); }
  #repoSettingsSidebar .list-group-item.danger-item:hover { background: var(--bs-danger-bg-subtle); }
  #repoSettingsSidebar .nav-section {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gw-muted);
    padding: .5rem .85rem .2rem;
  }
  /* Mobile picker is a plain <select> that navigates on change. */
  #repoSettingsMobilePicker { background: var(--gw-surface); border: 1px solid var(--gw-border); color: var(--gw-text); }

/* ── Commit / PR diff layout (file list sidebar) ────────────────────────────── */
.diff-layout { display: flex; gap: 1rem; align-items: flex-start; }
.diff-main { flex: 1 1 auto; min-width: 0; }            /* min-width:0 lets code blocks scroll, not overflow */
.diff-sidebar { flex: 0 0 260px; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
@media (max-width: 992px) {
  .diff-layout { flex-direction: column-reverse; }      /* file list above diffs on narrow screens */
  .diff-sidebar { flex-basis: auto; width: 100%; position: static; max-height: none; }
}
.diff-filelist { border: 1px solid var(--gw-border); border-radius: 8px; background: var(--gw-surface); overflow: hidden; }
.diff-filelist-head { border-bottom: 1px solid var(--gw-border); font-weight: 600; color: var(--gw-muted); }
.diff-filelist-item { color: var(--gw-text); text-decoration: none; border-bottom: 1px solid var(--gw-border); }
.diff-filelist-item:last-child { border-bottom: none; }
.diff-filelist-item:hover { background: var(--gw-tonal-bg); }
.diff-file-large > summary { cursor: pointer; list-style: none; }
.diff-file-large > summary::-webkit-details-marker { display: none; }
.diff-file-large[open] > summary .bi-chevron-right { transform: rotate(90deg); }
.diff-file-large > summary .bi-chevron-right { transition: transform .15s; display: inline-block; }
