/* ============================================================
   GitBol Main Stylesheet
   Clean version
============================================================ */

/* ============================================================
   01. Design Tokens
============================================================ */

:root {
    --bg: #0f172a;
    --bg-2: #172554;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --text: #0f172a;
    --text-soft: #64748b;
    --border: #e2e8f0;
    --accent: #7c3aed;
    --accent-dark: #5b21b6;
    --accent-soft: #ede9fe;
    --info-soft: #e0f2fe;
    --info-text: #0369a1;
    --warning-soft: #fff7ed;
    --warning-text: #9a3412;
    --danger: #dc2626;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    --shadow-soft: 0 14px 34px rgba(15, 23, 42, 0.10);
    --radius: 22px;
    --radius-sm: 14px;
}

/* ============================================================
   02. Global Base
============================================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.28), transparent 32rem),
        linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 42%, #111827 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    background: #020617;
    color: #e2e8f0;
}

code {
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
}

/* ============================================================
   03. App Shell
============================================================ */

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    padding: 28px;
    color: white;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.main {
    min-width: 0;
    padding: 34px;
    overflow-x: hidden;
}

/* ============================================================
   04. Brand + Main Navigation
============================================================ */

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 36px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    color: white;
    font-weight: 900;
    letter-spacing: -0.04em;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.brand-mark-image {
    padding: 0;
    background: transparent;
}

.brand-mark-image img {
    width: 48px;
    height: 48px;
    display: block;
    object-fit: contain;
}

.brand-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-subtitle {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
}

.nav {
    display: grid;
    gap: 10px;
}

.nav-link {
    padding: 13px 14px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.06);
    transition: 0.18s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.13);
    color: white;
}

.nav-link-active {
    background: rgba(124, 58, 237, 0.9);
    color: white;
}

/* ============================================================
   05. Topbar
============================================================ */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 28px;
    color: white;
}

.eyebrow {
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.topbar h1 {
    margin: 0;
    font-size: 34px;
    letter-spacing: -0.05em;
}

.user-pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================================
   06. Shared Panels
============================================================ */

.panel,
.repo-hero {
    max-width: 100%;
    min-width: 0;
    margin-bottom: 22px;
    padding: 26px;
    border: 1px solid rgba(226, 232, 240, 0.78);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.panel-header h2,
.repo-hero h2 {
    margin: 0;
    letter-spacing: -0.04em;
}

.panel-header p,
.repo-hero p {
    margin: 7px 0 0;
    color: var(--text-soft);
}

.narrow-panel {
    max-width: 860px;
}

/* ============================================================
   07. Buttons + Badges
============================================================ */

.button {
    border: 0;
    border-radius: 14px;
    padding: 11px 16px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.18s ease;
}

.button-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 12px 26px rgba(124, 58, 237, 0.28);
}

.button-primary:hover {
    background: var(--accent-dark);
}

.button-secondary {
    background: var(--panel-soft);
    color: var(--text);
    border: 1px solid var(--border);
}

.button-secondary:hover {
    background: #eef2ff;
}

.badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
}

.badge-soft {
    background: var(--info-soft);
    color: var(--info-text);
}

/* ============================================================
   08. Forms
============================================================ */

.form-card {
    display: grid;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    font-weight: 800;
    color: #1e293b;
}

.form-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    background: white;
    outline: none;
    transition: 0.18s ease;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.help-text {
    color: var(--text-soft);
    font-size: 13px;
}

.field-error,
.form-errors {
    color: var(--danger);
    font-size: 13px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

/* ============================================================
   09. Repository List
============================================================ */

.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

.repo-card {
    display: flex;
    flex-direction: column;
    min-height: 250px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    transition: 0.18s ease;
}

.repo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: #c4b5fd;
}

.repo-card-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.repo-card h3 {
    margin: 0;
    font-size: 18px;
}

.repo-card-top p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.repo-description {
    color: var(--text-soft);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 72px;
    max-height: 72px;
}

.repo-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 14px;
}

.repo-meta div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.repo-meta-label {
    color: var(--text-soft);
    font-size: 12px;
}

.repo-meta strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.repo-card-action {
    margin-top: 14px;
    color: var(--accent);
    font-weight: 900;
    font-size: 13px;
}

/* ============================================================
   10. Empty States
============================================================ */

.empty-state {
    text-align: center;
    padding: 56px 20px;
    background: var(--panel-soft);
    border: 1px dashed #cbd5e1;
    border-radius: 20px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 34px;
}

.empty-state h3 {
    margin-bottom: 8px;
}

.empty-state p,
.muted {
    color: var(--text-soft);
}

/* ============================================================
   11. Create Repository Page
============================================================ */

.create-repository-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: start;
    width: min(100%, 1680px);
    max-width: none;
}

.create-repository-layout > .panel {
    margin-bottom: 0;
}

.side-info-card {
    position: sticky;
    top: 28px;
    padding: 26px;
    border: 1px solid rgba(226, 232, 240, 0.78);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
    box-shadow: var(--shadow);
}

.side-info-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 30px;
    margin-bottom: 18px;
}

.side-info-card h3 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.04em;
}

.side-info-card p {
    color: var(--text-soft);
    line-height: 1.6;
    margin: 10px 0 20px;
}

.side-info-list {
    display: grid;
    gap: 14px;
}

.side-info-list div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
}

.side-info-list strong {
    display: block;
    margin-bottom: 4px;
}

.side-info-list span {
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.5;
}

.side-note {
    margin-top: 18px;
    padding: 14px;
    border-radius: 16px;
    background: var(--warning-soft);
    color: var(--warning-text);
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================================
   12. Repository Hero
============================================================ */

.repo-hero {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: flex-start;
}

.repo-path {
    color: var(--accent);
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 6px;
}

.repo-hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ============================================================
   13. Repository Detail Layout
============================================================ */

.repository-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(460px, 520px);
    gap: 28px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

.repository-main-column,
.repository-sidebar-column {
    min-width: 0;
    max-width: 100%;
}

.repository-sidebar-column {
    position: sticky;
    top: 28px;
}

.sidebar-panel {
    width: 100%;
    margin-bottom: 0;
    overflow: hidden;
}

.compact-panel-header {
    margin-bottom: 18px;
}

.compact-panel-header h2 {
    font-size: 22px;
}

.compact-panel-header p {
    margin: 6px 0 0;
}

/* ============================================================
   14. Repository Sidebar Navigation
   This is the part you were sketching:
   title + text + wide side-by-side buttons.
============================================================ */

.repo-navigation-panel {
    width: 100%;
}

.repo-nav-wide-link {
    padding: 14px 16px;
    color: var(--text);
    font-size: 18px;
}

/* ============================================================
   15. Clone + Command Blocks
============================================================ */

.clone-box,
.compact-clone-box {
    max-width: 100%;
    min-width: 0;
    background: #0f172a;
    color: white;
    border-radius: 16px;
}

.clone-box {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px;
    margin-bottom: 16px;
}

.clone-box code {
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
}

.compact-clone-box {
    display: grid;
    gap: 12px;
    padding: 14px;
    overflow: hidden;
}

.compact-clone-box code {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.6;
}

.compact-clone-box .button {
    width: 100%;
}

.command-block,
.mini-command-block {
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
}

.command-block {
    margin-top: 14px;
}

.mini-command-block {
    margin-top: 12px;
    border-radius: 16px;
}

.mini-command-block:first-of-type {
    margin-top: 0;
}

.command-title {
    padding: 12px 14px;
    background: var(--panel-soft);
    font-weight: 800;
    border-bottom: 1px solid var(--border);
}

.command-block pre,
.mini-command-block pre,
.file-content-box pre {
    max-width: 100%;
    overflow-x: auto;
}

.command-block code,
.mini-command-block code {
    display: block;
    width: max-content;
    min-width: 100%;
    font-size: 12px;
    line-height: 1.6;
}

/* ============================================================
   16. Repository Info
============================================================ */

.repo-info-list {
    display: grid;
    gap: 12px;
}

.repo-info-list div {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
}

.repo-info-list span {
    color: var(--text-soft);
    font-size: 13px;
}

.repo-info-list strong {
    text-align: right;
    font-size: 14px;
    overflow-wrap: anywhere;
}

/* ============================================================
   17. File List
============================================================ */

.file-list {
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: white;
}

.file-row {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.file-row:last-child {
    border-bottom: 0;
}

.file-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.file-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--panel-soft);
    font-size: 18px;
    flex: 0 0 auto;
}

.file-main strong {
    display: block;
    margin-bottom: 2px;
}

.file-main span {
    color: var(--text-soft);
    font-size: 13px;
}

.file-link {
    color: var(--text);
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    transition: 0.18s ease;
}

.file-link:hover {
    color: var(--accent);
}

.file-type-pill {
    flex: 0 0 auto;
    background: #e2e8f0;
    color: var(--text);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

/* ============================================================
   18. File Viewer
============================================================ */

.file-content-box {
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: #020617;
}

.file-content-box pre {
    margin: 0;
    min-height: 280px;
    max-height: 720px;
    overflow: auto;
}

.file-content-box code {
    display: block;
    white-space: pre;
    font-size: 14px;
    line-height: 1.7;
}

.no-preview-card {
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
    padding: 22px;
}

.no-preview-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 32px;
    flex: 0 0 auto;
}

.no-preview-card h3 {
    margin: 0 0 6px;
    letter-spacing: -0.03em;
}

.no-preview-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

/* ============================================================
   File Viewer Syntax Highlighting
============================================================ */

.file-content-box-highlighted {
    background: #020617;
}

.file-content-box-highlighted pre {
    padding: 0;
}

.file-content-box-highlighted code.gitbol-code-highlight {
    display: block;
    padding: 18px;
    color: #dbeafe;
    background: #020617;
    font-size: 14px;
    line-height: 1.7;
    tab-size: 4;
}

/* Pygments token colors - GitBol dark theme */

.gitbol-code-highlight .hll {
    background-color: rgba(124, 58, 237, 0.22);
}

/* Comments */
.gitbol-code-highlight .c,
.gitbol-code-highlight .ch,
.gitbol-code-highlight .cm,
.gitbol-code-highlight .c1,
.gitbol-code-highlight .cs {
    color: #64748b;
    font-style: italic;
}

/* Keywords */
.gitbol-code-highlight .k,
.gitbol-code-highlight .kc,
.gitbol-code-highlight .kd,
.gitbol-code-highlight .kn,
.gitbol-code-highlight .kp,
.gitbol-code-highlight .kr,
.gitbol-code-highlight .kt {
    color: #c084fc;
    font-weight: 800;
}

/* Operators / punctuation */
.gitbol-code-highlight .o,
.gitbol-code-highlight .ow {
    color: #93c5fd;
}

.gitbol-code-highlight .p {
    color: #94a3b8;
}

/* Names / variables */
.gitbol-code-highlight .n {
    color: #dbeafe;
}

.gitbol-code-highlight .na {
    color: #67e8f9;
}

.gitbol-code-highlight .nb,
.gitbol-code-highlight .bp {
    color: #f9a8d4;
}

.gitbol-code-highlight .nc {
    color: #facc15;
    font-weight: 800;
}

.gitbol-code-highlight .no {
    color: #fbbf24;
}

.gitbol-code-highlight .nd {
    color: #a78bfa;
    font-weight: 800;
}

.gitbol-code-highlight .ni,
.gitbol-code-highlight .ne {
    color: #fda4af;
}

.gitbol-code-highlight .nl {
    color: #93c5fd;
}

.gitbol-code-highlight .nn {
    color: #bae6fd;
}

.gitbol-code-highlight .nx,
.gitbol-code-highlight .py,
.gitbol-code-highlight .nv,
.gitbol-code-highlight .vc,
.gitbol-code-highlight .vg,
.gitbol-code-highlight .vi,
.gitbol-code-highlight .vm {
    color: #dbeafe;
}

/* Functions */
.gitbol-code-highlight .nf,
.gitbol-code-highlight .fm {
    color: #22d3ee;
    font-weight: 800;
}

/* HTML/XML tags */
.gitbol-code-highlight .nt {
    color: #f472b6;
    font-weight: 800;
}

/* HTML/XML attributes */
.gitbol-code-highlight .na {
    color: #67e8f9;
}

/* Strings */
.gitbol-code-highlight .s,
.gitbol-code-highlight .sa,
.gitbol-code-highlight .sb,
.gitbol-code-highlight .sc,
.gitbol-code-highlight .dl,
.gitbol-code-highlight .sd,
.gitbol-code-highlight .s2,
.gitbol-code-highlight .se,
.gitbol-code-highlight .sh,
.gitbol-code-highlight .si,
.gitbol-code-highlight .sx,
.gitbol-code-highlight .sr,
.gitbol-code-highlight .s1,
.gitbol-code-highlight .ss {
    color: #86efac;
}

/* Numbers */
.gitbol-code-highlight .m,
.gitbol-code-highlight .mb,
.gitbol-code-highlight .mf,
.gitbol-code-highlight .mh,
.gitbol-code-highlight .mi,
.gitbol-code-highlight .mo,
.gitbol-code-highlight .il {
    color: #fbbf24;
}

/* Built-in constants / JSON booleans */
.gitbol-code-highlight .kc {
    color: #fb7185;
    font-weight: 900;
}

/* Markdown headings / generic headings */
.gitbol-code-highlight .gh,
.gitbol-code-highlight .gu {
    color: #c4b5fd;
    font-weight: 900;
}

/* Markdown strong/emphasis */
.gitbol-code-highlight .gs {
    font-weight: 900;
    color: #f8fafc;
}

.gitbol-code-highlight .ge {
    font-style: italic;
    color: #bfdbfe;
}

/* Diff tokens */
.gitbol-code-highlight .gd {
    color: #fecaca;
    background: rgba(220, 38, 38, 0.18);
}

.gitbol-code-highlight .gi {
    color: #bbf7d0;
    background: rgba(22, 163, 74, 0.18);
}

