/*
 * ololduck: i'm honestly shit at creating CSS rules that make sense/are efficient.
 * Most of this file is the result of me copy-pasting snippets and fiddling with
 * my browser's devconsole to edit the css and see what is not to horrible to look at.
 *
 * Modifications very welcome.
 */

* {
  box-sizing: border-box;
}

a {
  color: #2f7a4d;
  text-decoration: none;
}

a:hover {
  color: #24663d;
  text-decoration: underline;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  background: #fafafa;
  color: #222222;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > header {
  background: #f6faf5;
  color: #111111;
  padding: 0.25rem 0.625rem;
  border-bottom: 1px solid #d7e6d1;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2rem;
}

body > header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

body > header nav {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

body > header nav a {
  color: #111111;
  text-decoration: none;
  font-weight: 500;
  padding: 0.125rem 0.375rem;
  border-radius: 2px;
  font-size: 0.95rem;
  transition: background-color 0.15s ease;
}
/*
nav a:not(:last-child)::after {
    content: "|";
    margin: 0 0.25rem;
    color: #888;
}
*/
body > header nav a:hover {
  background: #e9f3e6;
  text-decoration: none;
}

body > header nav form.session {
  display: inline;
  margin: 0px;
  background: none;
  border: none;
  padding: 0px;
}

body > header nav form.session button {
  background: #3b8a54;
  color: #fff;
  border: none;
  padding: 0.125rem 0.5rem;
  margin: 0px;
  border-radius: 2px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.2;
  transition: background-color 0.15s ease;
}

body > header nav form.session button:hover {
  background: #2f7a4d;
}

/* The tabs across the top of a repository's own pages. The current one is
   underlined rather than pointed at by an arrow, so where you are reads as
   a shape before it reads as text. */
nav.repository-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0.5rem 0 1rem;
  border-bottom: 1px solid #e6e6e6;
}

nav.repository-tabs a {
  color: #555555;
  padding: 0.25rem 0.6rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
}

nav.repository-tabs a:hover {
  color: #2f7a4d;
  background: none;
  text-decoration: none;
}

nav.repository-tabs a[aria-current="page"] {
  color: #24663d;
  font-weight: 600;
  border-bottom-color: #3b8a54;
}

/* Tabs are already separated by their own spacing, so the `|` the site
   draws between navigation links would be one separator too many. This has
   to repeat the selector's specificity to win over it. */
nav.repository-tabs a::after {
  content: none;
}

main {
  flex: 1;
  width: 100%;
  max-width: min(1100px, 94vw);
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

footer {
  background: #f5f5f5;
  color: #333;
  text-align: center;
  padding: 0.75rem 1rem;
  margin-top: auto;
  border-top: 1px solid #e3e3e3;
}

footer p {
  margin: 0;
  font-size: 0.875rem;
}

h2 {
  margin-top: 0;
  color: #111111;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: 2px;
  border: 1px solid #d8d8d8;
  box-shadow: none;
  max-width: 420px;
}

label {
  display: flex;
  flex-direction: row;
  gap: 0.375rem;
  font-weight: 600;
  color: #222222;
}

/* Radio buttons should sit beside their label text, not above it */
fieldset label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  padding: 0.5rem;
  border: 1px solid #c8c8c8;
  border-radius: 2px;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  color: #222222;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: #3b8a54;
  box-shadow: 0 0 0 2px rgba(59, 138, 84, 0.15);
}

button[type="submit"] {
  background: #3b8a54;
  color: #fff;
  border: none;
  padding: 0.5rem 0.875rem;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
  margin-top: 0.5rem;
}

button[type="submit"]:hover {
  background: #2f7a4d;
}

