@font-face {
    font-family: 'IosevkaNerdFontMono';
    src: local('Iosevka NFM'), local('IosevkaNFM'), local('Iosevka Nerd Font Mono'),
         url('/fonts/IosevkaNerdFontMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IosevkaNerdFontMono';
    src: local('Iosevka NFM Bold'), local('IosevkaNFM-Bold'), local('Iosevka Nerd Font Mono Bold'),
         url('/fonts/IosevkaNerdFontMono-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IosevkaNerdFontMono';
    src: local('Iosevka NFM Italic'), local('IosevkaNFM-Italic'), local('Iosevka Nerd Font Mono Italic'),
         url('/fonts/IosevkaNerdFontMono-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root {
    --bg: #1a1b26;
    --bg-secondary: #1f2335;
    --bg-tertiary: #292e42;
    --fg: #c0caf5;
    --fg-muted: #a9b1d6;
    --fg-subtle: #565f89;
    --border: #292e42;
    --link: #7aa2f7;
    --link-hover: #7dcfff;
    --green: #9ece6a;
    --red: #f7768e;
    --yellow: #e0af68;
    --orange: #ff9e64;
    --purple: #bb9af7;
    --cyan: #7dcfff;

    --ml-base: #1f2335;
    --ml-mid: #3b4261;
    --ml-accent: #7aa2f7;
    --ml-accent-fg: #1a1b26;

    --tok-keyword: #bb9af7;
    --tok-type:    #2ac3de;
    --tok-builtin: #7aa2f7;
    --tok-number:  #ff9e64;
    --tok-string:  #9ece6a;
    --tok-char:    #9ece6a;
    --tok-comment: #565f89;
    --tok-preproc: #7dcfff;
    --tok-op:      #89ddff;
    --tok-punct:   #a9b1d6;
}

/* themes. :root above is tokyonight, the default. each block below only has
   to override the tokens it changes; everything else falls through. the
   theme cookie sets data-theme on <html>, and the preview cards on the theme
   page set it on themselves, so a card always shows its own colours */

/* the tokyonight st palette: same 16 ansi colours, but on a pure black
   background with a gray90 foreground, bright black for borders and the
   terminal's #555555 as the dim text colour */
[data-theme="tokyonight-black"] {
    --bg: #000000;
    --bg-secondary: #15161e;
    --bg-tertiary: #15161e;
    --fg: #e5e5e5;
    --fg-muted: #c0caf5;
    --fg-subtle: #555555;
    --border: #414868;
    --link: #7aa2f7;
    --link-hover: #7dcfff;
    --green: #9ece6a;
    --red: #f7768e;
    --yellow: #e0af68;
    --orange: #ff9e64;
    --purple: #bb9af7;
    --cyan: #7dcfff;

    --ml-base: #15161e;
    --ml-mid: #414868;
    --ml-accent: #7aa2f7;
    --ml-accent-fg: #000000;

    --tok-keyword: #bb9af7;
    --tok-type:    #7dcfff;
    --tok-builtin: #7aa2f7;
    --tok-number:  #ff9e64;
    --tok-string:  #9ece6a;
    --tok-char:    #9ece6a;
    --tok-comment: #555555;
    --tok-preproc: #7dcfff;
    --tok-op:      #7dcfff;
    --tok-punct:   #a9b1d6;
}

/* catppuccin mocha */
[data-theme="catppuccin-mocha"] {
    --bg: #1e1e2e;
    --bg-secondary: #181825;
    --bg-tertiary: #313244;
    --fg: #cdd6f4;
    --fg-muted: #bac2de;
    --fg-subtle: #6c7086;
    --border: #313244;
    --link: #89b4fa;
    --link-hover: #89dceb;
    --green: #a6e3a1;
    --red: #f38ba8;
    --yellow: #f9e2af;
    --orange: #fab387;
    --purple: #cba6f7;
    --cyan: #94e2d5;

    --ml-base: #181825;
    --ml-mid: #45475a;
    --ml-accent: #89b4fa;
    --ml-accent-fg: #1e1e2e;

    --tok-keyword: #cba6f7;
    --tok-type:    #f9e2af;
    --tok-builtin: #89b4fa;
    --tok-number:  #fab387;
    --tok-string:  #a6e3a1;
    --tok-char:    #94e2d5;
    --tok-comment: #6c7086;
    --tok-preproc: #f5c2e7;
    --tok-op:      #89dceb;
    --tok-punct:   #9399b2;
}

/* catppuccin latte, the one light theme */
[data-theme="catppuccin-latte"] {
    --bg: #eff1f5;
    --bg-secondary: #e6e9ef;
    --bg-tertiary: #ccd0da;
    --fg: #4c4f69;
    --fg-muted: #5c5f77;
    --fg-subtle: #8c8fa1;
    --border: #ccd0da;
    --link: #1e66f5;
    --link-hover: #04a5e5;
    --green: #40a02b;
    --red: #d20f39;
    --yellow: #df8e1d;
    --orange: #fe640b;
    --purple: #8839ef;
    --cyan: #179299;

    --ml-base: #e6e9ef;
    --ml-mid: #bcc0cc;
    --ml-accent: #1e66f5;
    --ml-accent-fg: #eff1f5;

    --tok-keyword: #8839ef;
    --tok-type:    #df8e1d;
    --tok-builtin: #1e66f5;
    --tok-number:  #fe640b;
    --tok-string:  #40a02b;
    --tok-char:    #179299;
    --tok-comment: #8c8fa1;
    --tok-preproc: #ea76cb;
    --tok-op:      #04a5e5;
    --tok-punct:   #7c7f93;
}

/* gruvbox dark (medium contrast) */
[data-theme="gruvbox-dark"] {
    --bg: #282828;
    --bg-secondary: #1d2021;
    --bg-tertiary: #3c3836;
    --fg: #ebdbb2;
    --fg-muted: #d5c4a1;
    --fg-subtle: #928374;
    --border: #3c3836;
    --link: #83a598;
    --link-hover: #8ec07c;
    --green: #b8bb26;
    --red: #fb4934;
    --yellow: #fabd2f;
    --orange: #fe8019;
    --purple: #d3869b;
    --cyan: #8ec07c;

    --ml-base: #1d2021;
    --ml-mid: #504945;
    --ml-accent: #83a598;
    --ml-accent-fg: #282828;

    --tok-keyword: #fb4934;
    --tok-type:    #fabd2f;
    --tok-builtin: #83a598;
    --tok-number:  #d3869b;
    --tok-string:  #b8bb26;
    --tok-char:    #b8bb26;
    --tok-comment: #928374;
    --tok-preproc: #8ec07c;
    --tok-op:      #d5c4a1;
    --tok-punct:   #a89984;
}

/* nord */
[data-theme="nord"] {
    --bg: #2e3440;
    --bg-secondary: #3b4252;
    --bg-tertiary: #434c5e;
    --fg: #eceff4;
    --fg-muted: #d8dee9;
    --fg-subtle: #7b88a1;
    --border: #434c5e;
    --link: #88c0d0;
    --link-hover: #8fbcbb;
    --green: #a3be8c;
    --red: #bf616a;
    --yellow: #ebcb8b;
    --orange: #d08770;
    --purple: #b48ead;
    --cyan: #8fbcbb;

    --ml-base: #3b4252;
    --ml-mid: #4c566a;
    --ml-accent: #88c0d0;
    --ml-accent-fg: #2e3440;

    --tok-keyword: #81a1c1;
    --tok-type:    #8fbcbb;
    --tok-builtin: #88c0d0;
    --tok-number:  #b48ead;
    --tok-string:  #a3be8c;
    --tok-char:    #a3be8c;
    --tok-comment: #616e88;
    --tok-preproc: #81a1c1;
    --tok-op:      #81a1c1;
    --tok-punct:   #eceff4;
}

/* dracula */
[data-theme="dracula"] {
    --bg: #282a36;
    --bg-secondary: #21222c;
    --bg-tertiary: #343746;
    --fg: #f8f8f2;
    --fg-muted: #c3c5d6;
    --fg-subtle: #6272a4;
    --border: #44475a;
    --link: #8be9fd;
    --link-hover: #bd93f9;
    --green: #50fa7b;
    --red: #ff5555;
    --yellow: #f1fa8c;
    --orange: #ffb86c;
    --purple: #bd93f9;
    --cyan: #8be9fd;

    --ml-base: #21222c;
    --ml-mid: #44475a;
    --ml-accent: #bd93f9;
    --ml-accent-fg: #282a36;

    --tok-keyword: #ff79c6;
    --tok-type:    #8be9fd;
    --tok-builtin: #bd93f9;
    --tok-number:  #bd93f9;
    --tok-string:  #f1fa8c;
    --tok-char:    #f1fa8c;
    --tok-comment: #6272a4;
    --tok-preproc: #ff79c6;
    --tok-op:      #ff79c6;
    --tok-punct:   #f8f8f2;
}

/* rosé pine (main). it has no green, so additions use foam like the
   upstream vim theme does */
[data-theme="rose-pine"] {
    --bg: #191724;
    --bg-secondary: #1f1d2e;
    --bg-tertiary: #26233a;
    --fg: #e0def4;
    --fg-muted: #908caa;
    --fg-subtle: #6e6a86;
    --border: #403d52;
    --link: #c4a7e7;
    --link-hover: #9ccfd8;
    --green: #9ccfd8;
    --red: #eb6f92;
    --yellow: #f6c177;
    --orange: #ebbcba;
    --purple: #c4a7e7;
    --cyan: #9ccfd8;

    --ml-base: #1f1d2e;
    --ml-mid: #403d52;
    --ml-accent: #c4a7e7;
    --ml-accent-fg: #191724;

    --tok-keyword: #31748f;
    --tok-type:    #9ccfd8;
    --tok-builtin: #c4a7e7;
    --tok-number:  #ebbcba;
    --tok-string:  #f6c177;
    --tok-char:    #f6c177;
    --tok-comment: #6e6a86;
    --tok-preproc: #eb6f92;
    --tok-op:      #908caa;
    --tok-punct:   #908caa;
}

/* caelus. the tokens follow its vis theme: keywords red, types and
   constants cyan, identifiers blue, numbers magenta, strings green,
   comments the light gray, and operators / preprocessor in the plain fg.
   the modeline accent is the focused status bar colour from the same file */
[data-theme="caelus"] {
    --bg: #0f0f0f;
    --bg-secondary: #141514;
    --bg-tertiary: #272a28;
    --fg: #b6b69a;
    --fg-muted: #9a9c8b;
    --fg-subtle: #6c756f;
    --border: #272a28;
    --link: #71a1d6;
    --link-hover: #accae7;
    --green: #7ec97e;
    --red: #f16e65;
    --yellow: #efbf71;
    --orange: #ef934d;
    --purple: #e28dc6;
    --cyan: #6fc3b5;

    --ml-base: #1e1f1e;
    --ml-mid: #3b403c;
    --ml-accent: #9a9c8b;
    --ml-accent-fg: #1e1f1e;

    --tok-keyword: #f16e65;
    --tok-type:    #6fc3b5;
    --tok-builtin: #71a1d6;
    --tok-number:  #e28dc6;
    --tok-string:  #7ec97e;
    --tok-char:    #7ec97e;
    --tok-comment: #9a9c8b;
    --tok-preproc: #b6b69a;
    --tok-op:      #b6b69a;
    --tok-punct:   #b6b69a;
}

.t-kw  { color: var(--tok-keyword); }
.t-ty  { color: var(--tok-type); }
.t-bi  { color: var(--tok-builtin); }
.t-num { color: var(--tok-number); }
.t-str { color: var(--tok-string); }
.t-chr { color: var(--tok-char); }
.t-cmt { color: var(--tok-comment); font-style: italic; }
.t-pp  { color: var(--tok-preproc); }
.t-op  { color: var(--tok-op); }
.t-pun { color: var(--tok-punct); }

.code-block {
    margin: 1rem 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.code-lang {
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    color: var(--fg-subtle);
    font-size: 0.75rem;
}

pre.code {
    margin: 0;
    padding: 0.85rem 1rem;
    background: var(--bg-secondary);
    border-radius: 0;
    overflow-x: auto;
    line-height: 1.45;
    tab-size: 4;
    -moz-tab-size: 4;
}

pre.code code {
    background: none;
    padding: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 17px;
}

body {
    font-family: 'IosevkaNerdFontMono', ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 2.5rem;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

header .logo {
    font-weight: bold;
    font-size: 1.1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-right a {
    color: var(--fg-muted);
}

.nav-right a:hover {
    color: var(--fg);
}

.inline-form {
    display: inline;
}

.link-button {
    background: none;
    border: none;
    color: var(--fg-muted);
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.link-button:hover {
    color: var(--fg);
    text-decoration: underline;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.theme-card {
    display: block;
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg);
    color: var(--fg);
}

.theme-card:hover {
    border-color: var(--fg-subtle);
}

.theme-card:has(input:checked) {
    border-color: var(--link);
}

.theme-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.theme-card-name {
    font-weight: 600;
}

.theme-card-top .link {
    color: var(--link);
    font-size: 0.85rem;
}

.theme-card pre {
    margin: 0;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    font-size: 0.85rem;
    line-height: 1.5;
    overflow: hidden;
}

.theme-card-bar {
    display: flex;
    font-size: 0.75rem;
    line-height: 1.6;
}

.theme-card-bar span {
    padding: 0 0.6rem;
}

.theme-card-bar .a { background: var(--ml-accent); color: var(--ml-accent-fg); font-weight: 600; }
.theme-card-bar .b { background: var(--ml-mid);    color: var(--fg); }
.theme-card-bar .c { background: var(--ml-base);   color: var(--fg-muted); flex: 1; }

.theme-swatches {
    display: flex;
    gap: 0.3rem;
    padding: 0 0.75rem 0.6rem;
}

.theme-swatches i {
    width: 1rem;
    height: 1rem;
    border-radius: 2px;
}

main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

footer.modeline {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: var(--bg);
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.8;
    overflow: hidden;
}

.ml-row {
    display: flex;
    align-items: stretch;
    white-space: nowrap;
}

.ml-a, .ml-b, .ml-c {
    padding: 0 0.6rem;
}

.ml-a {
    background: var(--ml-accent);
    color: var(--ml-accent-fg);
    font-weight: 700;
}

.ml-b {
    background: var(--ml-mid);
    color: var(--fg-muted);
}

.ml-c {
    background: var(--ml-base);
    color: var(--fg-muted);
}

.ml-fill {
    flex: 1;
    background: var(--bg);
    min-width: 1rem;
}

.ml-sep::before {
    display: inline-block;
}

.ml-fwd::before { content: "\e0b0"; }
.ml-bwd::before { content: "\e0b2"; }

.sep-a-b   { color: var(--ml-accent); background: var(--ml-mid); }
.sep-b-c   { color: var(--ml-mid);    background: var(--ml-base); }
.sep-c-bar { color: var(--ml-base);   background: var(--bg); }
.sep-bar-c { color: var(--ml-base);   background: var(--bg); }
.sep-c-b   { color: var(--ml-mid);    background: var(--ml-base); }
.sep-b-a   { color: var(--ml-accent); background: var(--ml-mid); }

h1, h2, h3 {
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; color: var(--fg-muted); }
h3 { font-size: 1.1rem; }

.empty {
    color: var(--fg-muted);
    padding: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    text-align: left;
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-secondary);
    color: var(--fg-muted);
    font-weight: 600;
}

tbody tr:hover {
    background: var(--bg-secondary);
}

.stacked-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 2rem;
}

label {
    color: var(--fg-muted);
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="search"],
select,
textarea {
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.6rem 0.75rem;
    width: 100%;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--link);
}

textarea {
    resize: vertical;
    line-height: 1.5;
    tab-size: 4;
    -moz-tab-size: 4;
}

button[type="submit"] {
    align-self: flex-start;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-tertiary);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    margin-top: 0.25rem;
}

button[type="submit"]:hover {
    background: var(--border);
    border-color: var(--fg-subtle);
}

.auth-form {
    max-width: 560px;
    margin: 2rem auto;
}

.auth-alt {
    margin-top: 1.5rem;
    color: var(--fg-muted);
    font-size: 0.9rem;
}

.form-errors {
    list-style: none;
    background: color-mix(in srgb, var(--red) 10%, transparent);
    border: 1px solid var(--red);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    color: var(--red);
}

.form-errors li {
    margin: 0.2rem 0;
}

.notice {
    background: color-mix(in srgb, var(--green) 10%, transparent);
    border: 1px solid var(--green);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    color: var(--green);
}

.danger-zone {
    margin-top: 3rem;
    border-top: 1px solid var(--red);
}

.danger-zone h2 {
    color: var(--red);
    margin-top: 1.5rem;
}

.error {
    text-align: center;
    padding: 4rem 2rem;
}

.error h1 {
    color: var(--red);
}

.muted {
    color: var(--fg-subtle);
}

.button-link {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.35rem 1rem;
    font-size: 0.9rem;
}

.button-link:hover {
    background: var(--border);
    border-color: var(--fg-subtle);
    text-decoration: none;
}

.blob {
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow-x: auto;
    background: var(--bg-secondary);
}

table.code {
    margin: 0;
    line-height: 1.45;
    tab-size: 4;
    -moz-tab-size: 4;
}

table.code td {
    border: none;
    padding: 0 0.75rem;
    white-space: pre;
}

table.code tbody tr:hover {
    background: var(--bg-tertiary);
}

table.code .line-num {
    width: 1%;
    text-align: right;
    user-select: none;
}

table.code .line-num a {
    color: var(--fg-subtle);
}

table.code tr:target {
    background: var(--bg-tertiary);
}

.readme img {
    max-width: 100%;
    height: auto;
}

.readme pre {
    background: var(--bg-secondary);
    padding: 0.85rem 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.readme p,
.readme ul,
.readme ol {
    margin: 0.75rem 0;
}

.readme ul,
.readme ol {
    padding-left: 1.5rem;
}

.readme code {
    background: var(--bg-secondary);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

.readme pre code {
    padding: 0;
}

.readme .plain {
    white-space: pre-wrap;
}

.key-fp {
    color: var(--fg-subtle);
    font-size: 0.9rem;
}

.stacked-form .hint {
    color: var(--fg-subtle);
    font-size: 0.85rem;
}

/* classic layout: old github's structure on this theme */

.octicon {
    display: inline-block;
    vertical-align: text-bottom;
    fill: currentColor;
    flex: none;
}

.octicon-space {
    display: inline-block;
    width: 16px;
}

.text-green { color: var(--green); }
.text-red   { color: var(--red); }

header .logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.header-search {
    flex: 1;
    max-width: 380px;
    margin-right: auto;
}

.header-search input[type="search"] {
    padding: 0.35rem 0.7rem;
    font-size: 0.9rem;
    background: var(--bg);
}

.notice-error {
    background: color-mix(in srgb, var(--red) 10%, transparent);
    border-color: var(--red);
    color: var(--red);
}

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.35rem 0.9rem;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--fg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.btn:hover,
button.btn:hover {
    background: var(--ml-mid);
    border-color: var(--fg-subtle);
    color: var(--fg);
    text-decoration: none;
}

.btn-sm,
button.btn-sm {
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
}

.btn-primary,
button.btn-primary {
    background: var(--green);
    border-color: var(--green);
    color: var(--bg);
    font-weight: bold;
}

.btn-primary:hover,
button.btn-primary:hover {
    background: var(--green);
    color: var(--bg);
    filter: brightness(1.12);
}

summary.btn {
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

.counter {
    display: inline-block;
    min-width: 1.4em;
    padding: 0 0.45rem;
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
    color: var(--fg-muted);
    background: var(--bg-tertiary);
    border-radius: 2em;
}

.box {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    margin-bottom: 1.25rem;
}

.box-header {
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    border-radius: 4px 4px 0 0;
}

.box-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
}

.box-body {
    padding: 1rem;
}

.box-body p {
    margin: 0.5rem 0;
}

.box-row {
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border);
}

.box-header + .box-row {
    border-top: none;
}

/* repo page head and tabs */

.pagehead {
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.repo-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1.35rem;
    font-weight: normal;
    margin-bottom: 1rem;
}

.repo-title .octicon {
    color: var(--fg-subtle);
}

.path-divider {
    color: var(--fg-subtle);
}

.reponav,
.tabnav {
    display: flex;
    flex-wrap: wrap;
}

.reponav {
    margin-bottom: -1px;
}

.reponav a,
.tabnav a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    color: var(--fg-muted);
    border: 1px solid transparent;
    border-top: 3px solid transparent;
    border-radius: 4px 4px 0 0;
}

.reponav a:hover,
.tabnav a:hover {
    color: var(--fg);
    text-decoration: none;
}

.reponav a.selected,
.tabnav a.selected {
    color: var(--fg);
    background: var(--bg);
    border-color: var(--border) var(--border) var(--bg);
    border-top-color: var(--orange);
}

.tabnav {
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.tabnav a {
    margin-bottom: -1px;
}

.repo-description {
    color: var(--fg-muted);
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.numbers-summary {
    display: flex;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.numbers-summary li {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem;
    color: var(--fg-muted);
}

.numbers-summary li + li {
    border-left: 1px solid var(--border);
}

.numbers-summary a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--fg-muted);
}

.numbers-summary strong {
    color: var(--fg);
}

/* branch menu, breadcrumb, clone */

.file-navigation {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.file-navigation-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    font-size: 1.05rem;
}

.select-menu {
    position: relative;
    display: inline-block;
}

.select-menu-modal {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    min-width: 280px;
    max-height: 380px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.select-menu-right .select-menu-modal {
    left: auto;
    right: 0;
}

.select-menu-header,
.select-menu-divider {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--fg-muted);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.select-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    color: var(--fg);
    border-bottom: 1px solid var(--border);
}

.select-menu-item:last-child {
    border-bottom: none;
}

.select-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--fg);
    text-decoration: none;
}

.select-menu-item.selected {
    font-weight: bold;
}

.clone-menu {
    min-width: 440px;
}

.clone-menu input[type="text"] {
    display: block;
    width: calc(100% - 1.5rem);
    margin: 0.6rem 0.75rem;
    font-size: 0.85rem;
}

/* file list */

.file-wrap {
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.commit-tease {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: color-mix(in srgb, var(--link) 8%, transparent);
    border-bottom: 1px solid var(--border);
    min-width: 0;
}

.commit-tease-standalone {
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.commit-author {
    font-weight: bold;
    white-space: nowrap;
}

.commit-tease .commit-message {
    color: var(--fg-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.commit-tease-meta {
    margin-left: auto;
    color: var(--fg-subtle);
    font-size: 0.9rem;
    white-space: nowrap;
}

table.files {
    margin: 0;
    table-layout: fixed;
}

table.files td {
    padding: 0.4rem 0.75rem;
    border-bottom: none;
    border-top: 1px solid var(--border);
}

table.files tr:first-child td {
    border-top: none;
}

table.files .icon {
    width: 2.5rem;
    padding-right: 0;
}

table.files .icon .octicon-file-directory-fill {
    color: var(--link);
}

table.files .icon .octicon-file {
    color: var(--fg-subtle);
}

table.files .content {
    width: 30%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

table.files .content a {
    color: var(--fg);
}

table.files .content a:hover {
    color: var(--link);
}

table.files .message {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

table.files .message a {
    color: var(--fg-subtle);
}

table.files .message a:hover {
    color: var(--link);
}

table.files .age {
    width: 9rem;
    text-align: right;
    color: var(--fg-subtle);
    white-space: nowrap;
}

/* readme */

.readme {
    padding: 1.5rem 2rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.readme > :first-child {
    margin-top: 0;
}

.readme h1,
.readme h2 {
    color: var(--fg);
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border);
    margin: 1.5rem 0 1rem;
}

.readme h3,
.readme h4 {
    margin: 1.25rem 0 0.75rem;
}

.readme blockquote {
    padding: 0 1rem;
    color: var(--fg-muted);
    border-left: 4px solid var(--border);
    margin: 1rem 0;
}

.readme hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 1.5rem 0;
}

.readme table {
    width: auto;
}

.readme th,
.readme td {
    border: 1px solid var(--border);
    padding: 0.35rem 0.8rem;
}

.readme details {
    margin: 0.75rem 0;
}

.readme summary {
    cursor: pointer;
}

/* file view */

.file-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    border-radius: 4px 4px 0 0;
}

.file-info {
    color: var(--fg-muted);
    font-size: 0.9rem;
}

.file-actions {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

.file-box .blob {
    border: none;
    border-radius: 0 0 4px 4px;
}

.file-box > .empty {
    padding: 2rem 1rem;
    text-align: center;
}

.image-preview {
    padding: 1.5rem;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
}

/* history and commits */

.commit-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--fg-muted);
}

.commit-group {
    list-style: none;
}

.commit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--border);
}

.commit-row:first-child {
    border-top: none;
}

.commit-row-main {
    min-width: 0;
}

.commit-row .commit-message {
    color: var(--fg);
    font-weight: bold;
}

.commit-row-meta {
    color: var(--fg-muted);
    font-size: 0.85rem;
}

.commit-row-links {
    display: flex;
    gap: 0.4rem;
}

.btn.sha {
    color: var(--link);
}

.full-commit-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
    font-size: 1.15rem;
    font-weight: bold;
    background: color-mix(in srgb, var(--link) 8%, transparent);
    border-radius: 4px 4px 0 0;
}

.full-commit-body {
    padding: 0 1rem 0.75rem;
    font-family: inherit;
    white-space: pre-wrap;
    background: color-mix(in srgb, var(--link) 8%, transparent);
}

.full-commit-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: var(--fg-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

.full-commit-meta strong,
.full-commit-meta code {
    color: var(--fg);
}

/* diffs */

.diff-stats {
    margin: 1rem 0;
    color: var(--fg-muted);
}

.diff-stats strong {
    color: var(--fg);
}

.diff-stats .text-green { color: var(--green); }
.diff-stats .text-red   { color: var(--red); }

.diff-file > summary.file-header {
    cursor: pointer;
    list-style: none;
    position: sticky;
    top: 0;
    z-index: 5;
}

.diff-file:not([open]) > summary.file-header {
    border-bottom: none;
    border-radius: 4px;
}

.diffstat {
    font-size: 0.85rem;
    white-space: nowrap;
}

.diff-scroll {
    overflow-x: auto;
}

table.diff-table {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    tab-size: 4;
    -moz-tab-size: 4;
}

table.diff-table td {
    border: none;
    padding: 0 0.6rem;
    white-space: pre;
}

table.diff-table .num {
    width: 1%;
    min-width: 3.2rem;
    text-align: right;
    color: var(--fg-subtle);
    user-select: none;
}

table.diff-table .line {
    width: 100%;
}

table.diff-table tbody tr:hover {
    background: none;
}

.d-add td       { background: color-mix(in srgb, var(--green) 10%, transparent); }
.d-add td.num   { background: color-mix(in srgb, var(--green) 18%, transparent); }
.d-del td       { background: color-mix(in srgb, var(--red) 10%, transparent); }
.d-del td.num   { background: color-mix(in srgb, var(--red) 18%, transparent); }
.d-hunk td      { background: color-mix(in srgb, var(--link) 10%, transparent); color: var(--fg-muted); }
.d-meta td      { color: var(--fg-subtle); }

/* pull request list */

.subnav {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.list-header {
    display: flex;
    gap: 1.25rem;
}

.list-header a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--fg-muted);
}

.list-header a.selected {
    color: var(--fg);
    font-weight: bold;
}

.list-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.list-row:hover {
    background: var(--bg-secondary);
}

.list-row-icon {
    padding-top: 0.2rem;
}

.list-row-main {
    flex: 1;
    min-width: 0;
}

.list-row-title {
    color: var(--fg);
    font-weight: bold;
    font-size: 1.05rem;
}

.list-row-meta {
    color: var(--fg-muted);
    font-size: 0.85rem;
}

.list-row-comments {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--fg-muted);
}

.state-open   { color: var(--green); }
.state-merged { color: var(--purple); }
.state-closed { color: var(--red); }

.blankslate {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--fg-muted);
}