/* Django/Jinja template tokens often appear as these */
.gitbol-code-highlight .cp,
.gitbol-code-highlight .cpf {
    color: #fbbf24;
    font-weight: 900;
}

.gitbol-code-highlight .nt + .o,
.gitbol-code-highlight .cp .k {
    color: #c084fc;
}

/* Errors / whitespace */
.gitbol-code-highlight .err {
    color: #fecaca;
    background: rgba(220, 38, 38, 0.22);
}

.gitbol-code-highlight .w {
    color: #475569;
}


/* ============================================================
   Markdown CodeHilite Syntax Highlighting
============================================================ */

.readme-rendered-box .gitbol-markdown-code,
.docs-rendered-box .gitbol-markdown-code,
.gitbol-markdown-code {
    position: relative;
    margin: 16px 0;
    border-radius: 16px;
    background: #020617;
    overflow: auto;
}

.readme-rendered-box .gitbol-markdown-code pre,
.docs-rendered-box .gitbol-markdown-code pre,
.gitbol-markdown-code pre {
    margin: 0;
    padding: 18px;
    background: #020617;
    color: #dbeafe;
    overflow: auto;
}

.readme-rendered-box .gitbol-markdown-code code,
.docs-rendered-box .gitbol-markdown-code code,
.gitbol-markdown-code code {
    display: block;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #dbeafe;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre;
}

/* Reuse Pygments token colors for Markdown-rendered blocks */

.gitbol-markdown-code .hll { background-color: rgba(124, 58, 237, 0.22); }

.gitbol-markdown-code .c,
.gitbol-markdown-code .ch,
.gitbol-markdown-code .cm,
.gitbol-markdown-code .c1,
.gitbol-markdown-code .cs {
    color: #64748b;
    font-style: italic;
}

.gitbol-markdown-code .k,
.gitbol-markdown-code .kc,
.gitbol-markdown-code .kd,
.gitbol-markdown-code .kn,
.gitbol-markdown-code .kp,
.gitbol-markdown-code .kr,
.gitbol-markdown-code .kt {
    color: #c084fc;
    font-weight: 800;
}

.gitbol-markdown-code .o,
.gitbol-markdown-code .ow {
    color: #93c5fd;
}

.gitbol-markdown-code .p {
    color: #94a3b8;
}

.gitbol-markdown-code .n {
    color: #dbeafe;
}

.gitbol-markdown-code .na {
    color: #67e8f9;
}

.gitbol-markdown-code .nb,
.gitbol-markdown-code .bp {
    color: #f9a8d4;
}

.gitbol-markdown-code .nc {
    color: #facc15;
    font-weight: 800;
}

.gitbol-markdown-code .nf,
.gitbol-markdown-code .fm {
    color: #22d3ee;
    font-weight: 800;
}

.gitbol-markdown-code .nt {
    color: #f472b6;
    font-weight: 800;
}

.gitbol-markdown-code .s,
.gitbol-markdown-code .sa,
.gitbol-markdown-code .sb,
.gitbol-markdown-code .sc,
.gitbol-markdown-code .dl,
.gitbol-markdown-code .sd,
.gitbol-markdown-code .s2,
.gitbol-markdown-code .se,
.gitbol-markdown-code .sh,
.gitbol-markdown-code .si,
.gitbol-markdown-code .sx,
.gitbol-markdown-code .sr,
.gitbol-markdown-code .s1,
.gitbol-markdown-code .ss {
    color: #86efac;
}

.gitbol-markdown-code .m,
.gitbol-markdown-code .mb,
.gitbol-markdown-code .mf,
.gitbol-markdown-code .mh,
.gitbol-markdown-code .mi,
.gitbol-markdown-code .mo,
.gitbol-markdown-code .il {
    color: #fbbf24;
}

.gitbol-markdown-code .gh,
.gitbol-markdown-code .gu {
    color: #c4b5fd;
    font-weight: 900;
}

.gitbol-markdown-code .gs {
    font-weight: 900;
    color: #f8fafc;
}

.gitbol-markdown-code .ge {
    font-style: italic;
    color: #bfdbfe;
}

.gitbol-markdown-code .gd {
    color: #fecaca;
    background: rgba(220, 38, 38, 0.18);
}

.gitbol-markdown-code .gi {
    color: #bbf7d0;
    background: rgba(22, 163, 74, 0.18);
}

.gitbol-markdown-code .cp,
.gitbol-markdown-code .cpf {
    color: #fbbf24;
    font-weight: 900;
}

.gitbol-markdown-code .err {
    color: #fecaca;
    background: rgba(220, 38, 38, 0.22);
}

.gitbol-markdown-code .w {
    color: #475569;
}

/* ============================================================
   19. Repository Status + Commits
============================================================ */

.latest-commit-card,
.empty-repo-card {
    margin-top: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
    padding: 18px;
}

