:root {
    --bg-color: #000000;
    --pre-bg: #000000;
    --text-color: #ffffff;
    --input-bg: #050505;
    --input-border: #1a1a1a;
    --input-focus: #58a6ff;
    --badge-bg: #0a0a0a;
    --badge-border: #1a1a1a;
    --badge-text: #8be9fd;
    --highlight-bg: rgba(88, 166, 255, 0.12);
    --scrollbar-thumb: #222222;
}

@font-face {
    font-family: "Fira Code";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/fonts/FiraCode-Medium.woff2") format("woff2");
}

@font-face {
    font-family: "Fira Code";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/fonts/FiraCode-Bold.woff2") format("woff2");
}

body.theme_normal {
    --bg-color: #0f1117;
    --pre-bg: #111418;
    --text-color: #e6edf3;
    --input-bg: #161b22;
    --input-border: #30363d;
    --badge-bg: #161b22;
    --badge-border: #30363d;
    --scrollbaexr-thumb: #30363d;
    --highlight-bg: rgba(88, 166, 255, 0.15);
}

body.theme_light {
    --bg-color: #ffffff;
    --pre-bg: #ffffff;
    --text-color: #1f2328;
    --input-bg: #ffffff;
    --input-border: #d0d7de;
    --input-focus: #0969da;
    --badge-bg: #f6f8fa;
    --badge-border: #d0d7de;
    --badge-text: #0969da;
    --highlight-bg: rgba(9, 105, 218, 0.08);
    --scrollbar-thumb: #d0d7de;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 24px 15px 24px 20px;
}

.header {
    width: 100%;
    flex-shrink: 0;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    padding: 0 5px 0 0;
    gap: 16px;
    flex-wrap: wrap;
}

.header_left {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    line-height: 1;
}

.title_link {
    color: inherit;
    text-decoration: none;
}
.title_link:hover {
    text-decoration: underline;
}

.subname {
    font-size: 11px;
    font-family: "Fira Code", monospace;
    color: #8b949e;
    opacity: 0.8;
}

body.theme_light .subname {
    color: #57606a;
}

#search_box {
    padding: 12px 16px;
    width: 320px;
    max-width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    font-family: "Fira Code", monospace;
    font-size: 13px;
    outline: none;
    border-radius: 0;
    font-variant-ligatures: none;
    box-sizing: border-box;
}
#search_box:focus {
    border-color: var(--input-focus);
}

.theme_toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-family: "Fira Code", monospace;
    font-size: 11px;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.6;
    text-transform: lowercase;
    border-radius: 0;
}
.theme_toggle:hover {
    opacity: 1;
    background-color: var(--input-border);
}

.wrapper_container {
    width: 100%;
    flex-grow: 1;
    display: flex;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: auto;
    box-sizing: border-box;
}

.container {
    width: max-content;
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

pre[class*="language-"] {
    background-color: var(--pre-bg) !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 4px 5px 4px 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    overflow: visible !important;
    white-space: pre !important;
    word-wrap: normal !important;
}

code[class*="language-"] {
    font-family: "Fira Code", monospace;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color) !important;
    text-shadow: none !important;
    white-space: pre !important;
    background: none !important;
    display: table;
    width: 100%;
    font-variant-ligatures: none !important;
    font-feature-settings: "liga" 0 !important;
}

.code_line {
    display: table-row;
}

.code_line.category_spacer .code_content,
.code_line.category_spacer .category_badge_container {
    padding-top: 1.8em;
}

.code_line.hidden {
    display: none !important;
}

.code_line.highlight_match {
    background-color: var(--highlight-bg);
}

.code_line.dimmed_match {
    background-color: rgba(255, 255, 255, 0.02);
    opacity: 0.4;
}

body.theme_light .code_line.dimmed_match {
    background-color: rgba(0, 0, 0, 0.02);
    opacity: 0.5;
}

.code_content {
    display: table-cell;
    white-space: pre;
    padding-right: 40px;
}

.category_badge_container {
    display: table-cell;
    vertical-align: middle;
    text-align: left;
    width: 100%;
}

.category_badge {
    display: none;
    background-color: var(--badge-bg);
    color: var(--badge-text);
    border: 1px solid var(--badge-border);
    padding: 2px 8px;
    font-size: 10px;
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    pointer-events: none;
    white-space: nowrap;
    border-radius: 0;
}

body.filtering .category_badge {
    display: inline-block;
}

.bracket_content {
    color: #8b949e !important;
    background: none !important;
}

.hash_bracket_content {
    color: #7ee787 !important;
    background: none !important;
}

body.theme_light .bracket_content {
    color: #57606a !important;
    background: none !important;
}

body.theme_light .hash_bracket_content {
    color: #1a7f37 !important;
    background: none !important;
}

::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--input-border);
}

@media (max-width: 600px) {
    body {
        padding: 12px;
    }
    .header {
        flex-direction: column;
        align-items: stretch;
    }
    #search_box {
        width: 100%;
    }
}