.blankslate .octicon {
    width: 32px;
    height: 32px;
}

.blankslate h3 {
    margin: 0.75rem 0 0;
}

.pull-help {
    margin-top: 1.5rem;
    color: var(--fg-muted);
}

.pull-help summary {
    cursor: pointer;
    color: var(--fg-subtle);
}

.pull-help p {
    margin: 0.75rem 0 0.5rem;
}

/* pull request page */

.gh-header {
    margin-bottom: 1rem;
}

.gh-header-title {
    font-size: 1.8rem;
    font-weight: normal;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
}

.gh-header-number {
    color: var(--fg-subtle);
}

.gh-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--fg-muted);
}

.gh-header-meta strong {
    color: var(--fg);
}

.state {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 2em;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--bg);
}

.state.state-open   { background: var(--green); color: var(--bg); }
.state.state-merged { background: var(--purple); color: var(--bg); }
.state.state-closed { background: var(--red); color: var(--bg); }

.commit-ref {
    padding: 0.1rem 0.4rem;
    color: var(--link);
    background: color-mix(in srgb, var(--link) 12%, transparent);
    border-radius: 3px;
}

.timeline {
    position: relative;
    z-index: 0;
    max-width: 1100px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 2rem;
    border-left: 2px solid var(--border);
    z-index: -1;
}