.commit-label {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.latest-commit-card h3,
.empty-repo-card h3 {
    margin: 0;
    color: var(--text);
    letter-spacing: -0.03em;
}

.latest-commit-card p,
.empty-repo-card p {
    color: var(--text-soft);
    margin: 8px 0 0;
}

.latest-commit-card code {
    background: #e2e8f0;
    padding: 3px 7px;
    border-radius: 8px;
    color: var(--text);
    font-weight: 800;
}

.commit-list {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: white;
}

.commit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.commit-row:last-child {
    border-bottom: 0;
}

.commit-main {
    min-width: 0;
}

.commit-main h3 {
    margin: 0;
    font-size: 16px;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.commit-main p {
    margin: 5px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.commit-row code {
    background: #e2e8f0;
    color: var(--text);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

/* ============================================================
   20. Stats Cards
============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.stat-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.stat-card span {
    display: block;
    color: var(--text-soft);
    font-size: 13px;
    margin-bottom: 6px;
}

.stat-card strong {
    font-size: 18px;
}

/* ============================================================
   21. Responsive
============================================================ */

@media (max-width: 1450px) {
    .repository-page-layout {
        grid-template-columns: 1fr;
    }

    .repository-sidebar-column {
        position: static;
    }

    .repo-navigation-panel {
        padding: 30px;
    }

    .repo-nav-wide-link {
        min-height: 72px;
        font-size: 18px;
    }
}

@media (max-width: 1200px) {
    .create-repository-layout {
        grid-template-columns: 1fr;
    }

    .side-info-card {
        position: static;
    }

    .repo-card {
        min-height: auto;
    }
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .main {
        padding: 20px;
    }

    .topbar,
        .panel-header,
        .repo-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .form-row,
        .stats-grid {
        grid-template-columns: 1fr;
    }

    .compact-clone-box code,
        .mini-command-block code,
        .command-block code {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        word-break: break-word;
        width: auto;
        min-width: 0;
    }

    .compact-clone-box {
        overflow: visible;
    }

    .repo-nav-wide {
        gap: 16px;
    }

    .repo-navigation-panel {
        padding: 28px;
    }
}

@media (max-width: 520px) {
    .topbar h1 {
        font-size: 28px;
    }

    .panel,
        .repo-hero {
        padding: 20px;
    }

    .repo-nav-wide-link {
        min-height: 58px;
    }

    .no-preview-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Repository sidebar panels */

.repository-sidebar-column {
    display: grid;
    gap: 18px;
}

/* Navigation is its own panel */

.repo-navigation-panel {
    padding: 26px;
}

.repo-nav-wide {
    display: grid;
    gap: 12px;
    width: 100%;
}

.repo-nav-wide-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
    font-weight: 900;
    transition: 0.18s ease;
}

.repo-nav-wide-link:hover {
    color: var(--accent);
    border-color: #c4b5fd;
    background: #faf5ff;
}

.repo-nav-wide-link-active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.25);
}

.repo-nav-wide-link-active:hover {
    background: var(--accent-dark);
    color: white;
}

@media (max-width: 520px) {
    .repo-nav-wide {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Commit Detail Page
============================================================ */

.commit-title-link {
    color: var(--text);
    transition: 0.18s ease;
}

.commit-title-link:hover {
    color: var(--accent);
}

.commit-hash-link {
    background: #e2e8f0;
    color: var(--text);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    transition: 0.18s ease;
}

.commit-hash-link:hover {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.commit-detail-grid {
    display: grid;
    gap: 12px;
}

.commit-detail-grid div {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
}

.commit-detail-grid span {
    color: var(--text-soft);
    font-size: 13px;
}

.commit-detail-grid strong,
.commit-detail-grid code {
    min-width: 0;
    overflow-wrap: anywhere;
}

.commit-detail-grid code {
    font-weight: 800;
}

.changed-file-list {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: white;
}

.changed-file-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.changed-file-row:last-child {
    border-bottom: 0;
}

.change-status {
    width: 86px;
    flex: 0 0 auto;
    text-align: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 900;
    background: #e2e8f0;
    color: var(--text);
}

.change-status-a {
    background: #dcfce7;
    color: #166534;
}

.change-status-m {
    background: #dbeafe;
    color: #1d4ed8;
}

.change-status-d {
    background: #fee2e2;
    color: #991b1b;
}

.change-status-r {
    background: #fef3c7;
    color: #92400e;
}

.changed-file-path {
    min-width: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .commit-detail-grid div {
        grid-template-columns: 1fr;
    }

    .changed-file-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .change-status {
        width: auto;
    }
}

/* ============================================================
   Commit Diff Preview
============================================================ */

/* ============================================================
   Commit Detail Layout Cleanup
============================================================ */

.commit-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: 24px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

.commit-detail-main,
.commit-detail-sidebar {
    min-width: 0;
    max-width: 100%;
}

.commit-detail-sidebar {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 28px;
}

.commit-full-hash-box {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
    padding: 14px;
}

.commit-full-hash-box code {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-weight: 800;
    line-height: 1.6;
}

.diff-box {
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: #020617;
}

.diff-box pre {
    margin: 0;
    max-height: 760px;
    max-width: 100%;
    overflow: auto;
}

.diff-box code {
    display: block;
    width: max-content;
    min-width: 100%;
    white-space: pre;
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 1450px) {
    .commit-detail-layout {
        grid-template-columns: 1fr;
    }

    .commit-detail-sidebar {
        position: static;
    }
}

@media (max-width: 900px) {
    .diff-box code {
        width: auto;
        min-width: 0;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* ============================================================
   Styled Commit Diff
============================================================ */

.styled-diff-box {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: auto;
    background: #020617;
    max-height: 780px;
}

.diff-line {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    min-width: max-content;
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.55;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.diff-line:last-child {
    border-bottom: 0;
}

.diff-line-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.9);
    border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.diff-line code {
    display: block;
    white-space: pre;
    padding: 3px 12px;
    color: #e2e8f0;
}

.diff-line-file code {
    color: #bfdbfe;
    font-weight: 900;
    background: rgba(30, 64, 175, 0.24);
}

.diff-line-meta code {
    color: #94a3b8;
}

.diff-line-hunk code {
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.18);
    font-weight: 900;
}

.diff-line-added {
    background: rgba(22, 163, 74, 0.16);
}

.diff-line-added .diff-line-marker {
    color: #86efac;
    background: rgba(22, 101, 52, 0.45);
}

.diff-line-added code {
    color: #dcfce7;
}

.diff-line-removed {
    background: rgba(220, 38, 38, 0.16);
}

.diff-line-removed .diff-line-marker {
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.45);
}

.diff-line-removed code {
    color: #fee2e2;
}

@media (max-width: 900px) {
    .styled-diff-box {
        max-width: 100%;
    }

    .diff-line {
        min-width: 0;
    }

    .diff-line code {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* ============================================================
   Binary Diff Lines
============================================================ */

.diff-line-binary {
    background: rgba(245, 158, 11, 0.14);
}

.diff-line-binary .diff-line-marker {
    color: #fbbf24;
    background: rgba(120, 53, 15, 0.45);
}

.diff-line-binary code {
    color: #fde68a;
    font-weight: 800;
}

/* ============================================================
   Grouped Commit Diff
============================================================ */

.diff-group-list {
    display: grid;
    gap: 18px;
}

.diff-file-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: white;
}

.diff-file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: var(--panel-soft);
    border-bottom: 1px solid var(--border);
}

.diff-file-header strong {
    display: block;
    overflow-wrap: anywhere;
}

.diff-file-header span {
    display: inline-flex;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 13px;
}

.diff-file-card .styled-diff-box {
    border: 0;
    border-radius: 0;
    max-height: 520px;
}

/* ============================================================
   Branches Page
============================================================ */

.repo-nav-wide {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.branch-list {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: white;
}

.branch-row {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.branch-row:last-child {
    border-bottom: 0;
}

.branch-main h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    letter-spacing: -0.02em;
}

.branch-main p {
    margin: 8px 0 4px;
    color: var(--text-soft);
}

.branch-main code {
    background: #e2e8f0;
    padding: 3px 7px;
    border-radius: 8px;
    color: var(--text);
    font-weight: 800;
}

.branch-main span {
    color: var(--text-soft);
    font-size: 13px;
}

.branch-default-pill {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark) !important;
    font-size: 11px !important;
    font-weight: 900;
    text-transform: uppercase;
}

/* ============================================================
   Branch Selector
============================================================ */

@media (max-width: 700px) {
    .branch-selector-form {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .branch-selector {
        width: 100%;
    }
}

/* ============================================================
   Branch Selector Polish
============================================================ */

.branch-selector-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.branch-selector-form label {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 900;
}

.branch-selector {
    min-width: 180px;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #c4b5fd;
    border-radius: 999px;
    padding: 10px 42px 10px 16px;
    background: linear-gradient(135deg, #ffffff, #f8fafc),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    color: var(--text);
    font-weight: 900;
    outline: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.10);
}

.branch-selector:hover {
    border-color: var(--accent);
}

.branch-selector:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.16);
}

/* ============================================================
   Branch Ahead / Behind
============================================================ */

.branch-compare-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.branch-compare-meta span {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 800;
}

/* Branch links */

.branch-name-link {
    color: var(--text);
    transition: 0.18s ease;
}

.branch-name-link:hover {
    color: var(--accent);
}

/* ============================================================
   Repository Settings Form Cleanup
============================================================ */

.settings-field-note {
    min-height: 18px;
}

.repository-settings-row {
    align-items: start;
}

/* ============================================================
   Repository Page Navigation Panel
============================================================ */

.repo-page-nav-panel {
    padding: 14px;
}

.repo-page-nav-panel .repo-nav-wide {
    gap: 10px;
}

.repo-page-nav-panel .repo-nav-wide-link {
    min-height: 50px;
    font-size: 15px;
}

/* ============================================================
   Repository Search
============================================================ */

.repository-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    margin-bottom: 20px;
}

.repository-search-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    background: white;
    color: var(--text);
    outline: none;
    transition: 0.18s ease;
}

.repository-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

@media (max-width: 700px) {
    .repository-search-form {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Repository Sorting
============================================================ */

.repository-sort-select {
    min-width: 150px;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 42px 12px 14px;
    background: linear-gradient(135deg, #ffffff, #f8fafc),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    color: var(--text);
    font-weight: 800;
    outline: none;
    cursor: pointer;
    transition: 0.18s ease;
}

.repository-sort-select:hover {
    border-color: #c4b5fd;
}

.repository-sort-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

/* ============================================================
   Repository List Stats
============================================================ */

.repository-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.repository-stat-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.repository-stat-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

.repository-stat-card strong {
    font-size: 26px;
    letter-spacing: -0.04em;
}

@media (max-width: 900px) {
    .repository-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .repository-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Repository Visibility Filter Tabs
============================================================ */

.repository-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.repository-filter-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--text);
    font-weight: 900;
    transition: 0.18s ease;
}

.repository-filter-tab:hover {
    border-color: #c4b5fd;
    color: var(--accent);
    background: #faf5ff;
}

.repository-filter-tab-active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.22);
}

.repository-filter-tab-active:hover {
    background: var(--accent-dark);
    color: white;
}

/* ============================================================
   README Preview
============================================================ */

.readme-preview-box {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: #020617;
}

.readme-preview-box pre {
    margin: 0;
    max-height: 520px;
    overflow: auto;
}

.readme-preview-box code {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding: 18px;
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.7;
}

/* ============================================================
   Rendered README Markdown
============================================================ */

.readme-rendered-box {
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fbff 0%, #f8fafc 100%);
    padding: 26px;
    color: var(--text);
    line-height: 1.75;
    overflow-wrap: anywhere;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.readme-rendered-box p,
.readme-rendered-box li {
    color: #334155;
}

.readme-rendered-box h1,
.readme-rendered-box h2,
.readme-rendered-box h3 {
    color: #0f172a;
}

.readme-rendered-box > *:first-child {
    margin-top: 0;
}

.readme-rendered-box > *:last-child {
    margin-bottom: 0;
}

.readme-rendered-box h1,
.readme-rendered-box h2,
.readme-rendered-box h3 {
    letter-spacing: -0.04em;
    line-height: 1.25;
}

.readme-rendered-box h1 {
    font-size: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.readme-rendered-box h2 {
    font-size: 24px;
    margin-top: 28px;
}

.readme-rendered-box h3 {
    font-size: 19px;
    margin-top: 24px;
}

.readme-rendered-box p {
    color: #334155;
}

.readme-rendered-box a {
    color: var(--accent);
    font-weight: 800;
}

.readme-rendered-box code {
    background: #e2e8f0;
    color: var(--text);
    border-radius: 7px;
    padding: 2px 6px;
    font-size: 0.92em;
}

.readme-rendered-box pre {
    border-radius: 16px;
    padding: 16px;
    background: #020617;
    overflow-x: auto;
}

.readme-rendered-box pre code {
    background: transparent;
    color: #e2e8f0;
    padding: 0;
}

.readme-rendered-box blockquote {
    margin-left: 0;
    padding: 12px 16px;
    border-left: 4px solid var(--accent);
    background: var(--panel-soft);
    color: var(--text-soft);
}

.readme-rendered-box table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    overflow: hidden;
}

.readme-rendered-box th,
.readme-rendered-box td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
}

.readme-rendered-box th {
    background: var(--panel-soft);
}

/* ============================================================
   File Viewer Actions
============================================================ */

.file-viewer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ============================================================
   Image File Preview
============================================================ */

.image-preview-box {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f8fafc 75%),
        linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
    background-color: white;
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    padding: 18px;
    text-align: center;
    overflow: auto;
}

.image-preview-box img {
    max-width: 100%;
    max-height: 760px;
    border-radius: 14px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
}

/* ============================================================
   Repository Path Breadcrumbs
============================================================ */

.repo-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.repo-breadcrumbs a {
    color: var(--accent);
    transition: 0.18s ease;
}

.repo-breadcrumbs a:hover {
    color: var(--accent-dark);
}

.repo-breadcrumbs span {
    color: var(--text-soft);
}

.repo-breadcrumbs strong {
    color: var(--text);
    font-weight: 900;
}

/* ============================================================
   Commit Full Hash Copy Box
============================================================ */

.commit-full-hash-box {
    display: grid;
    gap: 12px;
}

.commit-full-hash-box .button {
    width: 100%;
}

/* ============================================================
   Branch Delete Button
============================================================ */

.branch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.branch-main {
    min-width: 0;
}

.branch-delete-form {
    flex: 0 0 auto;
}

@media (max-width: 700px) {
    .branch-row {
        align-items: stretch;
        flex-direction: column;
    }

    .branch-delete-form .button {
        width: 100%;
    }
}

/* ============================================================
   Flash Messages
============================================================ */

.message-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.message-card {
    border-radius: 16px;
    padding: 14px 16px;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}

.message-success {
    border: 1px solid #bbf7d0;
    background: #dcfce7;
    color: #166534;
}

.message-error {
    border: 1px solid #fecaca;
    background: #fee2e2;
    color: #991b1b;
}

.message-warning {
    border: 1px solid #fed7aa;
    background: #ffedd5;
    color: #9a3412;
}

.message-info {
    border: 1px solid #bfdbfe;
    background: #dbeafe;
    color: #1d4ed8;
}

/* ============================================================
   File Size Metadata
============================================================ */

.file-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.file-size-pill {
    background: var(--panel-soft);
    color: var(--text-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .file-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .file-row-meta {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ============================================================
   File Row Latest Commit
============================================================ */

.file-latest-commit {
    display: block;
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 12px;
    max-width: 520px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: 0.18s ease;
}

.file-latest-commit:hover {
    color: var(--accent);
}

/* ============================================================
   Repository Danger Zone / Archive Flow
============================================================ */

.danger-zone-panel {
    border-color: #fecaca;
}

.danger-zone-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 18px;
    border: 1px solid #fecaca;
    border-radius: 18px;
    background: #fff7f7;
}

.danger-zone-card h3 {
    margin: 0;
    color: #991b1b;
    letter-spacing: -0.03em;
}

.danger-zone-card p {
    margin: 8px 0 0;
    color: #7f1d1d;
    line-height: 1.6;
}

.button-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.button-danger:hover {
    background: #fecaca;
}

.archive-confirm-panel {
    max-width: 820px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.archive-warning-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: #fee2e2;
    color: #991b1b;
    font-size: 38px;
    font-weight: 900;
}

.archive-confirm-panel h2 {
    margin: 0;
    letter-spacing: -0.04em;
}

.archive-confirm-panel > p {
    max-width: 640px;
    margin: 12px auto 24px;
    color: var(--text-soft);
    line-height: 1.7;
}

.archive-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 24px 0;
    text-align: left;
}

.archive-facts div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.archive-facts strong {
    display: block;
    margin-bottom: 6px;
}

.archive-facts span {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
}

.archive-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

@media (max-width: 900px) {
    .danger-zone-card {
        align-items: stretch;
        flex-direction: column;
    }

    .danger-zone-card .button {
        width: 100%;
    }

    .archive-facts {
        grid-template-columns: 1fr;
    }

    .archive-actions {
        flex-direction: column;
    }

    .archive-actions .button {
        width: 100%;
    }
}

.settings-main-column {
    display: grid;
    gap: 22px;
}

/* ============================================================
   Archived Repositories
============================================================ */

.panel-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge-archived {
    background: #ffedd5;
    color: #9a3412;
}

.archived-repo-card {
    border-color: #fed7aa;
    background: linear-gradient(180deg, #ffffff, #fff7ed);
}

.repo-restore-form {
    margin-top: 14px;
}

.repo-restore-form .button {
    width: 100%;
}

@media (max-width: 700px) {
    .panel-header-actions {
        width: 100%;
    }

    .panel-header-actions .button {
        width: 100%;
    }
}

/* ============================================================
   Repository Rename Flow
============================================================ */

.settings-action-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.settings-action-card h3 {
    margin: 0;
    letter-spacing: -0.03em;
}

.settings-action-card p {
    margin: 8px 0 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.rename-warning-card {
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: #fff7ed;
    padding: 18px;
}

.rename-warning-card h3 {
    margin: 0;
    color: #9a3412;
    letter-spacing: -0.03em;
}

.rename-warning-card p {
    margin: 8px 0 14px;
    color: #9a3412;
    line-height: 1.6;
}

.rename-warning-card pre {
    border-radius: 14px;
}

@media (max-width: 900px) {
    .settings-action-card {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-action-card .button {
        width: 100%;
    }
}

/* ============================================================
   Branch Compare Page
============================================================ */

.compare-branch-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 16px;
    align-items: end;
}

.compare-branch-actions {
    display: flex;
    align-items: end;
}

.compare-branch-actions .button {
    min-height: 46px;
}

.compare-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.compare-summary-grid div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.compare-summary-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

.compare-summary-grid strong {
    font-size: 28px;
    letter-spacing: -0.04em;
}

@media (max-width: 900px) {
    .compare-branch-form,
        .compare-summary-grid {
        grid-template-columns: 1fr;
    }

    .compare-branch-actions .button {
        width: 100%;
    }
}

/* ============================================================
   Merge Requests
============================================================ */

.merge-request-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.merge-request-list {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: white;
}

.merge-request-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transition: 0.18s ease;
}

.merge-request-row:last-child {
    border-bottom: 0;
}

.merge-request-row:hover {
    background: var(--panel-soft);
}

.merge-request-row h3 {
    margin: 0;
    color: var(--text);
    letter-spacing: -0.03em;
}

.merge-request-row p {
    margin: 7px 0 0;
    color: var(--text-soft);
    line-height: 1.5;
}

.merge-request-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.merge-request-status-open {
    background: #dcfce7;
    color: #166534;
}

.merge-request-status-closed {
    background: #fee2e2;
    color: #991b1b;
}

.merge-request-status-merged {
    background: #ede9fe;
    color: #5b21b6;
}

.merge-request-description {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
    padding: 18px;
    color: var(--text);
    line-height: 1.7;
}

.merge-request-description > *:first-child {
    margin-top: 0;
}

.merge-request-description > *:last-child {
    margin-bottom: 0;
}

.merge-request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

@media (max-width: 700px) {
    .merge-request-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .merge-request-actions .button,
        .merge-request-actions form {
        width: 100%;
    }
}

/* ============================================================
   Merge Request Mergeability Check
============================================================ */

.merge-check-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.merge-check-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 16px;
    letter-spacing: -0.03em;
}

.merge-check-card p {
    margin: 0;
    line-height: 1.6;
}

.merge-check-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.merge-check-ready {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.merge-check-ready strong,
.merge-check-ready span {
    color: #166534;
}

.merge-check-ready span {
    background: #dcfce7;
}

.merge-check-conflict {
    background: #fff7ed;
    border-color: #fed7aa;
}

.merge-check-conflict strong,
.merge-check-conflict span {
    color: #9a3412;
}

.merge-check-conflict span {
    background: #ffedd5;
}

.merge-check-empty,
.merge-check-blocked {
    background: #f8fafc;
    border-color: var(--border);
}

.merge-check-empty strong,
.merge-check-empty span,
.merge-check-blocked strong,
.merge-check-blocked span {
    color: #475569;
}

.merge-check-empty span,
.merge-check-blocked span {
    background: #e2e8f0;
}

@media (max-width: 700px) {
    .merge-check-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ============================================================
   Merge Request Merge Action
============================================================ */

.merge-request-merged-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #c4b5fd;
    border-radius: 18px;
    background: #f5f3ff;
}

.merge-request-merged-note strong {
    color: #5b21b6;
}

.merge-request-merged-note span {
    color: #6d28d9;
    font-weight: 800;
}

/* ============================================================
   Merge Request Source Branch Cleanup
============================================================ */

.merge-source-branch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: #fff7ed;
}

.merge-source-branch-card strong {
    color: #9a3412;
}

.merge-source-branch-card p {
    margin: 6px 0 0;
    color: #9a3412;
    line-height: 1.6;
}

.merge-source-branch-card form {
    flex: 0 0 auto;
}

@media (max-width: 700px) {
    .merge-source-branch-card {
        align-items: stretch;
        flex-direction: column;
    }

    .merge-source-branch-card .button,
        .merge-source-branch-card form {
        width: 100%;
    }
}

.merge-source-branch-deleted {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.merge-source-branch-deleted strong,
.merge-source-branch-deleted p {
    color: #475569;
}

.merge-source-branch-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ============================================================
   Merge Request Conflict Files
============================================================ */

.merge-conflict-files-card {
    display: grid;
    gap: 14px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: #fff7ed;
}

.merge-conflict-files-card strong {
    color: #9a3412;
}

.merge-conflict-files-card p {
    margin: 6px 0 0;
    color: #9a3412;
    line-height: 1.6;
}

.merge-conflict-file-list {
    display: grid;
    gap: 8px;
}

.merge-conflict-file-list code {
    display: block;
    padding: 10px 12px;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    background: #ffffff;
    color: #7c2d12;
    font-weight: 900;
    overflow-wrap: anywhere;
}

/* ============================================================
   Merge Request Merged Commit Link
============================================================ */

.merge-commit-link-line {
    margin-top: 10px !important;
}

.merge-commit-link-line a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 900;
    transition: 0.18s ease;
}

.merge-commit-link-line a:hover {
    filter: brightness(0.96);
}

/* ============================================================
   Duplicate Merge Request Warning
============================================================ */

.duplicate-merge-request-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: #fff7ed;
}

.duplicate-merge-request-card strong {
    color: #9a3412;
}

.duplicate-merge-request-card p {
    margin: 6px 0 0;
    color: #9a3412;
    line-height: 1.6;
}

@media (max-width: 700px) {
    .duplicate-merge-request-card {
        align-items: stretch;
        flex-direction: column;
    }

    .duplicate-merge-request-card .button {
        width: 100%;
    }
}

/* ============================================================
   Merge Request Auto Delete Source Branch Option
============================================================ */

.merge-action-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.merge-delete-source-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-soft);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.merge-delete-source-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.merge-delete-source-option strong {
    color: var(--text);
}

