.repository-source { flex: 1; min-height: 0; padding: 16px; display: flex; flex-direction: column; overflow: hidden; background: white; }
.source-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.source-layout { flex: 1; min-height: 250px; display: grid; grid-template-columns: minmax(140px, 30%) minmax(0, 1fr); border: 1px solid #e6e8ed; border-radius: 8px; overflow: hidden; }
#sourceTree { overflow: auto; padding: 8px; border-right: 1px solid #e6e8ed; }
.source-tree-list { padding-left: 14px; margin: 0; list-style: none; }
#sourceTree > .source-tree-list { padding-left: 0; }
.source-tree-node { border: 0; background: transparent; color: var(--ink); padding: 5px; white-space: nowrap; text-align: left; border-radius: 4px; }
.source-tree-node:hover, .source-tree-node.selected { background: #eef0ff; color: var(--brand); }
.source-file { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.source-file-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; background: #f5f6fa; }
#sourceFilePath { overflow-wrap: anywhere; font-size: .85rem; }
#sourceFileContent { flex: 1; overflow: auto; padding: 10px; font-size: .85rem; }
.source-code { margin: 0; overflow: visible; tab-size: 4; }
.source-code code { counter-reset: source-line; }
.source-line { display: block; min-height: 1.5em; white-space: pre; }
.source-line::before { counter-increment: source-line; content: counter(source-line); display: inline-block; width: 4em; padding-right: 1em; text-align: right; color: #8491a3; user-select: none; }
.source-keyword { color: #7c3aed; }
.source-string { color: #087f5b; }
.source-number { color: #b45309; }
.source-image-content { display: flex; flex-direction: column; min-height: 0; }
.source-image-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; flex-shrink: 0; }
.source-image-tools [role="status"] { overflow-wrap: anywhere; }
.source-image-viewport { flex: 1; min-height: 180px; overflow: auto; padding: 16px; background-color: #fff; background-image: linear-gradient(45deg, #e3e5e8 25%, transparent 25%), linear-gradient(-45deg, #e3e5e8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e3e5e8 75%), linear-gradient(-45deg, transparent 75%, #e3e5e8 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.source-image { display: block; max-width: none; image-rendering: pixelated; }
.source-image-expandable { cursor: zoom-in; }
.source-image-expandable:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.source-lightbox { width: 92vw; height: 90dvh; max-width: none; max-height: none; padding: 16px; border: 0; border-radius: 12px; background: #fff; overflow: hidden; }
.source-lightbox::backdrop { background: rgba(0, 0, 0, .78); }
.source-lightbox[open] { display: flex; flex-direction: column; gap: 12px; }
.source-lightbox-close { align-self: flex-end; flex-shrink: 0; }
.source-lightbox-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.source-lightbox .source-image-viewport { min-height: 0; display: flex; }
.source-lightbox .source-image { margin: auto; flex-shrink: 0; }
.source-audio { padding: 16px; }
.source-audio audio { display: block; width: 100%; }
.source-audio audio[hidden] { display: none; }
.repository-source:fullscreen, .repository-source.source-expanded { width: 100%; height: 100%; padding: 20px; }
.repository-source.source-expanded { position: fixed; inset: 0; z-index: 1060; }
@media (max-width: 600px) { .source-layout { grid-template-columns: minmax(110px, 32%) minmax(0, 1fr); } .repository-source { padding: 8px; } }