.timeline-comment {
    display: block;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    margin-bottom: 1.25rem;
}

.timeline-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--fg-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    border-radius: 4px 4px 0 0;
}

.timeline-comment-header strong {
    color: var(--fg);
}

.timeline-label {
    padding: 0 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 2em;
}

.timeline-comment-body {
    padding: 1rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.6;
}

.timeline-event {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1.25rem 1rem;
    color: var(--fg-muted);
}

.timeline-event strong {
    color: var(--fg);
}

.event-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: var(--fg-muted);
    background: var(--bg-tertiary);
}

.event-merged .event-badge { background: var(--purple); color: var(--bg); }
.event-closed .event-badge { background: var(--red); color: var(--bg); }

.merge-box {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
}

.merge-ff,
.merge-merge {
    border-color: var(--green);
}

.merge-conflict {
    border-color: var(--red);
}

.merge-box-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    color: var(--bg);
    background: var(--red);
}

.merge-ff .merge-box-icon,
.merge-merge .merge-box-icon {
    background: var(--green);
}

.merge-box-main h3 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.merge-box-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.comment-form textarea {
    display: block;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 0 0 4px 4px;
}

.sign-in-to-comment {
    margin: 0 0 1.25rem 1rem;
}

/* home, profile, repo lists */

.page-title {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.page-title h2 {
    margin: 0;
    color: var(--fg);
    font-weight: normal;
}

.repo-list {
    list-style: none;
}

.repo-list-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.repo-list-item h3 {
    font-weight: normal;
    font-size: 1.2rem;
    margin-bottom: 0.35rem;
}

.repo-list-description {
    color: var(--fg-muted);
    margin-bottom: 0.5rem;
}

.repo-list-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--fg-subtle);
    font-size: 0.85rem;
}