@media (max-width: 700px) {
    .merge-action-form,
        .merge-action-form .button,
        .merge-delete-source-option {
        width: 100%;
    }

    .merge-delete-source-option {
        justify-content: flex-start;
    }
}

/* ============================================================
   Protected Branches
============================================================ */

.protected-branch-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
}

.protected-branch-list {
    display: grid;
    gap: 10px;
}

.protected-branch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
}

.protected-branch-row strong {
    display: block;
    letter-spacing: -0.03em;
}

.protected-branch-row p {
    margin: 5px 0 0;
    color: var(--text-soft);
    line-height: 1.5;
}

.branch-badge-protected {
    background: #ede9fe;
    color: #5b21b6;
}

@media (max-width: 700px) {
    .protected-branch-form,
        .protected-branch-row {
        grid-template-columns: 1fr;
    }

    .protected-branch-row {
        align-items: stretch;
        flex-direction: column;
    }

    .protected-branch-form .button,
        .protected-branch-row .button {
        width: 100%;
    }
}

/* ============================================================
   Merge Request Review / Approvals
============================================================ */

.merge-review-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.merge-review-card-approved {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.merge-review-card-required {
    border-color: #fed7aa;
    background: #fff7ed;
}

.merge-review-main {
    min-width: 0;
}

.merge-review-main > strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 16px;
    letter-spacing: -0.03em;
}

.merge-review-main p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.merge-review-card-approved .merge-review-main p,
.merge-review-card-approved .merge-review-main strong {
    color: #166534;
}

.merge-review-card-required .merge-review-main p,
.merge-review-card-required .merge-review-main strong {
    color: #9a3412;
}

.merge-approval-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.merge-approval-list span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 800;
}

.merge-review-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.merge-review-count,
.merge-review-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.merge-review-note {
    text-transform: none;
}

.merge-approval-blocked-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: #fff7ed;
}

.merge-approval-blocked-card strong {
    display: block;
    margin-bottom: 6px;
    color: #9a3412;
    letter-spacing: -0.03em;
}

.merge-approval-blocked-card p {
    margin: 0;
    color: #9a3412;
    line-height: 1.6;
}

.merge-approval-blocked-card > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: #ffedd5;
    color: #9a3412;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.merge-request-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.merge-request-review-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.merge-request-review-pill-approved {
    background: #dcfce7;
    color: #166534;
}

.merge-request-review-pill-required {
    background: #ffedd5;
    color: #9a3412;
}

@media (max-width: 700px) {
    .merge-review-card,
        .merge-approval-blocked-card {
        align-items: stretch;
        flex-direction: column;
    }

    .merge-review-actions,
        .merge-review-actions form,
        .merge-review-actions .button,
        .merge-approval-blocked-card > span {
        width: 100%;
    }

    .merge-review-actions {
        justify-content: stretch;
    }
}

/* ============================================================
   Repository Access Notes
============================================================ */

.repo-access-note {
    margin-top: 10px !important;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #eff6ff;
    color: #1d4ed8 !important;
    font-size: 13px;
    font-weight: 800;
}

/* ============================================================
   Repository Members + Roles
============================================================ */

.badge-role {
    background: #f1f5f9;
    color: #334155;
}

.repository-member-form {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.repository-member-list {
    display: grid;
    gap: 10px;
}

.repository-member-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
}

.repository-member-row strong {
    display: block;
    letter-spacing: -0.03em;
}

.repository-member-row p {
    margin: 6px 0 0;
    color: var(--text-soft);
    line-height: 1.5;
}

.repository-member-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.repository-member-role-form {
    display: flex;
    gap: 10px;
}

.member-role-select {
    min-width: 160px;
}

.repository-role-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.repository-role-viewer {
    background: #e2e8f0;
    color: #475569;
}

.repository-role-developer {
    background: #dbeafe;
    color: #1d4ed8;
}

.repository-role-maintainer {
    background: #ede9fe;
    color: #5b21b6;
}

@media (max-width: 900px) {
    .repository-member-row {
        align-items: stretch;
        flex-direction: column;
    }

    .repository-member-actions,
        .repository-member-role-form,
        .repository-member-actions form,
        .repository-member-actions .button,
        .repository-member-form .button {
        width: 100%;
    }

    .repository-member-role-form {
        flex-direction: column;
    }

    .member-role-select {
        width: 100%;
    }
}

/* ============================================================
   Accounts / Auth / Profile
============================================================ */

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: start;
}

.auth-panel {
    margin-bottom: 0;
}

.topbar-user-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.user-pill-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.user-pill img,
.user-pill span {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-dark);
    object-fit: cover;
    font-weight: 900;
}

.user-pill strong {
    font-size: 13px;
}

.topbar-logout-button {
    min-height: 42px;
}

.profile-hero-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-avatar-large {
    width: 86px;
    height: 86px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-dark);
    overflow: hidden;
    font-size: 34px;
    font-weight: 900;
    flex: 0 0 auto;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.profile-detail-grid div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.profile-detail-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

.profile-detail-grid strong {
    overflow-wrap: anywhere;
}

/* ============================================================
   Repository Member Identity
============================================================ */

.repository-member-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.repository-member-identity {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 900;
    flex: 0 0 auto;
}

.repository-member-identity img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.repository-member-profile > div:last-child {
    min-width: 0;
}

.repository-member-profile p {
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }

    .profile-detail-grid {
        grid-template-columns: 1fr;
    }

    .profile-hero-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-user-actions,
        .topbar-user-actions .button,
        .topbar-user-actions form {
        width: 100%;
    }

    .user-pill-link {
        width: 100%;
    }
}

/* ============================================================
   Profile Image Crop Controls
============================================================ */

.profile-crop-preview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.profile-crop-preview-card strong {
    display: block;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.profile-crop-preview-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.profile-crop-preview {
    width: 96px;
    height: 96px;
    border-radius: 30px;
    overflow: hidden;
    background: var(--accent-soft);
    flex: 0 0 auto;
}

.profile-crop-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   Members Form Layout Fix
============================================================ */

.repository-member-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px 136px;
    gap: 14px;
    align-items: start;
}

.repository-member-form .form-group {
    min-width: 0;
}

.repository-member-form .form-group label {
    display: block;
    min-height: 20px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.repository-member-form .form-control {
    min-height: 46px;
}

.repository-member-form .button {
    min-height: 46px;
    width: 100%;
    margin-top: 28px;
    white-space: nowrap;
}

.repository-member-row {
    align-items: center;
}

.repository-member-profile {
    flex: 1 1 auto;
}

.repository-member-actions {
    flex: 0 0 auto;
}

@media (max-width: 900px) {
    .repository-member-form {
        grid-template-columns: 1fr;
    }

    .repository-member-form .button {
        margin-top: 0;
    }
}

/* ============================================================
   JS Profile Cropper
============================================================ */

.avatar-bg {
    display: block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.avatar-bg-small {
    width: 30px;
    height: 30px;
    border-radius: 999px;
}

.avatar-bg-large {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.avatar-bg-member {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.profile-cropper-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel-soft);
}

.profile-cropper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.profile-cropper-header strong {
    display: block;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.profile-cropper-header p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.profile-cropper-frame {
    width: 220px;
    height: 220px;
    border-radius: 42px;
    overflow: hidden;
    background: #e2e8f0;
    cursor: grab;
    border: 3px solid white;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18),
        0 0 0 1px var(--border);
    touch-action: none;
    user-select: none;
}

.profile-cropper-frame-dragging {
    cursor: grabbing;
}

.profile-cropper-image {
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 130%;
}

.profile-cropper-controls {
    display: grid;
    gap: 14px;
}

.profile-cropper-controls input[type="range"] {
    accent-color: var(--accent);
    padding: 0;
}

@media (max-width: 700px) {
    .profile-cropper-header {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-cropper-header .button {
        width: 100%;
    }

    .profile-cropper-frame {
        width: 180px;
        height: 180px;
        border-radius: 34px;
    }
}

/* ============================================================
   Personal Access Tokens
============================================================ */

.token-created-panel h2 {
    color: #166534;
}

.token-copy-box {
    color: #e2e8f0;
}

.token-copy-box code {
    line-height: 1.6;
}

.token-create-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
}

.token-create-form .button {
    min-height: 46px;
}

.token-list {
    display: grid;
    gap: 10px;
}

.token-row strong {
    display: block;
    letter-spacing: -0.03em;
}

.token-row p {
    margin: 6px 0 10px;
    color: var(--text-soft);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.token-row code {
    padding: 3px 7px;
    border-radius: 8px;
    background: #e2e8f0;
    color: var(--text);
    font-weight: 900;
}

.token-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.token-status-active {
    background: #dcfce7;
    color: #166534;
}

.token-status-revoked {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 700px) {
    .token-copy-box,
        .token-create-form {
        grid-template-columns: 1fr;
    }

    .token-row {
        align-items: stretch;
        flex-direction: column;
    }

    .token-row .button,
        .token-row form,
        .token-create-form .button {
        width: 100%;
    }
}

/* ============================================================
   Django Project Intelligence
============================================================ */

.django-intelligence-panel {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.django-project-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.django-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.django-overview-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
}

.django-overview-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.django-overview-card strong {
    display: block;
    overflow-wrap: anywhere;
    letter-spacing: -0.03em;
}

.django-overview-card-ok {
    border-color: #bbf7d0;
}

.django-overview-card-warning {
    border-color: #fed7aa;
}

.django-overview-card-info {
    border-color: #bfdbfe;
}

.django-health-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.django-health-count {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: white;
}

.django-health-count span {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.django-health-count strong {
    font-size: 26px;
    letter-spacing: -0.04em;
}

.django-health-ok {
    border-color: #bbf7d0;
    color: #166534;
    background: #f0fdf4;
}

.django-health-info {
    border-color: #bfdbfe;
    color: #1d4ed8;
    background: #eff6ff;
}

.django-health-warning {
    border-color: #fed7aa;
    color: #9a3412;
    background: #fff7ed;
}

.django-health-danger {
    border-color: #fecaca;
    color: #991b1b;
    background: #fff1f2;
}

.django-health-list {
    display: grid;
    gap: 10px;
}

.django-health-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
}

.django-health-row strong {
    display: block;
    margin-bottom: 5px;
    letter-spacing: -0.03em;
}

.django-health-row p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.django-health-row code {
    display: inline-flex;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 8px;
    background: #e2e8f0;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.django-health-row > span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.django-health-row-ok {
    border-color: #bbf7d0;
}

.django-health-row-ok > span {
    background: #dcfce7;
    color: #166534;
}

.django-health-row-info {
    border-color: #bfdbfe;
}

.django-health-row-info > span {
    background: #dbeafe;
    color: #1d4ed8;
}

.django-health-row-warning {
    border-color: #fed7aa;
}

.django-health-row-warning > span {
    background: #ffedd5;
    color: #9a3412;
}

.django-health-row-danger {
    border-color: #fecaca;
    background: #fff1f2;
}

.django-health-row-danger > span {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================================
   Django Change Summary
============================================================ */

.django-change-panel {
    border-color: #ddd6fe;
    background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
}

.django-change-warning-list {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.django-change-warning {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
}

.django-change-warning strong {
    display: block;
    margin-bottom: 5px;
    letter-spacing: -0.03em;
}

.django-change-warning p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.django-change-warning-warning {
    border-color: #fed7aa;
    background: #fff7ed;
}

.django-change-warning-warning strong,
.django-change-warning-warning p {
    color: #9a3412;
}

.django-change-warning-danger {
    border-color: #fecaca;
    background: #fff1f2;
}

.django-change-warning-danger strong,
.django-change-warning-danger p {
    color: #991b1b;
}

.django-change-category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.django-change-category-grid div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
}

.django-change-category-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.django-change-category-grid strong {
    font-size: 26px;
    letter-spacing: -0.04em;
}

.django-classified-file-list {
    display: grid;
    gap: 8px;
}

.django-classified-file-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
}

.django-classified-file-row > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--panel-soft);
}

.django-classified-file-row strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    letter-spacing: -0.02em;
}

