.projects-section {
    padding-top: 0;
}

.projects-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    background: rgba(8, 12, 24, 0.55);
    box-shadow: var(--shadow);
}

.projects-tabs {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.projects-tab {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 16px;
    background: transparent;
    color: #c7d0e0;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.projects-tab.is-active {
    color: white;
    border-color: color-mix(in srgb, var(--primary) 50%, white 10%);
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 38%, transparent), color-mix(in srgb, var(--secondary) 28%, transparent));
}

.projects-tab-panel {
    padding: 18px;
}

.projects-tab-panel[hidden] {
    display: none !important;
}

.project-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.project-card-actions .button {
    flex: 1 1 auto;
    min-width: 120px;
}

.source-browser--static {
    min-height: 420px;
}

.source-tree--static .tree-file-link {
    display: block;
    padding: 6px 8px;
    border-radius: 8px;
    color: #c7d0e0;
    text-decoration: none;
    font-size: 0.82rem;
}

.source-tree--static .tree-file-link.is-active {
    background: color-mix(in srgb, var(--primary) 22%, transparent);
    color: white;
}

.source-tree--static .tree-folder-label {
    display: block;
    padding: 6px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #9aa8be;
}

.source-readme-pair {
    margin-bottom: 16px;
}

.source-static-hint {
    color: var(--muted);
    padding: 24px;
}

.projects-source-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.projects-source-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.projects-source-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #8b95a8;
}

.project-source-select,
.styled-select--project .styled-select-trigger {
    padding: 10px 36px 10px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 700;
}

.source-browser {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    min-height: 520px;
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(8, 12, 24, 0.72);
    box-shadow: var(--shadow);
}

.source-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    padding: 14px 10px 18px;
    overflow: hidden;
}

.source-sidebar-head {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 4px 8px 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
}

.source-sidebar-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.source-sidebar-unchanged[hidden] {
    display: none !important;
}

.source-sidebar-unchanged-summary {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0;
    color: #8b95a8;
}

.source-sidebar-unchanged-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    max-height: 132px;
    overflow-x: hidden;
    overflow-y: auto;
}

.source-sidebar-unchanged-list .source-unchanged-item {
    padding: 4px 6px;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    color: #9aa6bc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-sidebar-unchanged-list .source-unchanged-item.is-markdown-file {
    font-style: italic;
    color: #7ee787;
    opacity: 0.88;
}

.source-sidebar-label,
.source-sidebar-version {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.source-sidebar-version {
    color: color-mix(in srgb, var(--secondary) 70%, white);
}

.source-tree {
    list-style: none;
    margin: 0;
    padding: 0 4px 0 0;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.source-tree li {
    margin: 0;
}

.source-tree button {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: #c7d0e0;
    font: inherit;
    font-size: 0.86rem;
    padding: 6px 8px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-tree button:hover,
.source-tree button.is-active {
    color: white;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 34%, transparent), color-mix(in srgb, var(--secondary) 22%, transparent));
}

.source-tree .tree-children {
    list-style: none;
    margin: 0;
    padding: 0 0 0 10px;
}

.source-tree .tree-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.source-tree .tree-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.source-tree .tree-icon--folder {
    color: #e8b86d;
}

.source-tree .tree-icon--csharp {
    color: #c4a8ff;
}

.source-tree .tree-icon--markdown {
    color: #7ee787;
}

.source-tree .tree-icon--project {
    color: #f5b86a;
}

.source-tree .tree-icon--json {
    color: #7dd3fc;
}

.source-tree .tree-icon--python {
    color: #86d9c8;
}

.source-tree .tree-icon--config {
    color: #94a3b8;
}

.source-tree .tree-icon--file {
    color: #8b95a8;
}

.source-tree .tree-folder-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #d4c4a0;
    cursor: pointer;
}

.source-tree .tree-folder-toggle:hover {
    color: #dce4f4;
    background: rgba(255, 255, 255, 0.05);
}

.source-tree .tree-chevron {
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid #8b95a8;
    transition: transform 0.18s ease;
}