article.note {
  border: solid #eee 1px;
  margin:1em;
}
article.note header {
  background: #f5f5f5;
  border-bottom: solid #e3e3e3 1px;
  padding: 0.25em 0.50em;
}
article.note main {
  padding: 0.5em 0.75em;
}
article.note footer {
  margin-top: initial;
  text-align: left;
  padding: 0.25em 0.50em;
  display: flex;
  align-items: center;
  gap: 0.75em;
  flex-wrap: wrap;
  background: #fafafa;
  border-top: solid #e3e3e3 1px;
  font-size: 0.9em;
}
article.note footer a {
  color: #2f7a4d;
}
article.note .note-author {
  font-weight: 600;
}
article.note .note-author-handle {
  color: #666;
  font-weight: normal;
}
article.note .note-time {
  color: #666;
  font-size: 0.9em;
}
article.note .note-edited {
  color: #888;
  font-style: italic;
}
article.note .note-reactions {
  color: #666;
}
article.note .note-reactions .reaction-count {
  margin-right: 0.5em;
}

/* Inline action forms for react/announce buttons */
form.note-action-form {
  display: inline;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  max-width: none;
  box-shadow: none;
}

button.react-button {
  background: none;
  border: 1px solid #d8d8d8;
  padding: 0.25em 0.6em;
  border-radius: 3px;
  color: #555;
  cursor: pointer;
  font-size: 0.95em;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  margin: 0;
}

button.react-button:hover {
  background: #f0f0f0;
  border-color: #c8c8c8;
}

button.react-button.reacted {
  background: #e9f3e6;
  border-color: #3b8a54;
  color: #2f7a4d;
  font-weight: 600;
}

button.react-button.reacted:hover {
  background: #d4e8c9;
  border-color: #2f7a4d;
}

p.error {
  color: #a33;
  background: #ffeaea;
  padding: 0.75rem;
  border-radius: 2px;
  border: 1px solid #e99;
  font-weight: 600;
}

/* The label list on settings pages */
ul.label-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 420px;
}

ul.label-list li.label-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0;
}
section.readme {
  background: #fff;
  margin-top: 1em;
  border-radius: 4px;
  border: 1px solid #d0d7de;
  overflow: hidden;
}

/* The bar showing which file the readme comes from. */
section.readme > header {
  background: #f6f8fa;
  border-bottom: 1px solid #d0d7de;
  padding: 0.5rem 1rem;
}

p.readme-path {
  color: #4f734f;
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin: 0;
  font-weight: 600;
}

/* The rendered markdown content itself. */
section.readme > main {
  padding: 1.5rem 2rem;
  overflow-x: auto;
  word-wrap: break-word;
}

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

section.readme > main > *:last-child {
  margin-bottom: 0;
}

/* Headings */
section.readme > main h1,
section.readme > main h2,
section.readme > main h3,
section.readme > main h4,
section.readme > main h5,
section.readme > main h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: #111;
}

section.readme > main h1 {
  font-size: 1.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #e6e6e6;
}

section.readme > main h2 {
  font-size: 1.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #e6e6e6;
}