.django-classified-file-row code {
    display: block;
    color: var(--text-soft);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.django-classified-file-warning {
    border-color: #fed7aa;
}

.django-classified-file-danger {
    border-color: #fecaca;
    background: #fff1f2;
}

.django-classified-file-info {
    border-color: #bfdbfe;
}

@media (max-width: 1000px) {
    .django-overview-grid,
        .django-health-summary,
        .django-change-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 620px) {
    .django-overview-grid,
        .django-health-summary,
        .django-change-category-grid {
        grid-template-columns: 1fr;
    }

    .django-health-row {
        align-items: stretch;
        flex-direction: column;
    }

    .django-health-row > span {
        width: fit-content;
    }
}

/* ============================================================
   Django Intelligence Full Scanner Additions
============================================================ */

.django-mini-section {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
}

.django-mini-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.django-mini-section-header strong {
    display: block;
    letter-spacing: -0.03em;
}

.django-mini-section-header span {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.django-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.django-pill-list code {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
}

.django-size-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    background: #eff6ff;
}

.django-size-panel strong {
    display: block;
    margin-bottom: 6px;
    color: #1d4ed8;
    letter-spacing: -0.03em;
}

.django-size-panel p {
    margin: 0;
    color: #1d4ed8;
    line-height: 1.6;
}

.django-size-ok-pill,
.django-size-warning-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.django-size-ok-pill {
    background: #dcfce7;
    color: #166534;
}

.django-size-warning-pill {
    background: #ffedd5;
    color: #9a3412;
}

.django-big-file-list {
    display: grid;
    gap: 8px;
}

.django-big-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
}

.django-big-file-row strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    letter-spacing: -0.02em;
}

.django-big-file-row code {
    display: block;
    color: var(--text-soft);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.django-big-file-row > span {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .django-mini-section-header,
        .django-size-panel,
        .django-big-file-row {
        align-items: stretch;
        flex-direction: column;
    }

    .django-mini-section-header span,
        .django-size-ok-pill,
        .django-size-warning-pill,
        .django-big-file-row > span {
        width: fit-content;
    }
}

/* ============================================================
   Browser Upload + Web Commit
============================================================ */

.upload-warning-card {
    padding: 16px;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: #fff7ed;
}

.upload-warning-card h3 {
    margin: 0 0 6px;
    color: #9a3412;
    letter-spacing: -0.03em;
}

.upload-warning-card p {
    margin: 0;
    color: #9a3412;
    line-height: 1.6;
}

input[type="file"].form-control {
    padding: 11px;
    cursor: pointer;
}

input[type="file"].form-control::file-selector-button {
    margin-right: 12px;
    border: 0;
    border-radius: 12px;
    padding: 9px 12px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 900;
    cursor: pointer;
}

/* ============================================================
   Browser File Create / Edit / Delete
============================================================ */

.code-editor-textarea {
    min-height: 520px;
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.7;
    tab-size: 4;
    resize: vertical;
    white-space: pre;
    overflow: auto;
}

.delete-file-warning-card {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid #fecaca;
    border-radius: 18px;
    background: #fff1f2;
}

.delete-file-warning-card h3 {
    margin: 0;
    color: #991b1b;
    overflow-wrap: anywhere;
    letter-spacing: -0.03em;
}

.delete-file-warning-card p {
    margin: 8px 0 0;
    color: #7f1d1d;
    line-height: 1.6;
}

.empty-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

@media (max-width: 700px) {
    .empty-card-actions,
        .empty-card-actions .button {
        width: 100%;
    }

    .code-editor-textarea {
        min-height: 360px;
    }
}

/* ============================================================
   File Manager Polish
============================================================ */

.repo-files-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.file-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px 170px auto;
    gap: 10px;
    margin-bottom: 14px;
}

.file-filter-summary {
    margin-bottom: 14px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

.bulk-delete-list {
    display: grid;
    gap: 8px;
    max-height: 460px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.bulk-delete-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    cursor: pointer;
}

.bulk-delete-row:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
}

.bulk-delete-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--danger);
    flex: 0 0 auto;
}

.bulk-delete-row span {
    overflow-wrap: anywhere;
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 900px) {
    .repo-files-toolbar,
        .repo-files-toolbar .button,
        .repo-files-toolbar .branch-selector-form {
        width: 100%;
    }

    .file-filter-form {
        grid-template-columns: 1fr;
    }

    .file-filter-form .button {
        width: 100%;
    }
}

.bulk-delete-current-branch {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-soft);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

.bulk-delete-current-branch strong {
    color: var(--text);
}

/* ============================================================
   Commit Safety
============================================================ */

.commit-safety-note {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    font-weight: 900;
}

.changed-file-row-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.changed-file-row-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.button-small {
    min-height: 34px;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 12px;
}

.safety-action-list {
    display: grid;
    gap: 10px;
}

.safety-action-list span {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 800px) {
    .changed-file-row-actions,
        .changed-file-row-main {
        align-items: stretch;
        flex-direction: column;
    }

    .changed-file-row-actions .button {
        width: 100%;
    }
}

/* ============================================================
   Restore State
============================================================ */

.restore-state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.restore-state-current {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.restore-state-current a {
    color: #15803d;
    text-decoration: none;
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
}

.restore-state-current a:hover {
    text-decoration: underline;
}

/* ============================================================
   Error Pages
============================================================ */

.error-page-panel {
    max-width: 760px;
    margin: 0 auto;
    padding: 54px 28px;
    border: 1px solid rgba(226, 232, 240, 0.78);
    border-radius: var(--radius);
    background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.12), transparent 22rem),
        var(--panel);
    box-shadow: var(--shadow);
    text-align: center;
}

.error-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    min-height: 64px;
    margin-bottom: 18px;
    padding: 0 20px;
    border-radius: 22px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 34px;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.error-page-panel h2 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -0.05em;
}

.error-page-panel p {
    max-width: 520px;
    margin: 12px auto 0;
    color: var(--text-soft);
    line-height: 1.7;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

@media (max-width: 700px) {
    .error-page-panel {
        padding: 36px 20px;
    }

    .error-actions,
        .error-actions .button {
        width: 100%;
    }
}

/* ============================================================
   Personal Access Token Polish
============================================================ */

.token-created-panel {
    margin-bottom: 18px;
    border-color: #bbf7d0;
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.10), transparent 24rem),
        var(--panel);
}

.token-created-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.token-created-summary > div,
.token-meta-grid > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
}

.token-created-summary span,
.token-meta-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.token-created-summary strong,
.token-meta-grid strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.token-copy-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
    padding: 12px;
    border-radius: 18px;
    background: #020617;
}

.token-copy-box code {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow-x: auto;
    padding: 0 4px;
    color: #f8fafc;
    font-size: 13px;
    white-space: nowrap;
}

.token-usage-card {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #bbf7d0;
    border-radius: 18px;
    background: #f0fdf4;
}

.token-usage-card h3 {
    margin: 0;
    color: #166534;
}

.token-usage-card p {
    margin: 8px 0 12px;
    color: #166534;
}

.token-usage-card pre {
    margin: 0;
    overflow: auto;
}

/* Force PAT form to ignore older token-create-form grid rules */

form.token-create-form.token-create-form-polished,
.token-create-form-polished {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100%;
}

.token-create-form-polished .form-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 220px !important;
    gap: 16px !important;
    width: 100%;
    align-items: start;
}

.token-create-form-polished .form-group {
    min-width: 0;
    width: 100%;
}

.token-create-form-polished .form-group label {
    display: block;
    margin-bottom: 8px;
}

.token-create-form-polished .form-control {
    width: 100%;
    max-width: 100%;
}

.token-create-form-polished .help-text {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.token-scope-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100%;
}

.token-scope-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
    cursor: pointer;
}

.token-scope-card:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
}

.token-scope-card input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.token-scope-card span {
    min-width: 0;
}

.token-scope-card strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.token-scope-card small {
    display: block;
    margin-top: 4px;
    color: var(--text-soft);
    line-height: 1.5;
}

.token-create-form-polished > .button {
    width: min(100%, 420px);
}

.token-list-polished {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.token-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.token-row-revoked {
    opacity: 0.72;
}

.token-row-main {
    min-width: 0;
    flex: 1;
}

.token-row-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.token-row-title strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.token-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.token-scope-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.token-scope-pill-list span {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 950;
}

/* Medium screens */

@media (max-width: 1100px) {
    .token-scope-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Tablet / half-width window */

@media (max-width: 900px) {
    .token-created-summary,
        .token-meta-grid {
        grid-template-columns: 1fr 1fr;
    }

    .token-create-form-polished .form-row {
        grid-template-columns: 1fr !important;
    }

    .token-create-form-polished > .button {
        width: 100%;
    }
}

/* Small phones */

@media (max-width: 640px) {
    .token-created-summary,
        .token-meta-grid {
        grid-template-columns: 1fr;
    }

    .token-copy-box {
        grid-template-columns: 1fr;
    }

    .token-copy-box .button {
        width: 100%;
    }

    .token-row {
        flex-direction: column;
    }

    .token-row form,
        .token-row .button {
        width: 100%;
    }
}

.token-recent-header {
    margin-top: 22px;
}

.pagination-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.pagination-status {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 900;
}

@media (max-width: 640px) {
    .pagination-row,
        .pagination-row .button,
        .pagination-status {
        width: 100%;
    }

    .pagination-status {
        justify-content: center;
    }
}

/* ============================================================
   Docs / Wiki
============================================================ */

.docs-hero code {
    padding: 2px 6px;
    border-radius: 7px;
    background: #e2e8f0;
    color: var(--text);
    font-weight: 900;
}

.docs-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.docs-sidebar {
    position: sticky;
    top: 28px;
}

.docs-page-list {
    display: grid;
    gap: 8px;
}

.docs-page-link {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-soft);
    color: var(--text);
    font-weight: 900;
    line-height: 1.4;
    transition: 0.18s ease;
}

.docs-page-link:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
    color: var(--accent);
}

.docs-page-link-active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.22);
}

.docs-page-link-active:hover {
    background: var(--accent-dark);
    color: white;
}

.docs-content-panel {
    min-width: 0;
}

.docs-rendered-box {
    min-height: 360px;
}

.docs-rendered-box img {
    max-width: 100%;
    border-radius: 14px;
}

.docs-rendered-box pre {
    max-width: 100%;
    overflow-x: auto;
}

.docs-rendered-box pre code {
    white-space: pre;
}

@media (max-width: 1100px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
    }

    .docs-page-list {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 700px) {
    .docs-page-list {
        grid-template-columns: 1fr;
    }

    .docs-content-panel .panel-header,
    .docs-content-panel .panel-header .button {
        width: 100%;
    }

    .docs-rendered-box {
        padding: 18px;
    }

    .docs-rendered-box pre code {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* ============================================================
   Persian Docs Font + RTL
============================================================ */

@font-face {
    font-family: "IRANSansXFaNum";
    src: url("/static/fonts/IRANSansXFaNum-regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IRANSansXFaNum";
    src: url("/static/fonts/IRANSansXFaNum-bold.woff") format("woff");
    font-weight: 700 950;
    font-style: normal;
    font-display: swap;
}

.docs-layout-fa,
.docs-hero-fa,
.docs-sidebar-fa,
.docs-content-panel-fa,
.docs-rendered-box-fa {
    direction: rtl;
    text-align: right;
}

.docs-layout-fa,
.docs-rendered-box-fa,
.docs-sidebar-fa,
.docs-hero-fa {
    font-family: "IRANSansXFaNum", var(--font-sans);
}

.docs-layout-fa .repo-breadcrumbs,
.docs-hero-fa .repo-breadcrumbs {
    direction: ltr;
    justify-content: flex-end;
}

.docs-rendered-box-fa h1,
.docs-rendered-box-fa h2,
.docs-rendered-box-fa h3,
.docs-rendered-box-fa h4,
.docs-rendered-box-fa h5,
.docs-rendered-box-fa h6,
.docs-rendered-box-fa p,
.docs-rendered-box-fa li,
.docs-rendered-box-fa blockquote,
.docs-rendered-box-fa table {
    text-align: right;
}

.docs-rendered-box-fa ul,
.docs-rendered-box-fa ol {
    padding-right: 24px;
    padding-left: 0;
}

.docs-rendered-box-fa pre,
.docs-rendered-box-fa code {
    direction: ltr;
    text-align: left;
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
}

.docs-rendered-box-fa table {
    direction: rtl;
}

.docs-rendered-box-fa th,
.docs-rendered-box-fa td {
    text-align: right;
}

/* ============================================================
   Repository DB Docs / Wiki
============================================================ */

.repository-docs-layout .docs-page-link {
    justify-content: space-between;
    gap: 10px;
}

.repository-docs-layout .docs-page-link span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.repository-docs-layout .docs-page-link small {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #ffedd5;
    color: #9a3412;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
    flex: 0 0 auto;
}

.docs-published-field label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-soft);
    cursor: pointer;
}

.docs-published-field input {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
}

.docs-published-field span {
    font-weight: 900;
}

/* Stronger Persian docs font fix */

.docs-layout-fa,
.docs-layout-fa *,
.docs-hero-fa,
.docs-hero-fa *,
.docs-sidebar-fa,
.docs-sidebar-fa *,
.docs-content-panel-fa,
.docs-content-panel-fa *,
.docs-rendered-box-fa,
.docs-rendered-box-fa * {
    font-family: "IRANSansXFaNum", Inter, ui-sans-serif, system-ui, sans-serif;
}

.docs-rendered-box-fa code,
.docs-rendered-box-fa pre,
.docs-rendered-box-fa pre *,
.docs-layout-fa code,
.docs-layout-fa pre,
.docs-layout-fa pre * {
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
}

.docs-hero-fa h2,
.docs-sidebar-fa h2,
.docs-content-panel-fa h2,
.docs-rendered-box-fa h1,
.docs-rendered-box-fa h2,
.docs-rendered-box-fa h3,
.docs-rendered-box-fa h4,
.docs-rendered-box-fa h5,
.docs-rendered-box-fa h6 {
    font-family: "IRANSansXFaNum", Inter, ui-sans-serif, system-ui, sans-serif;
    font-weight: 900;
}

@media (max-width: 700px) {
    .docs-published-field label {
        width: 100%;
    }
}

/* ============================================================
   Repository Docs Form Alignment Fix
============================================================ */

.repository-doc-form .form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.repository-doc-form .form-group {
    min-width: 0;
}

.repository-doc-form .form-group label {
    display: block;
    margin: 0 0 8px;
    line-height: 1.2;
}

.repository-doc-form .form-control {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
}

.repository-doc-form .help-text {
    margin-top: 8px;
    line-height: 1.45;
}

.repository-doc-form .code-editor-textarea {
    min-height: 420px;
    resize: vertical;
}

@media (max-width: 800px) {
    .repository-doc-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Chunked Upload Progress UI
============================================================ */

.chunk-upload-error-box {
    padding: 14px 16px;
    border: 1px solid #fecaca;
    border-radius: 16px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.6;
}

.chunk-upload-progress-panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #c4b5fd;
    border-radius: 18px;
    background: #faf5ff;
}

.chunk-upload-progress-header,
.chunk-upload-progress-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.chunk-upload-progress-header strong {
    display: block;
    margin-bottom: 4px;
    color: #5b21b6;
    font-size: 16px;
    letter-spacing: -0.03em;
}

.chunk-upload-progress-header p {
    margin: 0;
    color: #6d28d9;
    font-size: 13px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

#chunk-upload-progress-percent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 34px;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 950;
}

.chunk-upload-progress-track {
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #ede9fe;
    border: 1px solid #ddd6fe;
}

.chunk-upload-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #06b6d4);
    transition: width 0.18s ease;
}