.profile {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
}

.profile-name {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    overflow-wrap: anywhere;
}

.profile-details {
    list-style: none;
}

.profile-details li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    color: var(--fg-muted);
}

.profile-main .repo-list-item:first-child {
    padding-top: 0.25rem;
}

@media (max-width: 760px) {
    .profile {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .header-search {
        order: 3;
        max-width: none;
        flex-basis: 100%;
    }

    table.files .message,
    .commit-tease .commit-message {
        display: none;
    }

    table.files .content {
        width: auto;
    }

    .numbers-summary {
        flex-direction: column;
    }

    .numbers-summary li + li {
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .clone-menu {
        min-width: 300px;
    }
}

/* in-repo search, file finder */
.repo-search input[type="search"] {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    width: 12rem;
}

.repo-search-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
}

.repo-search-page input[type="search"] {
    width: 24rem;
    max-width: 100%;
}

.search-file .box-header h3 {
    font-weight: normal;
}

table.search-hits td {
    border: none;
    padding: 0 0.75rem;
    white-space: pre-wrap;
}

table.search-hits mark {
    background: color-mix(in srgb, var(--yellow, #e0af68) 35%, transparent);
    color: inherit;
}

.finder-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.5rem 0 0.75rem;
    font-size: 1.05rem;
}

.finder-head input {
    flex: 1;
}

.finder-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.finder-list li {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.finder-list li:last-child {
    border-bottom: none;
}

.finder-list li[hidden] {
    display: none;
}

/* blame */
table.blame .blame-commit {
    width: 1%;
    min-width: 22rem;
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--fg-muted);
    font-size: 0.85rem;
    border-right: 1px solid var(--border);
    vertical-align: top;
}

table.blame tr.blame-first td {
    border-top: 1px solid var(--border);
}

table.blame .blame-subject {
    color: var(--fg);
}

table.blame .blame-meta {
    color: var(--fg-subtle);
}

/* split diffs and collapsed files */
.diff-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.diff-toggle {
    margin-left: auto;
    display: flex;
}

.diff-toggle .btn:first-child { border-radius: 4px 0 0 4px; }
.diff-toggle .btn:last-child  { border-radius: 0 4px 4px 0; margin-left: -1px; }
.diff-toggle .btn.selected    { background: var(--bg-tertiary); }

.diff-collapsed-note {
    margin-left: auto;
    font-size: 0.85rem;
}

table.diff-split td.line {
    width: 50%;
}

table.diff-split td.d-add     { background: color-mix(in srgb, var(--green) 10%, transparent); }
table.diff-split td.num.d-add { background: color-mix(in srgb, var(--green) 18%, transparent); }
table.diff-split td.d-del     { background: color-mix(in srgb, var(--red) 10%, transparent); }
table.diff-split td.num.d-del { background: color-mix(in srgb, var(--red) 18%, transparent); }
table.diff-split td.d-empty   { background: var(--bg-tertiary); }
table.diff-split td.line + td.num { border-left: 1px solid var(--border); }

/* about */
.about {
    max-width: 44rem;
    margin: 1.5rem auto;
    line-height: 1.6;
}

.about .lead {
    font-size: 1.15rem;
    color: var(--fg-muted);
}

.about h2 {
    margin-top: 1.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.25rem;
}

.about ul {
    padding-left: 1.25rem;
}

.about li {
    margin: 0.4rem 0;
}

/* admin */

.admin h2 {
    margin-top: 2rem;
}

.admin-registration {
    margin: 1rem 0;
}

.admin-registration button {
    margin-left: 0.5rem;
}

.admin-actions {
    white-space: nowrap;
}

.admin-actions .inline-form + .inline-form {
    margin-left: 0.75rem;
}

.link-danger {
    color: var(--red);
}

.link-danger:hover {
    color: var(--red);
}

.role-badge {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0 0.4rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--fg-muted);
}

.role-owner {
    border-color: var(--green);
    color: var(--green);
}