section.readme > main h3 { font-size: 1.2rem; }
section.readme > main h4 { font-size: 1.05rem; }
section.readme > main h5 { font-size: 0.95rem; }
section.readme > main h6 { font-size: 0.9rem; color: #555; }

/* Prose */
section.readme > main p {
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.65;
}

section.readme > main a {
  color: #2f7a4d;
  text-decoration: underline;
  text-underline-offset: 2px;
}

section.readme > main a:hover {
  color: #24663d;
}

/* Inline code */
section.readme > main code {
  background: #eff1f3;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Code blocks */
section.readme > main pre {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  padding: 0.875rem 1rem;
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.5;
  margin-bottom: 1rem;
}

section.readme > main pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.88em;
}

/* Lists */
section.readme > main ul,
section.readme > main ol {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-left: 2em;
}

section.readme > main ul ul,
section.readme > main ul ol,
section.readme > main ol ul,
section.readme > main ol ol {
  margin-bottom: 0;
}

section.readme > main li {
  margin-bottom: 0.25rem;
  line-height: 1.6;
}

section.readme > main li + li {
  margin-top: 0.25rem;
}

/* Task lists (GitHub-style checkboxes) */
section.readme > main ul li > input[type="checkbox"] {
  margin-right: 0.4em;
  vertical-align: middle;
}

/* Blockquotes */
section.readme > main blockquote {
  margin: 0 0 1rem;
  padding: 0.25rem 1rem;
  border-left: 4px solid #d0d7de;
  color: #555;
}

section.readme > main blockquote > :last-child {
  margin-bottom: 0;
}

/* Tables */
section.readme > main table {
  border-collapse: collapse;
  margin-bottom: 1rem;
  width: auto;
  overflow: auto;
  display: block;
}

section.readme > main table th,
section.readme > main table td {
  border: 1px solid #d0d7de;
  padding: 0.4rem 0.75rem;
}

section.readme > main table th {
  background: #f6f8fa;
  font-weight: 600;
}

section.readme > main table tr:nth-child(even) {
  background: #f9fafb;
}

/* Horizontal rules */
section.readme > main hr {
  border: none;
  border-top: 2px solid #e6e6e6;
  margin: 1.5rem 0;
}

/* Images */
section.readme > main img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Details/summary (e.g. collapsible FAQ) */
section.readme > main details {
  margin-bottom: 0.75rem;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  overflow: hidden;
}

section.readme > main details summary {
  padding: 0.5rem 0.75rem;
  background: #f6f8fa;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

section.readme > main details summary:hover {
  background: #eef1f4;
}

section.readme > main details[open] summary {
  border-bottom: 1px solid #d0d7de;
}

section.readme > main details > *:not(summary) {
  padding: 0 0.75rem;
}

section.readme > main details > p:first-of-type {
  margin-top: 0.75rem;
}

section.readme > main details > *:last-child {
  margin-bottom: 0.75rem;
}

/* A branch or tag listing: the name and hash read as code, the rest as
   prose, laid out on one line each. */
ul.refs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

ul.refs li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  background: #fff;
  padding: 0.375rem 0.625rem;
  border-radius: 2px;
  border: 1px solid #e6e6e6;
  box-shadow: none;
}

ul.refs code {
  background: #f5f5f5;
  border: 1px solid #e6e6e6;
  padding: 0.05em 0.35em;
  border-radius: 2px;
  font-size: 0.9rem;
}

ul.refs code.hash {
  color: #4f734f;
}

ul.refs .author {
  font-weight: 600;
  color: #222222;
}

ul.refs .subject {
  color: #444;
}

/* A commit listing: hash, author, date, and subject, laid out on one line
   each - the same visual language as the refs listing, so the two read as
   one kind of history. */
ul.commits {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

ul.commits li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  background: #fff;
  padding: 0.375rem 0.625rem;
  border-radius: 2px;
  border: 1px solid #e6e6e6;
  box-shadow: none;
}

ul.commits code {
  background: #f5f5f5;
  border: 1px solid #e6e6e6;
  padding: 0.05em 0.35em;
  border-radius: 2px;
  font-size: 0.9rem;
}

ul.commits code.hash {
  color: #4f734f;
}

ul.commits .author {
  font-weight: 600;
  color: #222222;
}

ul.commits .date {
  color: #666666;
  font-size: 0.9rem;
}

ul.commits .subject {
  color: #444;
}

/* The heading above a commit listing: which revision's history this is. */
p.commit-header {
  margin: 0 0 0.75rem;
  color: #666666;
}

p.commit-header code {
  background: #f5f5f5;
  border: 1px solid #e6e6e6;
  padding: 0.05em 0.35em;
  border-radius: 2px;
  font-size: 0.95rem;
  color: #222222;
}

/* The path to the directory being browsed: the ref first, then each step
   down to it, the last of which is where the reader already is. */
p.breadcrumb {
  margin: 0 0 0.75rem;
  color: #666666;
}

p.breadcrumb .current {
  color: #222222;
  font-weight: 600;
}

/* One directory of one ref: directories to walk into, files to open. */
ul.tree {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

ul.tree li {
  background: #fff;
  padding: 0.375rem 0.625rem;
  border-radius: 2px;
  border: 1px solid #e6e6e6;
  box-shadow: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

/* What a file's own page offers beside the file: the same bytes with none
   of the page around them. */
p.file-tools {
  margin: 0 0 0.75rem;
}

/* A source file, coloured on the server: the colours arrive as inline
   styles, so this is only the frame around them. */
pre.source {
  background: #fff;
  padding: 0.625rem;
  border-radius: 2px;
  border: 1px solid #e6e6e6;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
}

dfn {
    text-decoration: dotted underline;
}

dfn.visibility {
    font-style: normal;
}

/* A repository's tickets and patches: the filters they list by, the box that
   searches them, and the items themselves. */
nav.ticket-filters,
nav.patch-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

/* A label, as the filters offer it and as an item carries it. The one the
   list is showing is filled in, so the filter in place reads at a glance. */
a.ticket-label,
a.patch-label,
span.ticket-label,
span.patch-label {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 2px;
  border: 1px solid #cfded6;
  background: #f2f7f0;
  color: #2f7a4d;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Remote author badge - indicates content from a federated instance */
span.remote-badge {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 2px;
  border: 1px solid #d4c5e0;
  background: #f5f0f7;
  color: #6b4d7a;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}


a.ticket-label:hover,
a.patch-label:hover {
  background: #e9f3e6;
  text-decoration: none;
}

a.ticket-label.selected,
a.patch-label.selected {
  background: #3b8a54;
  border-color: #3b8a54;
  color: #fff;
}

span.ticket-label,
span.patch-label {
  color: #444444;
  background: #f5f5f5;
  border-color: #e0e0e0;
}

/* The search box: the site's `form` is a column of fields meant for one
   page, and this one is a row of its own with a place to type and a button
   beside it. */
form.ticket-search {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: none;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.625rem;
}

form.ticket-search label {
  flex: 1;
  gap: 0.25rem;
}

form.ticket-search button[type="submit"] {
  margin-top: 0;
  padding: 0.4rem 0.75rem;
}

/* The list itself: one ticket a line, newest first. */
ul.tickets {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  border: 1px solid #e6e6e6;
  border-radius: 2px;
  background: #fff;
}

ul.tickets li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eeeeee;
}

ul.tickets li:last-child {
  border-bottom: none;
}

a.ticket-summary {
  font-weight: 600;
  color: #222222;
}

a.ticket-summary:hover {
  color: #24663d;
}

span.ticket-creator {
  color: #777777;
  font-size: 0.9rem;
}

p.empty {
  color: #666666;
  font-style: italic;
}

/* The ticket detail header positions the title and actions on opposite sides. */
div.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

div.ticket-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #111111;
  flex: 1;
}

div.ticket-header div.ticket-tools {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

a.ticket-edit-link {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: #f5f5f5;
  color: #222222;
  border: 1px solid #d8d8d8;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

a.ticket-edit-link:hover {
  background: #e9e9e9;
  border-color: #c8c8c8;
  text-decoration: none;
}

form.ticket-delete {
  display: inline;
  margin: 0;
  padding: 0;
}

form.ticket-delete button.danger {
  background: #a33333;
  margin-top: 0;
  padding: 0.4rem 0.9rem;
}

form.ticket-delete button.danger:hover {
  background: #8a2b2b;
}

p.ticket-meta {
  margin: 0 0 0.5rem;
  color: #666666;
  font-size: 0.9rem;
}

p.ticket-labels {
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

form.ticket-form,
form.patch-edit {
  max-width: 800px;
}

form.ticket-form input[type="text"],
form.ticket-form textarea,
form.patch-edit input[type="text"],
form.patch-edit textarea,
form.patch-edit select {
  width: 100%;
}

/* A ticket's description, rendered from the markdown its opener wrote. */
section.ticket-description {
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: 2px;
  border: 1px solid #d8d8d8;
  overflow-x: auto;
  margin-bottom: 0.75rem;
}

section.ticket-description h1:first-child,
section.ticket-description h2:first-child,
section.ticket-description h3:first-child {
  margin-top: 0;
}

section.ticket-description pre {
  background: #f5f5f5;
  border: 1px solid #e6e6e6;
  padding: 0.875rem 1rem;
  border-radius: 2px;
  overflow-x: auto;
}

section.ticket-description code {
  background: #f5f5f5;
  border: 1px solid #e6e6e6;
  padding: 0.05em 0.3em;
  border-radius: 2px;
}

section.ticket-description pre code {
  padding: 0;
  background: none;
}

/* Deleting a label on the settings page, or any inline destructive act, is
   the same one-button act as logging out, and gets the same plain shape: the
   page's `form` frame is for forms that ask for something, not for one that
   only confirms. */
form.inline-form {
  display: inline;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  max-width: none;
}

form.inline-form button.danger {
  background: #a33333;
  margin-top: 0.5rem;
  padding: 0.5rem 0.875rem;
}

form.inline-form button.danger:hover {
  background: #8a2b2b;
}

/* A commit detail page: the commit's metadata, links, and the diff itself */
div.commit-detail {
  margin-bottom: 1rem;
}

div.commit-detail div.commit-header {
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: 2px;
  border: 1px solid #d8d8d8;
  margin-bottom: 1rem;
}

div.commit-detail div.commit-header h3 {
  margin: 0 0 0.5rem;
  color: #111111;
  font-weight: 600;
}

div.commit-detail p.commit-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  color: #666666;
  font-size: 0.9rem;
}

div.commit-detail p.commit-meta code.hash {
  background: #f5f5f5;
  border: 1px solid #e6e6e6;
  padding: 0.05em 0.35em;
  border-radius: 2px;
  color: #4f734f;
}

div.commit-detail p.commit-meta code.date {
  color: #666666;
}

div.commit-detail p.commit-meta span.author {
  font-weight: 600;
  color: #222222;
}

div.commit-detail p.commit-links {
  margin: 0 0 1rem;
  color: #666666;
  font-size: 0.9rem;
}

div.commit-detail div.commit-stats {
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 2px;
  border: 1px solid #d8d8d8;
  margin-bottom: 1rem;
}

div.commit-detail div.commit-stats span.stats {
  color: #444;
  font-size: 0.95rem;
}

div.commit-detail div.commit-stats span.insertions {
  color: #2f7a4d;
  font-weight: 600;
}

div.commit-detail div.commit-stats span.deletions {
  color: #a33333;
  font-weight: 600;
}

div.commit-detail div.commit-diff {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

details.file-diff {
  background: #fff;
  border-radius: 2px;
  border: 1px solid #d8d8d8;
  overflow: hidden;
}

details.file-diff > summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: #f5f5f5;
  border-bottom: 1px solid #e6e6e6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none;
}

/* Hide browser default disclosure marker */
details.file-diff > summary::-webkit-details-marker {
  display: none;
}

/* Custom collapsible indicator */
details.file-diff > summary::before {
  content: "▶";
  display: inline-block;
  font-size: 0.75rem;
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
}

details.file-diff[open] > summary::before {
  transform: rotate(90deg);
}

details.file-diff > summary > span.file-path {
  color: #222222;
  font-weight: 600;
}

details.file-diff > summary > span.file-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
}

details.file-diff summary span.insertions {
  color: #2f7a4d;
  font-weight: 600;
}

details.file-diff summary span.deletions {
  color: #a33333;
  font-weight: 600;
}

details.file-diff p.binary-notice {
  padding: 1rem;
  margin: 0;
  color: #666666;
  font-style: italic;
  text-align: center;
}

details.file-diff div.hunks {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1;
}

details.file-diff div.hunk {
  border-top: 1px solid #e6e6e6;
}

details.file-diff div.hunk:first-child {
  border-top: none;
}

details.file-diff div.hunk-header {
  padding: 0.375rem 1rem;
  background: #f5f5f5;
  color: #666666;
  border-bottom: 1px solid #e6e6e6;
  font-size: 0.85rem;
}

details.file-diff div.diff-line {
  padding: 0.0625rem 1rem;
  white-space: pre-wrap;
  word-break: break-all;
}

details.file-diff div.diff-line.context {
  background: #fff;
  color: #333333;
}

details.file-diff div.diff-line.added {
  background: #e9f3e6;
  color: #2f7a4d;
}

details.file-diff div.diff-line.removed {
  background: #fdeaea;
  color: #a33333;
}

/* Inline commit stats in commit lists */
ul.commits span.commit-stats {
  display: inline-flex;
  gap: 0.5rem;
  margin-left: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

ul.commits span.insertions {
  color: #2f7a4d;
  font-weight: 600;
}

ul.commits span.deletions {
  color: #a33333;
  font-weight: 600;
}

/* Compare view */
form.compare-form {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

form.compare-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

form.compare-form select {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

form.compare-form span.dots {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.5rem;
  color: #666;
  align-self: flex-end;
  padding-bottom: 0.25rem;
}

form.compare-form button {
  padding: 0.5rem 1.5rem;
  border: 1px solid #007bff;
  background: #007bff;
  color: white;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  align-self: flex-end;
}

form.compare-form button:hover {
  background: #0056b3;
  border-color: #0056b3;
}

div.compare-header {
  background: #f8f9fa;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
}

div.compare-header p {
  margin: 0;
  font-size: 1.1rem;
}

div.compare-header code {
  background: white;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

/* Patch detail page */
article.patch-detail {
  background: #fff;
  padding: 1.5rem;
  border-radius: 2px;
  border: 1px solid #d8d8d8;
  margin-bottom: 1rem;
}

article.patch-detail header {
  margin-bottom: 1.5rem;
}

div.patch-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

div.patch-header-top h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #111111;
  flex: 1;
}

a.patch-edit-link {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: #f5f5f5;
  color: #222222;
  border: 1px solid #d8d8d8;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

a.patch-edit-link:hover {
  background: #e9e9e9;
  border-color: #c8c8c8;
  text-decoration: none;
}

dl.patch-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
  font-size: 0.95rem;
}

dl.patch-meta dt {
  font-weight: 600;
  color: #555555;
}

dl.patch-meta dd {
  margin: 0;
  color: #222222;
}

dl.patch-meta dd code {
  background: #f5f5f5;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

section.patch-description {
  background: #fafafa;
  padding: 1rem 1.25rem;
  border-radius: 2px;
  border: 1px solid #e6e6e6;
  margin-bottom: 1rem;
  overflow-x: auto;
}

section.patch-description h1:first-child,
section.patch-description h2:first-child,
section.patch-description h3:first-child {
  margin-top: 0;
}

section.patch-description pre {
  background: #f5f5f5;
  border: 1px solid #e6e6e6;
  padding: 0.875rem 1rem;
  border-radius: 2px;
  overflow-x: auto;
}

section.patch-description code {
  background: #f5f5f5;
  border: 1px solid #e6e6e6;
  padding: 0.05em 0.3em;
  border-radius: 2px;
}

section.patch-description pre code {
  padding: 0;
  background: none;
}

section.patch-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

section.patch-actions a {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: #3b8a54;
  color: #fff;
  border-radius: 2px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

section.patch-actions a:hover {
  background: #2f7a4d;
  color: #fff;
  text-decoration: none;
}

form.inline-form button.merge-button {
  background: #3b8a54;
  color: #fff;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 2px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

form.inline-form button.merge-button:hover {
  background: #2f7a4d;
}

/* Patch listing */
ul.patches {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  border: 1px solid #e6e6e6;
  border-radius: 2px;
  background: #fff;
}

ul.patches li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eeeeee;
}

ul.patches li:last-child {
  border-bottom: none;
}

a.patch-summary {
  font-weight: 600;
  color: #222222;
}

a.patch-summary:hover {
  color: #24663d;
}

span.patch-status {
  color: #666666;
  font-size: 0.9rem;
}

span.patch-creator {
  color: #777777;
  font-size: 0.9rem;
}

p.patch-tools {
  margin: 0.75rem 0;
  color: #555555;
}

p.patch-tools code {
  background: #f5f5f5;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

section.comments article {
    margin-bottom: 1rem;
}
section.comments article div.comment-content {
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: 2px;
  border: 1px solid #d8d8d8;
  overflow-x: auto;
  margin-bottom: 0.75rem;
}
section.comments article div.comment-content h1:first-child,
section.comments article div.comment-content h2:first-child,
section.comments article div.comment-content h3:first-child {
  margin-top: 0;
}

details.comment-actions form {
    margin-left: 1em;
}

/* thanks nabile@libera.chat! */
p#clone_url > code {
    user-select: all;
}