.chunk-upload-progress-footer span {
    color: #6d28d9;
    font-size: 13px;
    font-weight: 900;
}

@media (max-width: 700px) {
    .chunk-upload-progress-header,
    .chunk-upload-progress-footer {
        align-items: stretch;
        flex-direction: column;
    }

    #chunk-upload-progress-percent,
    .chunk-upload-progress-footer .button {
        width: 100%;
    }
}

/* ============================================================
   Chunked Upload Scan + Skipped Report Fixes
============================================================ */

.chunk-upload-progress-panel[hidden],
.chunk-upload-error-box[hidden],
.chunk-upload-scan-box[hidden],
.chunk-upload-skipped-box[hidden],
.upload-scan-summary[hidden] {
    display: none !important;
}

.chunk-upload-scan-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    background: #eff6ff;
    color: #1d4ed8;
}

.chunk-upload-scan-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 999px;
    flex: 0 0 auto;
    animation: gitbol-spin 0.75s linear infinite;
}

.chunk-upload-scan-box strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 950;
}

.chunk-upload-scan-box p {
    margin: 0;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
}

@keyframes gitbol-spin {
    to {
        transform: rotate(360deg);
    }
}

.chunk-upload-skipped-box {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: #fff7ed;
}

.chunk-upload-skipped-header strong {
    display: block;
    margin-bottom: 5px;
    color: #9a3412;
    font-size: 15px;
    font-weight: 950;
}

.chunk-upload-skipped-header p {
    margin: 0;
    color: #9a3412;
    line-height: 1.6;
}

.chunk-upload-skipped-list {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
}

.chunk-upload-skipped-list div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    background: white;
}

.chunk-upload-skipped-list code {
    overflow-wrap: anywhere;
    color: #7c2d12;
    font-size: 12px;
    font-weight: 900;
}

.chunk-upload-skipped-list span,
.chunk-upload-skipped-list strong {
    color: #9a3412;
    font-size: 12px;
    font-weight: 900;
}

@media (max-width: 700px) {
    .chunk-upload-scan-box {
        align-items: flex-start;
    }

    .chunk-upload-skipped-list div {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Upload Wizard UI
============================================================ */

.upload-wizard-panel {
    overflow: hidden;
}

.upload-wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.upload-wizard-step {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
    color: var(--text-soft);
}

.upload-wizard-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--text-soft);
    font-weight: 950;
}

.upload-wizard-step strong {
    font-size: 13px;
    font-weight: 950;
}

.upload-wizard-step-active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    box-shadow: 0 16px 36px rgba(124, 58, 237, 0.22);
}

.upload-wizard-step-active span {
    background: white;
    color: var(--accent);
}

.upload-wizard-page {
    display: none;
}

.upload-wizard-page-active {
    display: grid;
    gap: 18px;
}

.upload-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.upload-picker-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.upload-scan-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.upload-scan-summary > div,
.upload-report-grid > div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
}

.upload-scan-summary span,
.upload-report-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.upload-scan-summary strong,
.upload-report-grid strong {
    display: block;
    color: var(--text);
    font-size: 16px;
    font-weight: 950;
    overflow-wrap: anywhere;
}

.upload-report-loading-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 950;
}

.upload-final-report-panel {
    display: grid;
    gap: 18px;
}

.upload-final-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--panel-soft);
}

.upload-final-status h2 {
    margin: 0 0 6px;
}

.upload-final-status p {
    margin: 0;
    color: var(--text-soft);
}

.upload-final-status-completed {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.upload-final-status-completed h2,
.upload-final-status-completed p {
    color: #166534;
}

.upload-final-status-failed,
.upload-final-status-canceled {
    border-color: #fecaca;
    background: #fee2e2;
}

.upload-final-status-failed h2,
.upload-final-status-failed p,
.upload-final-status-canceled h2,
.upload-final-status-canceled p {
    color: #991b1b;
}

.upload-report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.upload-report-file-list {
    display: grid;
    gap: 8px;
    max-height: 420px;
    overflow: auto;
}

.upload-report-file-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-soft);
}

.upload-report-file-list code {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-weight: 900;
}

.upload-report-file-list span {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .upload-wizard-steps,
    .upload-picker-grid,
    .upload-scan-summary,
    .upload-report-grid {
        grid-template-columns: 1fr;
    }

    .upload-final-status {
        align-items: stretch;
        flex-direction: column;
    }

    .upload-final-status .button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .upload-report-file-list div {
        flex-direction: column;
    }

    .upload-report-file-list span {
        white-space: normal;
    }
}

/* ============================================================
   Django Intelligence Overflow Fix
============================================================ */

.django-intelligence-panel,
.django-change-panel,
.django-mini-section,
.django-health-list,
.django-health-row,
.django-big-file-row,
.django-classified-file-row {
    max-width: 100%;
    min-width: 0;
}

.django-health-row > div,
.django-big-file-row > div,
.django-classified-file-row > div,
.django-change-warning,
.django-mini-section-header > div {
    min-width: 0;
    max-width: 100%;
}

.django-health-row p,
.django-health-row strong,
.django-health-row code,
.django-big-file-row code,
.django-big-file-row strong,
.django-classified-file-row code,
.django-classified-file-row strong,
.django-change-warning p,
.django-change-warning strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.django-health-row code,
.django-big-file-row code,
.django-classified-file-row code {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
}

.django-health-row > span,
.django-big-file-row > span,
.django-mini-section-header span {
    flex: 0 0 auto;
}

.django-health-row {
    overflow: hidden;
}

.django-mini-section {
    overflow: hidden;
}

@media (max-width: 700px) {
    .django-health-row > span,
    .django-big-file-row > span,
    .django-mini-section-header span {
        white-space: normal;
        width: fit-content;
        max-width: 100%;
    }
}

/* ============================================================
   Global Upload Indicator
============================================================ */

.global-upload-indicator {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid rgba(196, 181, 253, 0.55);
    border-radius: 999px;
    background: rgba(237, 233, 254, 0.18);
    color: white;
    font-size: 13px;
    font-weight: 900;
    transition: 0.18s ease;
}

.global-upload-indicator:hover {
    background: rgba(237, 233, 254, 0.28);
}

.global-upload-indicator[hidden] {
    display: none !important;
}

#global-upload-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}

.global-upload-indicator-active #global-upload-indicator-dot {
    background: #38bdf8;
    animation: upload-indicator-pulse 0.9s ease-in-out infinite;
}

.global-upload-indicator-completed #global-upload-indicator-dot {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.global-upload-indicator-failed #global-upload-indicator-dot,
.global-upload-indicator-canceled #global-upload-indicator-dot {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

@keyframes upload-indicator-pulse {
    0% {
        transform: scale(1);
        opacity: 0.75;
    }

    50% {
        transform: scale(1.25);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.75;
    }
}

@media (max-width: 700px) {
    .global-upload-indicator {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   Docs language switch font fix
============================================================ */

.docs-language-switch a,
.docs-language-switch button,
.docs-language-link {
    font-family: inherit;
}

.docs-language-switch a[hreflang="fa"],
.docs-language-switch button[lang="fa"],
.docs-language-link[lang="fa"],
.docs-language-link-fa {
    font-family: "IRANSansXFaNum", "IRANSansX", Tahoma, Arial, sans-serif;
    direction: rtl;
}

/* ============================================================
   Global Docs Search + Code Copy
============================================================ */

.docs-search-box {
    margin: 12px 0 14px;
}

.docs-search-box .form-control {
    min-height: 44px;
}

.docs-search-empty {
    margin: 10px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

.docs-page-link[hidden] {
    display: none !important;
}

.docs-code-copy-ready {
    position: relative;
}

.docs-code-copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.docs-code-copy-button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.docs-rendered-box-fa .docs-code-copy-button {
    right: auto;
    left: 10px;
    font-family: "IRANSansXFaNum", "IRANSansX", Tahoma, Arial, sans-serif;
}

@media (max-width: 700px) {
    .docs-code-copy-button {
        position: static;
        display: inline-flex;
        margin: 10px 0 0;
    }
}

/* ============================================================
   Docs Content Search
============================================================ */

.docs-content-search-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.docs-content-search-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.docs-content-search-count {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.docs-search-highlight {
    padding: 1px 3px;
    border-radius: 5px;
    background: #fde68a;
    color: #1f2937;
}

.docs-search-highlight-active {
    background: #f97316;
    color: white;
}

.docs-content-panel-fa .docs-content-search-bar {
    direction: rtl;
}

.docs-content-panel-fa .docs-content-search-bar,
.docs-content-panel-fa .docs-content-search-bar input,
.docs-content-panel-fa .docs-content-search-actions,
.docs-content-panel-fa .docs-content-search-count {
    font-family: "IRANSansXFaNum", "IRANSansX", Tahoma, Arial, sans-serif;
}

@media (max-width: 800px) {
    .docs-content-search-bar {
        grid-template-columns: 1fr;
    }

    .docs-content-search-actions {
        justify-content: flex-start;
    }

    .docs-content-panel-fa .docs-content-search-actions {
        justify-content: flex-end;
    }
}

/* ============================================================
   File Preview Copy Polish
============================================================ */

.file-viewer-actions button[data-copy-target] {
    white-space: nowrap;
}

.file-content-box-highlighted pre {
    position: relative;
}

/* ============================================================
   CodeMirror File Editor
============================================================ */

.file-editor-form {
    display: grid;
    gap: 18px;
}

.file-editor-group {
    min-width: 0;
}

.file-editor-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.file-editor-mini-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.file-editor-mode-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.08);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 950;
}

.file-editor-shell {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 18px;
    background: #282a36;
}

.file-editor-shell textarea {
    min-height: 620px;
    width: 100%;
    padding: 18px;
    border: 0;
    background: #020617;
    color: #dbeafe;
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
}

.file-editor-shell .CodeMirror {
    height: 660px;
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.65;
}

.file-editor-shell .CodeMirror-scroll {
    min-height: 660px;
}

.file-editor-shell .CodeMirror-gutters {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.file-editor-shell .CodeMirror-linenumber {
    padding: 0 10px;
    color: #94a3b8;
}

.file-editor-shell .CodeMirror-activeline-background {
    background: rgba(255, 255, 255, 0.06);
}

.file-editor-shell .CodeMirror-cursor {
    border-left-color: #f8fafc;
}

@media (max-width: 800px) {
    .file-editor-label-row {
        align-items: stretch;
        flex-direction: column;
    }

    .file-editor-mini-actions {
        justify-content: flex-start;
    }

    .file-editor-shell .CodeMirror,
    .file-editor-shell .CodeMirror-scroll {
        height: 520px;
        min-height: 520px;
    }
}

/* ============================================================
   Large File Preview Safety
============================================================ */

.file-preview-safety-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid rgba(251, 191, 36, 0.32);
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(251, 191, 36, 0.16), transparent 38%),
        #fffbeb;
}

.file-preview-safety-card strong {
    display: block;
    color: #92400e;
    font-size: 14px;
    font-weight: 950;
}

.file-preview-safety-card p {
    margin: 6px 0 0;
    color: #92400e;
    line-height: 1.7;
}

.file-preview-safety-stats {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 240px;
}

.file-preview-safety-stats span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.18);
    color: #78350f;
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
}

.file-content-box-limited {
    border-color: rgba(251, 191, 36, 0.35);
}

@media (max-width: 800px) {
    .file-preview-safety-card {
        flex-direction: column;
    }

    .file-preview-safety-stats {
        justify-content: flex-start;
        min-width: 0;
    }
}

/* ============================================================
   Large Commit Safety
============================================================ */

.commit-large-safety-card,
.commit-diff-paused-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid rgba(251, 191, 36, 0.32);
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(251, 191, 36, 0.16), transparent 38%),
        #fffbeb;
}

.commit-diff-paused-card {
    margin-bottom: 0;
}

.commit-large-safety-card strong,
.commit-diff-paused-card strong {
    display: block;
    color: #92400e;
    font-size: 14px;
    font-weight: 950;
}

.commit-large-safety-card p,
.commit-diff-paused-card p {
    margin: 6px 0 0;
    color: #92400e;
    line-height: 1.7;
}

.commit-large-safety-stats {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 240px;
}

.commit-large-safety-stats span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.18);
    color: #78350f;
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
}

.commit-file-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.commit-file-pagination span {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 900;
}

@media (max-width: 800px) {
    .commit-large-safety-card,
    .commit-diff-paused-card {
        flex-direction: column;
    }

    .commit-large-safety-stats {
        justify-content: flex-start;
        min-width: 0;
    }
}

.commit-oversized-file-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.commit-oversized-file-list code {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(120, 53, 15, 0.08);
    color: #78350f;
    white-space: normal;
    word-break: break-word;
}

.commit-oversized-file-list span {
    color: #92400e;
    font-size: 12px;
    font-weight: 900;
}