.source-tree .tree-folder.is-expanded .tree-chevron {
    transform: rotate(90deg);
}

.source-tree .tree-folder.is-collapsed .tree-children {
    display: none;
}

.source-tree .tree-label,
.source-tree .tree-file-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-tree .tree-file--csharp .tree-file-label {
    color: #d8c8ff;
}

.source-tree .tree-file--markdown .tree-file-label {
    color: #9ee9b0;
}

.source-tree .tree-file--project .tree-file-label {
    color: #f5d4a8;
}

.source-tree .tree-file--json .tree-file-label {
    color: #a8e4fc;
}

.source-tree .tree-file--python .tree-file-label {
    color: #a8e8dc;
}

.source-tree .tree-file--config .tree-file-label {
    color: #b8c4d4;
}

.source-tree button:hover .tree-icon,
.source-tree button.is-active .tree-icon {
    color: #fff;
}

.source-tree button:hover .tree-file-label,
.source-tree button.is-active .tree-file-label {
    color: #fff;
}

.source-tree .tree-file-change-badge {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 6px;
    flex-shrink: 0;
    letter-spacing: 0;
    line-height: 1.1;
}

.source-tree .tree-file-change-badge--mod {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.source-tree .tree-file-change-badge--new {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.source-tree .tree-file.is-new-file .tree-file-label {
    color: #9ee9b0;
}

.source-tree .tree-folder.has-changed-files > .tree-folder-toggle {
    color: #e2e8f0;
}

.source-tree .tree-folder.has-changed-files > .tree-folder-toggle .tree-chevron {
    border-left-color: #fbbf24; /* yellow chevron for folders with changes */
}

.source-viewer {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.source-file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.source-file-path {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #dce4f4;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-file-changes {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.source-file-changes.status-no-changes {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #f59e0b;
}

.source-file-changes.status-changes {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
}

.source-file-changes.status-new {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.source-tree .tree-folder.has-new-files > .tree-folder-toggle .tree-chevron {
    border-left-color: #34d399;
}


.source-file-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.source-markdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    margin: 0;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, transparent), color-mix(in srgb, var(--secondary) 8%, transparent));
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #8b95a8;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.source-markdown-toggle:has(input:checked) {
    color: #dce4f4;
    border-color: color-mix(in srgb, var(--primary) 50%, white 10%);
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 28%, transparent), color-mix(in srgb, var(--secondary) 18%, transparent));
}

.source-markdown-toggle input {
    accent-color: var(--primary);
    cursor: pointer;
}

.source-changed-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    margin: 0;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, transparent), color-mix(in srgb, var(--secondary) 8%, transparent));
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #8b95a8;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.source-changed-toggle:has(input:checked) {
    color: #dce4f4;
    border-color: color-mix(in srgb, var(--secondary) 50%, white 10%);
    background: linear-gradient(135deg, color-mix(in srgb, var(--secondary) 28%, transparent), color-mix(in srgb, var(--primary) 18%, transparent));
}

.source-changed-toggle[hidden] {
    display: none !important;
}

.source-changed-toggle input {
    accent-color: var(--secondary);
    cursor: pointer;
}

.source-changed-only-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    margin: 0;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--secondary) 30%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--secondary) 12%, transparent), color-mix(in srgb, var(--primary) 8%, transparent));
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #8b95a8;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.source-changed-only-toggle:has(input:checked) {
    color: #dce4f4;
    border-color: color-mix(in srgb, var(--primary) 50%, white 10%);
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 28%, transparent), color-mix(in srgb, var(--secondary) 18%, transparent));
}

.source-changed-only-toggle[hidden] {
    display: none !important;
}

.source-changed-only-toggle input {
    accent-color: var(--primary);
    cursor: pointer;
}

.source-file-lang {
    color: #8b95a8;
    text-transform: uppercase;
    letter-spacing: 0;
    font-size: 0.72rem;
}