/* ============================================================
   Django Change Summary Limit Note
============================================================ */

.django-summary-limited-note {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(59, 130, 246, 0.24);
    border-radius: 16px;
    background: #eff6ff;
}

.django-summary-limited-note strong {
    display: block;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 950;
}

.django-summary-limited-note p {
    margin: 5px 0 0;
    color: #475569;
    line-height: 1.6;
}

/* ============================================================
   Lazy Commit File Diff
============================================================ */

.changed-file-row-button-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.commit-file-lazy-diff {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 14px;
}

.commit-file-lazy-diff-list {
    margin-top: 0;
}

.commit-file-diff-error,
.commit-file-diff-limited-note {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.6;
}

.commit-file-diff-error {
    border: 1px solid rgba(239, 68, 68, 0.24);
    background: #fef2f2;
    color: #991b1b;
}

.commit-file-diff-limited-note {
    margin-bottom: 10px;
    border: 1px solid rgba(251, 191, 36, 0.32);
    background: #fffbeb;
    color: #92400e;
}

@media (max-width: 900px) {
    .changed-file-row-button-group {
        justify-content: flex-start;
    }
}

/* ============================================================
   Repository List Long Name / Badge Overflow Fix
============================================================ */

.repo-card {
    min-width: 0;
    overflow: hidden;
}

.repo-card-top {
    min-width: 0;
    max-width: 100%;
    align-items: flex-start;
    flex-wrap: wrap;
}

.repo-card-top > div:first-child {
    min-width: 0;
    flex: 1 1 180px;
    max-width: 100%;
}

.repo-card-top h3,
.repo-card-top p {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.repo-card-top .badge {
    flex: 0 0 auto;
    max-width: 100%;
    white-space: nowrap;
}

.repo-card-top .badge-role {
    max-width: 100%;
}

@media (max-width: 520px) {
    .repo-card-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .repo-card-top .badge,
    .repo-card-top .badge-role {
        white-space: normal;
    }
}


/* ============================================================
   Repository Docs Editor Boundary / Long Line Wrap Fix
============================================================ */

.repository-doc-form .repository-doc-content-textarea {
    min-height: 460px;
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: #ffffff;
    color: var(--text);
    resize: vertical;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.7;
}

.repository-doc-form .repository-doc-content-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

@media (max-width: 700px) {
    .repository-doc-form .repository-doc-content-textarea {
        min-height: 360px;
    }
}

/* ============================================================
   Deletion Bin
============================================================ */

.deletion-zone-card {
    margin-top: 14px;
    background: #fff1f2;
}

.deletion-confirm-panel {
    border-color: #fecaca;
}

.badge-deletion-bin {
    background: #fee2e2;
    color: #991b1b;
}

.deletion-bin-repo-card {
    border-color: #fecaca;
    background: linear-gradient(180deg, #ffffff, #fff1f2);
}

/* ============================================================
   Repository Tags
============================================================ */

.tag-list {
    display: grid;
    gap: 12px;
}

.tag-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
}

.tag-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.tag-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    flex: 0 0 auto;
}

.tag-main h3 {
    margin: 0;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}

.tag-main p {
    margin: 5px 0 0;
    color: var(--text-soft);
    line-height: 1.5;
}

.tag-message {
    color: var(--text) !important;
    font-weight: 700;
}

.tag-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
}

.tag-meta code {
    padding: 5px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 700px) {
    .tag-row {
        align-items: stretch;
        flex-direction: column;
    }

    .tag-meta {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* ============================================================
   Repository Tag Create/Delete UI
============================================================ */

.tag-create-form {
    display: grid;
    gap: 18px;
}

.tag-delete-form {
    margin: 0;
}

.tag-delete-form .button {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
}

@media (max-width: 700px) {
    .tag-delete-form,
    .tag-delete-form .button {
        width: 100%;
    }
}

/* ============================================================
   Commit Tag Badges
============================================================ */

.commit-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.commit-detail-tag-list {
    margin-top: 12px;
}

.commit-tag-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 12px;
    font-weight: 900;
    transition: 0.18s ease;
}

.commit-tag-pill:hover {
    background: #fde68a;
    color: #78350f;
}

/* ============================================================
   Account Approval Pending
============================================================ */

.pending-approval-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 18px;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: #fff7ed;
}

.pending-approval-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #ffedd5;
    color: #9a3412;
    font-size: 30px;
    flex: 0 0 auto;
}

.pending-approval-card h3 {
    margin: 0;
    color: #9a3412;
    letter-spacing: -0.03em;
}

.pending-approval-card p {
    margin: 8px 0 0;
    color: #9a3412;
    line-height: 1.6;
}

@media (max-width: 700px) {
    .pending-approval-card {
        flex-direction: column;
    }
}

/* ============================================================
   Quick Start Copy Buttons
============================================================ */

.mini-command-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mini-command-title-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.mini-command-title-row .button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
}

@media (max-width: 520px) {
    .mini-command-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .mini-command-title-row .button {
        width: 100%;
    }
}

/* ============================================================
   Branch Switch Loading Animation
============================================================ */

.gitbol-branch-loader[hidden] {
    display: none !important;
}

.gitbol-branch-loader {
    max-height: 0;
    margin-bottom: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    box-shadow: var(--shadow-soft);
    transition:
        max-height 0.24s ease,
        margin-bottom 0.24s ease,
        opacity 0.18s ease,
        transform 0.18s ease;
}

.gitbol-branch-loader-active {
    max-height: 120px;
    margin-bottom: 16px;
    opacity: 1;
    transform: translateY(0);
}

.gitbol-branch-loader-bar {
    height: 4px;
    overflow: hidden;
    background: #dbeafe;
}

.gitbol-branch-loader-bar span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #06b6d4);
    animation: gitbol-branch-loader-slide 0.9s ease-in-out infinite;
}

.gitbol-branch-loader-content {
    padding: 14px 16px;
}

.gitbol-branch-loader-content strong {
    display: block;
    margin-bottom: 4px;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 950;
}

.gitbol-branch-loader-content span {
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.repository-page-layout.gitbol-branch-switching {
    pointer-events: none;
}

.gitbol-branch-slide-out {
    animation: gitbol-branch-slide-out 0.16s ease forwards;
}

.gitbol-branch-slide-in {
    opacity: 0;
    transform: translateY(-14px);
    clip-path: inset(0 0 100% 0);
}

.gitbol-branch-slide-in-active {
    animation: gitbol-branch-slide-open 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes gitbol-branch-loader-slide {
    0% {
        transform: translateX(-110%);
    }

    50% {
        transform: translateX(75%);
    }

    100% {
        transform: translateX(250%);
    }
}

@keyframes gitbol-branch-slide-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

@keyframes gitbol-branch-slide-open {
    from {
        opacity: 0;
        transform: translateY(-14px);
        clip-path: inset(0 0 100% 0);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        clip-path: inset(0 0 0 0);
    }
}

/* ============================================================
   Branch Graph Visualization
============================================================ */

.branch-graph-panel {
    border-color: #c4b5fd;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.10), transparent 30rem),
        linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
}

.branch-graph {
    position: relative;
    display: grid;
    gap: 14px;
}

.branch-graph-status {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 8;
    max-width: min(460px, calc(100% - 28px));
    padding: 12px 14px;
    border: 1px solid rgba(196, 181, 253, 0.34);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.72);
    color: #e9d5ff;
    font-size: 13px;
    font-weight: 900;
    pointer-events: none;
    backdrop-filter: blur(12px);
}

.branch-graph-canvas-wrap {
    position: relative;
    min-height: 360px;
    max-height: 680px;
    overflow: auto;
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: 18px;
    background:
        radial-gradient(circle at 24px 24px, rgba(124, 58, 237, 0.10), transparent 18px),
        linear-gradient(180deg, #0f172a, #020617);
}

.branch-graph-svg {
    display: block;
    min-width: 100%;
}

.branch-graph-lane-line {
    stroke: rgba(226, 232, 240, 0.12);
    stroke-width: 1;
    stroke-dasharray: 4 12;
}

.branch-graph-parent-line {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.9;
    animation: branch-graph-line-enter 0.42s ease both;
}

.branch-graph-merge-line {
    stroke-dasharray: 8 8;
    opacity: 0.78;
}

.branch-graph-commit-link,
.branch-graph-branch-link {
    cursor: pointer;
}

.branch-graph-node {
    stroke: #020617;
    stroke-width: 4;
    filter: drop-shadow(0 0 14px rgba(124, 58, 237, 0.28));
    transition:
        transform 0.18s ease,
        filter 0.18s ease;
    transform-box: fill-box;
    transform-origin: center;
    animation: branch-graph-node-enter 0.28s ease both;
}

.branch-graph-node-merge {
    stroke-width: 5;
}

.branch-graph-commit-link:hover .branch-graph-node {
    transform: scale(1.35);
    filter: drop-shadow(0 0 22px rgba(124, 58, 237, 0.42));
}

.branch-graph-hash {
    fill: #cbd5e1;
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
    font-size: 12px;
    font-weight: 900;
}

.branch-graph-message-box {
    fill: rgba(15, 23, 42, 0.86);
    stroke: rgba(196, 181, 253, 0.22);
    stroke-width: 1;
}

.branch-graph-message {
    fill: #f8fafc;
    font-size: 12px;
    font-weight: 850;
}

.branch-graph-commit-link:hover .branch-graph-hash,
.branch-graph-commit-link:hover .branch-graph-message {
    fill: #c4b5fd;
}

.branch-graph-head-label rect {
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 1;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.34));
}

.branch-graph-head-label text {
    fill: white;
    font-size: 12px;
    font-weight: 950;
}

.branch-graph-label-pin {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.8;
}

.branch-graph-head-label-color-0 rect {
    fill: #7c3aed;
}

.branch-graph-head-label-color-1 rect {
    fill: #0891b2;
}

.branch-graph-head-label-color-2 rect {
    fill: #16a34a;
}

.branch-graph-head-label-color-3 rect {
    fill: #ea580c;
}

.branch-graph-head-label-color-4 rect {
    fill: #dc2626;
}

.branch-graph-head-label-color-5 rect {
    fill: #2563eb;
}

.branch-graph-head-label-color-6 rect {
    fill: #db2777;
}

.branch-graph-head-label-color-7 rect {
    fill: #0f766e;
}

.branch-graph-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 6px;
    padding: 22px;
    text-align: center;
}

.branch-graph-empty[hidden] {
    display: none !important;
}

.branch-graph-empty strong {
    color: #f8fafc;
    font-size: 18px;
    font-weight: 950;
}

.branch-graph-empty span {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
}

.branch-graph-actions {
    display: flex;
    justify-content: center;
}

.branch-graph-actions .button {
    min-width: 220px;
}

.branch-graph-tooltip {
    position: absolute;
    z-index: 20;
    max-width: 360px;
    padding: 12px 14px;
    border: 1px solid rgba(196, 181, 253, 0.36);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.96);
    color: white;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.38);
    pointer-events: none;
}

.branch-graph-tooltip[hidden] {
    display: none !important;
}

.branch-graph-tooltip strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 950;
    line-height: 1.4;
}

.branch-graph-tooltip span {
    display: block;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
}

.branch-graph-loading .branch-graph-status {
    position: relative;
    overflow: hidden;
}

.branch-graph-loading .branch-graph-status::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #06b6d4, #22c55e);
    animation: branch-graph-loading-bar 0.9s ease-in-out infinite;
}

@keyframes branch-graph-loading-bar {
    0% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes branch-graph-node-enter {
    from {
        opacity: 0;
        transform: scale(0.55);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes branch-graph-line-enter {
    from {
        opacity: 0;
        stroke-dasharray: 2 10;
    }

    to {
        opacity: 0.9;
    }
}

@media (max-width: 700px) {
    .branch-graph-canvas-wrap {
        min-height: 320px;
        max-height: 560px;
    }

    .branch-graph-actions,
    .branch-graph-actions .button,
    #branch-graph-refresh-button {
        width: 100%;
    }

    .branch-graph-tooltip {
        max-width: 260px;
    }
}

/* ============================================================
   Merge Conflict Resolution
============================================================ */

.conflict-resolution-panel {
    border-color: #fed7aa;
    background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
}

.conflict-resolution-status,
.conflict-file-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    white-space: nowrap;
}

.conflict-resolution-status-open,
.conflict-file-status-pending,
.conflict-file-status-draft,
.conflict-file-status-needs_review {
    background: #ffedd5;
    color: #9a3412;
}

.conflict-resolution-status-ready,
.conflict-file-status-resolved {
    background: #dcfce7;
    color: #166534;
}

.conflict-resolution-status-stale,
.conflict-resolution-status-canceled,
.conflict-file-status-binary_blocked {
    background: #fee2e2;
    color: #991b1b;
}

.conflict-resolution-status-merged {
    background: #ede9fe;
    color: #5b21b6;
}

.merge-conflict-resolution-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.merge-conflict-resolution-progress div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
}

.merge-conflict-resolution-progress span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.merge-conflict-resolution-progress strong {
    display: block;
    color: var(--text);
    font-size: 22px;
    font-weight: 950;
}

.conflict-resolution-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.conflict-file-list {
    display: grid;
    gap: 10px;
}

.conflict-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
}

.conflict-file-row strong {
    display: block;
    overflow-wrap: anywhere;
    letter-spacing: -0.03em;
}

.conflict-file-row p {
    margin: 6px 0 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.conflict-file-row-resolved {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.conflict-file-row-binary_blocked {
    border-color: #fecaca;
    background: #fff1f2;
}

.conflict-editor-panel {
    overflow: hidden;
}

.conflict-compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.conflict-version-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    background: #020617;
}

.conflict-version-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    background: #0f172a;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.conflict-version-header strong {
    color: #f8fafc;
    font-size: 13px;
    font-weight: 950;
}

.conflict-version-header span {
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 900;
}

.conflict-version-card pre {
    max-height: 420px;
    overflow: auto;
}

.conflict-version-card code {
    display: block;
    width: max-content;
    min-width: 100%;
    color: #e2e8f0;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre;
}

.conflict-resolved-form {
    display: grid;
    gap: 16px;
}

.conflict-resolved-card {
    background: white;
}

.conflict-resolved-textarea {
    min-height: 520px;
    border: 0;
    border-radius: 0;
    background: #020617;
    color: #e2e8f0;
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre;
    overflow: auto;
    resize: vertical;
}

.conflict-resolved-textarea:focus {
    box-shadow: none;
}

@media (max-width: 1000px) {
    .merge-conflict-resolution-progress,
    .conflict-compare-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .merge-conflict-resolution-progress,
    .conflict-compare-grid {
        grid-template-columns: 1fr;
    }

    .conflict-file-row {
        align-items: stretch;
        flex-direction: column;
    }

    .conflict-file-row .button,
    .conflict-resolution-actions,
    .conflict-resolution-actions .button,
    .conflict-resolution-actions form {
        width: 100%;
    }

    .conflict-version-card code {
        width: auto;
        min-width: 0;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .conflict-resolved-textarea {
        min-height: 360px;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }
}

/* ============================================================
   Conflict Editor Polish
============================================================ */

.conflict-helper-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #ddd6fe;
    border-radius: 18px;
    background: #faf5ff;
}

.conflict-helper-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--accent-dark);
    font-size: 14px;
    font-weight: 950;
}

.conflict-helper-card p {
    margin: 0;
    color: #6d28d9;
    line-height: 1.6;
}

.conflict-helper-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.conflict-marker-warning {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #fecaca;
    border-radius: 18px;
    background: #fff1f2;
}

.conflict-marker-warning[hidden] {
    display: none !important;
}

.conflict-marker-warning strong {
    display: block;
    margin-bottom: 6px;
    color: #991b1b;
    font-weight: 950;
}

.conflict-marker-warning p {
    margin: 0;
    color: #7f1d1d;
    line-height: 1.6;
}

.conflict-marker-warning code {
    display: inline-flex;
    padding: 2px 6px;
    border-radius: 7px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 950;
}

.conflict-code-viewer-textarea {
    display: none;
}

.conflict-version-card .CodeMirror {
    height: 420px;
    font-family: "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.65;
}

.conflict-resolved-card .CodeMirror {
    height: 560px;
}

.conflict-version-card .CodeMirror-gutters {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.conflict-version-card .CodeMirror-linenumber {
    padding: 0 10px;
    color: #94a3b8;
}

.conflict-version-card .CodeMirror-activeline-background {
    background: rgba(255, 255, 255, 0.06);
}

.conflict-version-card .CodeMirror-cursor {
    border-left-color: #f8fafc;
}

.button-disabled,
.button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    filter: grayscale(0.2);
}

@media (max-width: 900px) {
    .conflict-helper-card {
        align-items: stretch;
        flex-direction: column;
    }

    .conflict-helper-actions,
    .conflict-helper-actions .button {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .conflict-version-card .CodeMirror,
    .conflict-resolved-card .CodeMirror {
        height: 420px;
    }
}

/* ============================================================
   Branch Graph Overhaul
============================================================ */

.branch-graph-toolbar {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 9;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid rgba(196, 181, 253, 0.34);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
}

.branch-graph-toolbar label {
    display: grid;
    gap: 6px;
    min-width: 220px;
    color: #e9d5ff;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.branch-graph-filter {
    min-height: 38px;
    border: 1px solid #c4b5fd;
    border-radius: 12px;
    background: white;
    color: var(--text);
    font-weight: 850;
}

.branch-graph-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.branch-graph-canvas-wrap {
    height: 460px;
    min-height: 460px;
    max-height: none;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.branch-graph-canvas-wrap.branch-graph-dragging {
    cursor: grabbing;
}

.branch-graph-main-rail {
    stroke: #f97316;
    stroke-width: 7;
    stroke-linecap: round;
    filter: drop-shadow(0 0 18px rgba(249, 115, 22, 0.28));
}

.branch-graph-branch-path {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.92;
    filter: drop-shadow(0 0 12px rgba(14, 165, 233, 0.22));
}

.branch-graph-branch-path-main {
    stroke-width: 7;
}

.branch-graph-parent-line {
    stroke-width: 2.5;
    opacity: 0.34;
}

.branch-graph-dimmed {
    opacity: 0.16 !important;
    filter: blur(0.4px) grayscale(0.35);
}

.branch-graph-branch-stub {
    stroke: #020617;
    stroke-width: 4;
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.20));
}

.branch-graph-svg {
    height: 100%;
}

.branch-graph-hash {
    display: none;
}

/* ============================================================
   GitBol Admin + Patch Notes
============================================================ */

.admin-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.admin-action-card,
.patch-note-card {
    display: block;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-soft);
    color: inherit;
    box-shadow: var(--shadow-soft);
}

.admin-action-card {
    transition: 0.18s ease;
}

.admin-action-card:hover {
    transform: translateY(-2px);
    border-color: #c4b5fd;
    background: #faf5ff;
}

.admin-action-card span,
.patch-note-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: #ede9fe;
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.admin-action-card strong {
    display: block;
    margin-top: 10px;
    color: var(--text);
    font-size: 28px;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.admin-action-card p,
.patch-note-card p {
    margin: 8px 0 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.patch-note-list {
    display: grid;
    gap: 14px;
}

.patch-note-card {
    background: white;
}

.patch-note-card-draft {
    opacity: 0.7;
    border-style: dashed;
}

.patch-note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
}

.patch-note-card h3 {
    margin: 0;
    color: var(--text);
    letter-spacing: -0.04em;
}

.patch-note-body {
    margin-top: 12px;
    color: var(--text);
    line-height: 1.75;
}

.patch-note-form {
    display: grid;
    gap: 18px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.pagination span {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 900;
}

@media (max-width: 900px) {
    .admin-action-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   User Dashboard
============================================================ */

.user-dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    margin-bottom: 18px;
}

.user-dashboard-hero-main,
.user-dashboard-motd,
.user-dashboard-stat-card {
    border: 1px solid rgba(196, 181, 253, 0.55);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
}

.user-dashboard-hero-main {
    position: relative;
    overflow: hidden;
    padding: 28px;
    background:
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.22), transparent 38%),
        linear-gradient(135deg, #ffffff, #f8fafc);
}

.user-dashboard-hero-main::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -80px;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
}

.user-dashboard-hero-main h2 {
    position: relative;
    margin: 8px 0 8px;
    color: var(--text);
    font-size: clamp(28px, 4vw, 46px);
    letter-spacing: -0.06em;
    z-index: 1;
}

.user-dashboard-hero-main p {
    position: relative;
    max-width: 720px;
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
    z-index: 1;
}

.user-dashboard-date-row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    z-index: 1;
}

.user-dashboard-date-row span,
.user-dashboard-date-row strong,
.user-dashboard-motd span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: #ede9fe;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 950;
}

.user-dashboard-date-row strong {
    background: #0f172a;
    color: white;
}

.user-dashboard-motd {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(88, 28, 135, 0.92)),
        #0f172a;
    color: white;
}

.user-dashboard-motd span {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.12);
    color: #ddd6fe;
}

.user-dashboard-motd strong {
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: -0.05em;
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
    transition: transform 0.18s ease, text-shadow 0.18s ease;
}

.user-dashboard-motd-next {
    align-self: flex-end;
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    box-shadow: none;
}

.user-dashboard-motd-next:hover {
    border-color: rgba(255, 255, 255, 0.44);
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.user-dashboard-motd-pop {
    transform: translateY(-2px) scale(1.02);
    text-shadow: 0 14px 28px rgba(255, 255, 255, 0.22);
}

.user-dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.user-dashboard-stat-card {
    display: block;
    padding: 18px;
    background: white;
    color: inherit;
    transition: 0.18s ease;
}

.user-dashboard-stat-card:hover {
    transform: translateY(-2px);
    border-color: #a78bfa;
    background: #faf5ff;
}

.user-dashboard-stat-card span {
    display: block;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.user-dashboard-stat-card strong {
    display: block;
    margin-top: 8px;
    color: var(--text);
    font-size: 34px;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.user-dashboard-stat-card p {
    margin: 8px 0 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.user-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
    align-items: start;
}

.user-dashboard-workspace-grid {
    align-items: stretch;
}

.user-dashboard-workspace-grid > .panel {
    min-height: 430px;
}

.user-dashboard-grid-single {
    grid-template-columns: 1fr;
}

.user-dashboard-actions-panel,
.user-dashboard-notes-panel {
    display: flex;
    flex-direction: column;
}

.user-dashboard-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    flex: 1;
}

.user-dashboard-patch-note {
    min-height: auto;
}

.user-dashboard-patch-note p {
    max-height: 180px;
    overflow: hidden;
}

.user-dashboard-list {
    display: grid;
    gap: 10px;
}

.user-dashboard-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-soft);
    color: inherit;
    transition: 0.18s ease;
}

.user-dashboard-list-row:hover {
    transform: translateY(-1px);
    border-color: #c4b5fd;
    background: white;
}

.user-dashboard-list-row strong,
.user-dashboard-list-row span {
    display: block;
}

.user-dashboard-list-row strong {
    color: var(--text);
    letter-spacing: -0.03em;
}

.user-dashboard-list-row span,
.user-dashboard-list-row em {
    color: var(--text-soft);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.user-note-form {
    display: grid;
    gap: 12px;
}

.user-dashboard-grid .user-note-form:not(.user-note-form-large) .user-note-textarea {
    min-height: 72px;
    max-height: 86px;
}

.user-note-form-large .user-note-textarea {
    min-height: 180px;
}

.user-note-textarea {
    resize: vertical;
}

.user-note-pin-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 900;
}

.user-note-preview-list,
.user-notes-grid {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.user-note-preview-list {
    max-height: 238px;
    overflow-y: auto;
    padding-right: 4px;
}

.user-dashboard-notes-panel {
    overflow: hidden;
}

.user-dashboard-notes-panel .panel-header,
.user-dashboard-notes-panel .user-note-form {
    flex: 0 0 auto;
}

.user-dashboard-notes-panel .user-note-preview-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    margin-top: 12px;
    padding-right: 6px;
}

.user-dashboard-notes-panel .user-note-card {
    padding: 10px 12px;
}

.user-dashboard-notes-panel .user-note-card-meta {
    margin-bottom: 6px;
}

.user-dashboard-notes-panel .user-note-card p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.user-notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-note-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: var(--shadow-soft);
}

.user-note-card-pinned {
    border-color: #c4b5fd;
    background:
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 34%),
        white;
}

.user-note-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
}

.user-note-card-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 0 9px;
    border-radius: 999px;
    background: #ede9fe;
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.user-note-card p {
    margin: 0;
    color: var(--text);
    line-height: 1.65;
    overflow-wrap: anywhere;
    unicode-bidi: plaintext;
}

.user-note-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.user-notes-layout {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.dashboard-message-bulk-form {
    display: grid;
    gap: 14px;
}

.dashboard-message-bulk-textarea {
    min-height: 220px;
    resize: vertical;
    direction: rtl;
    unicode-bidi: plaintext;
}

.admin-dashboard-message-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.admin-dashboard-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #ede9fe;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 950;
}

.admin-dashboard-subtitle {
    margin: 0 0 12px;
    color: var(--text);
    letter-spacing: -0.04em;
}

.admin-dashboard-message-preview {
    max-height: 360px;
}

.admin-dashboard-message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.admin-dashboard-message-actions form {
    margin: 0;
}

@media (max-width: 1200px) {
    .user-dashboard-hero,
    .user-dashboard-grid,
    .admin-dashboard-message-layout,
    .user-notes-layout {
        grid-template-columns: 1fr;
    }

    .user-dashboard-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .user-dashboard-stat-grid,
    .user-dashboard-action-grid,
    .user-notes-grid {
        grid-template-columns: 1fr;
    }

    .user-dashboard-list-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 700px) {
    .branch-graph-canvas-wrap {
        height: 420px;
        min-height: 420px;
    }

    .branch-graph-toolbar,
    .branch-graph-toolbar-actions,
    .branch-graph-toolbar-actions .button,
    .branch-graph-filter {
        width: 100%;
    }

    .branch-graph-toolbar {
        right: 12px;
        align-items: stretch;
        flex-direction: column;
    }

    .branch-graph-status {
        right: 12px;
        bottom: 12px;
        left: 12px;
    }

    .pagination {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Branch graph v3 refinements */
.branch-graph-filter-wrap {
    display: grid;
    gap: 6px;
    min-width: min(420px, calc(100vw - 80px));
    color: #e9d5ff;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.branch-graph-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.branch-graph-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    color: #e5e7eb;
    font: inherit;
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    cursor: pointer;
    transition: 0.16s ease;
}

.branch-graph-filter-pill::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--branch-color, #c4b5fd);
    box-shadow: 0 0 14px var(--branch-color, rgba(196, 181, 253, 0.55));
}

.branch-graph-filter-pill:hover,
.branch-graph-filter-pill.is-active {
    border-color: var(--branch-color, #c4b5fd);
    background: color-mix(in srgb, var(--branch-color, #7c3aed) 26%, rgba(15, 23, 42, 0.82));
    color: white;
    transform: translateY(-1px);
}

.branch-graph-canvas-wrap {
    height: 540px;
    min-height: 540px;
}

.branch-graph-message-box {
    fill: rgba(15, 23, 42, 0.76);
    stroke: rgba(226, 232, 240, 0.16);
    stroke-width: 1;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}

.branch-graph-message {
    fill: #f8fafc;
    font-size: 11px;
    font-weight: 850;
    pointer-events: none;
}

@media (max-width: 700px) {
    .branch-graph-canvas-wrap {
        height: 480px;
        min-height: 480px;
    }

    .branch-graph-filter-wrap,
    .branch-graph-legend {
        width: 100%;
    }
}