.source-markdown-wrap {
    flex: 1;
    overflow: auto;
    padding: 18px 22px 24px;
    min-height: 420px;
    background: #0d1117;
    color: #c5cdd8;
    font-size: 0.9rem;
    line-height: 1.6;
}

.source-markdown-wrap[hidden] {
    display: none !important;
}

.source-markdown-wrap .md-h1 {
    font-size: 1.35rem;
    margin: 0 0 12px;
    color: #f4f7ff;
}

.source-markdown-wrap .md-h2 {
    font-size: 1.08rem;
    margin: 18px 0 8px;
    color: #e8eef8;
}

.source-markdown-wrap .md-h3 {
    font-size: 0.95rem;
    margin: 14px 0 6px;
    color: #dce4f4;
}

.source-markdown-wrap p {
    margin: 0 0 10px;
    color: #b8c2d4;
}

.source-markdown-wrap .md-list {
    margin: 0 0 12px 1.1em;
    padding: 0;
    color: #b8c2d4;
}

.source-markdown-wrap .md-list li {
    margin: 4px 0;
}

.source-markdown-wrap .md-code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 0.84em;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #e5c07b;
}

.source-markdown-wrap .md-pre {
    margin: 10px 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.28);
    overflow: auto;
}

.source-markdown-wrap .md-pre code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre;
}

.source-tree .tree-file.is-markdown-file .tree-file-label {
    font-style: italic;
    opacity: 0.82;
}

.source-tree.is-markdown-hidden .tree-file.is-markdown-file {
    display: none;
}

.source-code-wrap {
    margin: 0;
    flex: 1;
    overflow: auto;
    padding: 0;
    border-radius: 0;
    background: #0d1117;
    min-height: 420px;
}

.source-code-wrap code.source-code {
    display: block;
    margin: 0;
    padding: 0;
    background: transparent;
}

.source-code-wrap .line-numbered {
    counter-reset: source-line;
}

.source-code-wrap .code-line {
    display: block;
    position: relative;
    margin: 0;
    padding: 0 0 0 4.5em;
    line-height: inherit;
}

.source-code-wrap .code-line::before {
    counter-increment: source-line;
    content: counter(source-line);
    position: absolute;
    left: 0;
    top: 0;
    width: 3.35em;
    padding-right: 0.9em;
    text-align: right;
    color: #6e7681;
    user-select: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
}
.syntax,
.code-plain {
    display: block;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 0.92rem;
    line-height: 1.7;
    tab-size: 4;
}

.code-panel pre code.syntax,
.code-panel pre code.code-plain {
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #c5cdd8;
}

.source-code-wrap code.syntax,
.source-code-wrap code.code-plain {
    display: block;
    padding: 12px 18px 18px 0;
    font-size: 0.84rem;
    line-height: 1.4;
    background: transparent;
    color: #c5cdd8;
}

.syntax .cs-modifier,
.source-code-wrap .cs-modifier {
    color: #c678dd; font-weight: 600;
}

.syntax .cs-keyword,
.source-code-wrap .cs-keyword {
    color: #c678dd;
}

.syntax .cs-accessor,
.source-code-wrap .cs-accessor {
    color: #56b6c2; font-weight: 700;
}

.syntax .cs-type-primitive,
.source-code-wrap .cs-type-primitive {
    color: #e5c07b;
}

.syntax .cs-type-builtin,
.source-code-wrap .cs-type-builtin {
    color: #61afef;
}

.syntax .cs-type-user,
.source-code-wrap .cs-type-user {
    color: #e6c07b;
}

.syntax .cs-member,
.source-code-wrap .cs-member {
    color: #61aeee;
}

.syntax .cs-identifier,
.source-code-wrap .cs-identifier {
    color: #abb2bf;
}

.syntax .cs-bracket,
.source-code-wrap .cs-bracket {
    color: #ffffff;
}

.syntax .cs-operator,
.source-code-wrap .cs-operator {
    color: #f472b6;
}

.syntax .cs-string,
.source-code-wrap .cs-string {
    color: #98c379;
}

.syntax .cs-number,
.source-code-wrap .cs-number {
    color: #d19a66;
}

.syntax .cs-literal,
.source-code-wrap .cs-literal {
    color: #d19a66;
}

.syntax .cs-comment,
.source-code-wrap .cs-comment {
    color: #5c6370; font-style: italic;
}

.syntax .cs-doc-marker,
.source-code-wrap .cs-doc-marker {
    color: #8b9cb3; font-style: italic;
}

.syntax .cs-doc-bracket,
.source-code-wrap .cs-doc-bracket {
    color: #ffffff; font-weight: 600;
}

.syntax .cs-doc-tag,
.source-code-wrap .cs-doc-tag {
    color: #7ee8ff; font-weight: 700;
}

.syntax .cs-doc-attr,
.source-code-wrap .cs-doc-attr {
    color: #f0c97a; font-weight: 600;
}

.syntax .cs-doc-value,
.source-code-wrap .cs-doc-value {
    color: #b8f0c8;
}

.syntax .cs-doc-text,
.source-code-wrap .cs-doc-text {
    color: #e2ebf8;
}

.syntax .cs-attribute,
.source-code-wrap .cs-attribute {
    color: #d7a6ff;
}

.syntax .xml-bracket,
.source-code-wrap .xml-bracket {
    color: #ffffff;
}

.syntax .xml-tag,
.source-code-wrap .xml-tag {
    color: #61afef; font-weight: 600;
}

.syntax .xml-attr,
.source-code-wrap .xml-attr {
    color: #e5c07b;
}

.syntax .xml-value,
.source-code-wrap .xml-value {
    color: #98c379;
}

.syntax .html-bracket,
.source-code-wrap .html-bracket {
    color: #ffffff;
}

.syntax .html-tag,
.source-code-wrap .html-tag {
    color: #61afef;
    font-weight: 600;
}

.syntax .html-attr,
.source-code-wrap .html-attr {
    color: #e5c07b;
}

.syntax .html-value,
.source-code-wrap .html-value {
    color: #98c379;
}

.syntax .html-comment,
.source-code-wrap .html-comment {
    color: #5c6370;
    font-style: italic;
}

.syntax .html-doctype,
.source-code-wrap .html-doctype {
    color: #c678dd;
    font-style: italic;
}

.syntax .css-comment,
.source-code-wrap .css-comment {
    color: #5c6370;
    font-style: italic;
}

.syntax .css-selector,
.source-code-wrap .css-selector {
    color: #e5c07b;
    font-weight: 600;
}

.syntax .css-property,
.source-code-wrap .css-property {
    color: #56b6c2;
}

.syntax .css-value,
.source-code-wrap .css-value {
    color: #98c379;
}

.syntax .css-string,
.source-code-wrap .css-string {
    color: #98c379;
}

.syntax .css-at-rule,
.source-code-wrap .css-at-rule {
    color: #c678dd;
    font-weight: 600;
}

.syntax .css-bracket,
.source-code-wrap .css-bracket {
    color: #ffffff;
}

.syntax .razor-marker,
.source-code-wrap .razor-marker {
    color: #c678dd;
    font-weight: 700;
}

.syntax .razor-directive,
.source-code-wrap .razor-directive {
    color: #56b6c2;
    font-weight: 700;
}

.syntax .razor-keyword,
.source-code-wrap .razor-keyword {
    color: #61afef;
}

.syntax .razor-bracket,
.source-code-wrap .razor-bracket {
    color: #f472b6;
    font-weight: 600;
}

.syntax .json-key,
.source-code-wrap .json-key {
    color: #e5c07b;
}

.syntax .json-string,
.source-code-wrap .json-string {
    color: #98c379;
}

.syntax .json-number,
.source-code-wrap .json-number {
    color: #d19a66;
}

.syntax .json-literal,
.source-code-wrap .json-literal {
    color: #c678dd;
}

.syntax .json-bracket,
.source-code-wrap .json-bracket {
    color: #ffffff;
}