/* Site styles: typography, layout and server-rendered pages. Colour tokens
   (--gt-*) are defined in components.css. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;
  --site-width: 1120px;
  --gutter: 16px;
  /* Height of header controls: search, buttons, the logo. */
  --control-h: 34px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* `hidden` must win over any display set by a class. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--gt-bg);
  color: var(--gt-text);
  font: 15px/1.55 var(--sans);
  overflow-x: hidden;
}

a {
  color: var(--gt-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gt-focus);
  outline-offset: 2px;
}

code,
pre,
.mono,
kbd {
  font-family: var(--gt-mono);
  font-size: 0.92em;
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}
h2 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.6rem;
}

.muted {
  color: var(--gt-muted);
}

/* ---- page top: who/what this page is, and the actions --------------- */

.page-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.page-ident {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
/* Up to the index: a plain arrow. */
.back-link {
  display: flex;
  /* Level with the repo's icon and name. */
  margin-top: 2px;
  color: var(--gt-muted);
  margin-left: -4px;
}
.back-link:hover {
  color: var(--gt-text);
}
.back-link .gt-icon {
  width: 28px;
  height: 28px;
}
.page-ident h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  word-break: break-word;
}
.page-ident h1 a {
  color: var(--gt-text);
}
.page-ident h1 .badge {
  vertical-align: 0.2em;
  font-weight: 400;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gt-text);
}
.brand:hover {
  text-decoration: none;
}
/* The host's logo, or the placeholder in the text's colour (white in the
   dark theme, near-black in the light). */
.brand-logo {
  display: block;
  width: var(--control-h);
  height: var(--control-h);
  object-fit: contain;
  color: var(--gt-text);
}
.top-actions {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Who's logged in, under the buttons: out of the flow, so it moves
   nothing; short enough to end where what follows the page top starts. */
.top-actions > .user-badge {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
}
.top-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Logging in, and the menu on small screens: popovers on their buttons
   (<details>, so they work without scripts, and not in the top layer,
   where password managers don't fill in). */
.top-pop {
  position: relative;
}
.top-pop > summary {
  list-style: none;
}
.top-pop > summary::-webkit-details-marker {
  display: none;
}
.top-pop[open] > summary {
  background: var(--gt-surface-2);
}
.login-pop > .login-form,
.menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, calc(100vw - 32px));
}
.login-form {
  display: grid;
  gap: 10px;
}
.login-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--gt-muted);
}
.login-form input {
  font-size: 14px;
  color: var(--gt-text);
}
.login-form .button {
  justify-content: center;
}
.login-error {
  margin: 0;
  font-size: 13px;
  color: var(--gt-failure);
}
.login-error:empty {
  display: none;
}
/* After a failed login without scripts (the page is #login-failed). */
.login-failed {
  display: none;
  font-size: 13px;
  color: var(--gt-failure);
}
.login-failed:target {
  display: inline;
}
.logout-form {
  display: contents;
}
/* Square icon buttons, one size everywhere. */
.icon-button,
.gt-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-h);
  height: var(--control-h);
  padding: 0;
  color: var(--gt-text);
  background: var(--gt-surface);
  border: 1px solid var(--gt-border);
  border-radius: var(--gt-radius);
  cursor: pointer;
}
.icon-button:hover,
.gt-theme-toggle:hover {
  background: var(--gt-surface-2);
  text-decoration: none;
  filter: none;
}
.icon-button .gt-icon {
  width: 18px;
  height: 18px;
}
.icon-button.small {
  width: 26px;
  height: 26px;
  background: transparent;
  border-color: transparent;
}
.icon-button.small:hover {
  border-color: var(--gt-border);
}
.icon-button.small .gt-icon {
  width: 15px;
  height: 15px;
}
/* The menu (small screens only): the top buttons as a list, logging in
   slid over to in the same popover. */
.menu-pop {
  display: none;
}
.menu-button {
  position: relative;
}
/* Logged in. */
.menu-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gt-info);
}
.gt-popover.menu-panel {
  padding: 0;
  overflow: hidden;
  /* Grows (or shrinks) to the pane slid in: login.ts sets the height. */
  transition:
    opacity 120ms ease-out,
    transform 120ms ease-out,
    height 0.2s ease;
}
.menu-track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.2s ease;
}
.menu-panel.show-login .menu-track {
  transform: translateX(-100%);
}
.menu-main,
.menu-login {
  flex: 0 0 100%;
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px;
}
.menu-login {
  gap: 10px;
  padding: 10px 14px 14px;
}
.menu-back {
  margin-left: -6px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--gt-text);
  background: none;
  border: 0;
  border-radius: var(--gt-radius);
  cursor: pointer;
}
.menu-item:hover {
  background: var(--gt-surface-2);
  text-decoration: none;
}
.menu-item .gt-icon {
  width: 18px;
  height: 18px;
}
.menu-main > .user-badge {
  justify-self: start;
  margin: 6px 10px 4px;
}
@media (max-width: 640px) {
  .menu-pop {
    display: block;
  }
  .top-buttons,
  .top-actions > .user-badge {
    display: none;
  }
}
/* Who's logged in: the one blue badge. */
.user-badge {
  font-size: 12px;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--gt-info);
  background: var(--gt-info-bg);
  border: 1px solid color-mix(in srgb, var(--gt-info) 40%, transparent);
  white-space: nowrap;
}
/* Search: a wide popover, centred near the top, that grows with results. */
.quick-search-pop {
  position: fixed;
  top: 72px;
  left: 50%;
  translate: -50% 0;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 12px;
}
.quick-search-form {
  display: flex;
  gap: 6px;
}
.quick-search-form input[type="search"] {
  flex: 1;
  height: var(--control-h);
}
.quick-status {
  margin: 8px 2px 0;
}
.quick-status:empty {
  display: none;
}
.quick-search-pop .gt-results {
  margin: 8px 0 0;
}
/* How to search: filters and what they do, where results would be. */
.search-hints {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 12px 2px 4px;
  font-size: 14px;
}
.search-hints dt code {
  font-size: 13px;
}
.search-hints dd {
  margin: 0;
  color: var(--gt-muted);
}

input[type="search"],
input[type="text"],
input[type="password"],
input.copy,
textarea {
  font: inherit;
  color: inherit;
  background: var(--gt-surface);
  border: 1px solid var(--gt-border);
  border-radius: var(--gt-radius);
  padding: 6px 10px;
  min-width: 0;
}
input.copy {
  width: 100%;
  font-family: var(--gt-mono);
  font-size: 13px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  padding: 5px 12px;
  border-radius: var(--gt-radius);
  border: 1px solid var(--gt-accent);
  background: var(--gt-accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover,
button:hover {
  text-decoration: none;
  filter: brightness(1.05);
}
.button.subtle {
  background: transparent;
  color: var(--gt-text);
  border-color: var(--gt-border);
}
.button.subtle:hover {
  background: var(--gt-surface);
}

.badge {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid var(--gt-border);
  color: var(--gt-muted);
  background: var(--gt-surface);
  white-space: nowrap;
}
.vis-public,
.vis-unlisted {
  color: var(--gt-success);
}
.vis-metadata-public,
.vis-metadata-unlisted {
  color: var(--gt-substituted);
}
.vis-private {
  color: var(--gt-muted);
}

/* ---- layout ---------------------------------------------------------- */

.page {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 24px var(--gutter) 64px;
}

.empty-state,
.error-page {
  text-align: center;
  padding: 48px 16px;
  border: 1px solid var(--gt-border);
  border-radius: 10px;
  color: var(--gt-muted);
}
.empty-state h2,
.error-page h1 {
  color: var(--gt-text);
  margin-top: 0;
}

/* ---- index ----------------------------------------------------------- */

.index-head {
  margin-bottom: 16px;
}
.repo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}
.repo-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.repo-icon {
  flex: none;
  border-radius: 6px;
  object-fit: contain;
}
.repo-icon.placeholder {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--gt-surface-2);
  color: var(--gt-muted);
  font-weight: 650;
  font-size: 13px;
}
.repo-card-main {
  flex: 1;
  min-width: 0;
}
.repo-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.repo-card-name {
  font-weight: 600;
  font-size: 16px;
  word-break: break-word;
}
.repo-card-desc {
  margin: 2px 0 6px;
  color: var(--gt-muted);
}
.repo-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.repo-owner {
  color: var(--gt-muted);
  font-weight: 450;
}
.repo-description {
  margin: 4px 0 0;
  color: var(--gt-muted);
}

/* ---- landing: the content, and a sidebar of cards ------------------------ */

.landing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
}
/* Same box as .gt-frame (components.css); collapsible. */
.side-card {
  border: 1px solid var(--gt-border);
  border-radius: 10px;
  margin-bottom: 14px;
}
.side-card > summary,
.side-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  list-style: none;
  cursor: pointer;
}
/* A card that stays open: the same header, minus the toggle. */
.side-card-head {
  cursor: auto;
  min-height: 42px;
}
.side-card > summary::-webkit-details-marker {
  display: none;
}
.side-card > summary h2,
.side-card-head h2 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gt-muted);
}
.card-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
}
.card-toggle .gt-icon {
  transition: transform 120ms ease-out;
}
.side-card:not([open]) .card-toggle .gt-icon,
.side-card.closing .card-toggle .gt-icon {
  transform: rotate(-90deg);
}
.side-card-body {
  padding: 0 14px 12px;
  overflow: hidden;
}
.side-card-body label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--gt-muted);
  margin-bottom: 8px;
}
/* Small versions of the full-page lists. */
.side-card-body table.tree,
.side-card-body .commit-list {
  font-size: 13px;
}
.side-card-body table.tree td {
  padding: 4px 10px;
}
.side-card-body .commit-row {
  flex-wrap: nowrap;
  padding: 8px 10px;
}
.side-card-body .commit-main {
  flex: 1;
  min-width: 0;
}
.side-card-body .commit-summary {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-card-body .commit-side {
  flex-shrink: 0;
  width: auto;
}
/* Languages: a bar, the biggest ones, the total. */
.lang-bar {
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.lang-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 13px;
}
.lang-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lang-dot {
  width: 8px;
  height: 8px;
}
.lang-name {
  font-weight: 550;
}
.lang-total {
  margin: 10px 0 0;
  font-size: 13px;
}
/* A mirror, both its ends: the remote, then what of this repo. */
.mirror {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 14px;
}
.mirror + .mirror {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--gt-border);
}
.mirror-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  min-width: 0;
}
.mirror-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--gt-muted);
  margin: 0;
}
.mirror-line + .mirror-heading {
  margin-top: 4px;
}
.mirror-details {
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.mirror-error {
  color: var(--gt-failure);
  overflow-wrap: anywhere;
}
.mirror-name {
  color: var(--gt-muted);
  flex: none;
}
.mirror a {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 14px;
}
.ref-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ref-name {
  color: var(--gt-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Browse and log, together on the right. */
.ref-log {
  margin-left: auto;
  font-size: 12px;
  color: var(--gt-muted);
}
.ref-log + .ref-log {
  margin-left: 0;
}
/* A read-only value with a copy button on its right: the text runs under
   the button and fades out. */
.copy-field {
  position: relative;
  display: block;
}
.copy-field input.copy {
  padding-right: 44px;
  text-overflow: clip;
}
.copy-field .copy-button {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 52px;
  padding: 0 8px 0 18px;
  justify-content: flex-end;
  border: 0;
  border-radius: 0 var(--gt-radius) var(--gt-radius) 0;
  background: linear-gradient(to right, transparent, var(--gt-surface) 45%);
  color: var(--gt-muted);
}
.copy-field .copy-button:hover {
  color: var(--gt-text);
  filter: none;
}
/* ---- toolbar, breadcrumbs ---------------------------------------------- */

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.toolbar .button {
  margin-left: auto;
}
.breadcrumbs {
  font-family: var(--gt-mono);
  font-size: 14px;
  word-break: break-all;
}
.breadcrumbs .sep {
  color: var(--gt-muted);
  padding: 0 4px;
}
.breadcrumbs .current {
  font-weight: 600;
}


/* ---- box headers: a folder's last commit, a file, a README --------------
   One height, size and look; what follows (a listing, code, Markdown)
   continues the box below it. */

.box-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 8px 4px 14px;
  border: 1px solid var(--gt-border);
  border-radius: 10px 10px 0 0;
  background: var(--gt-surface);
  font-size: 13px;
  line-height: 1.4;
}
.box-head + table.tree {
  border-top: none;
}
.box-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.box-head-title {
  margin: 0;
  font-size: inherit;
  font-weight: 600;
  color: var(--gt-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.box-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.box-head .facts {
  color: var(--gt-muted);
  white-space: nowrap;
}
/* Facts in a row ("2 lines · 88 bytes", a commit's status · author ·
   ref), a dot between those with something in them: an empty one (no CI
   status) leaves no stray dot. */
.facts {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
}
.facts > :not(:empty) ~ :not(:empty)::before {
  content: "·";
  padding: 0 6px;
  color: var(--gt-muted);
}
/* Inside a box of its own (a README), the header is its top. */
.readme > .box-head {
  border: none;
  border-bottom: 1px solid var(--gt-border);
}

/* Preview / Code: one control, the shown view pressed. */
.view-switch {
  display: inline-flex;
  border: 1px solid var(--gt-border);
  border-radius: var(--gt-radius);
  overflow: hidden;
}
.view-switch-option {
  padding: 3px 10px;
  color: var(--gt-muted);
  font-size: 12px;
  line-height: 18px;
}
.view-switch-option + .view-switch-option {
  border-left: 1px solid var(--gt-border);
}
.view-switch-option:hover {
  color: var(--gt-text);
  text-decoration: none;
}
.view-switch-option[aria-current] {
  background: var(--gt-surface-2);
  color: var(--gt-text);
  font-weight: 600;
}

/* ---- tree ------------------------------------------------------------ */

table.tree {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--gt-border);
  border-radius: 0 0 10px 10px;
  font-size: 14px;
}
table.tree td {
  padding: 7px 12px;
  border-top: 1px solid var(--gt-border);
}
table.tree.standalone {
  border-radius: 10px;
}
table.tree tr:first-child td {
  border-top: none;
}
table.tree tr:hover td {
  background: var(--gt-surface);
}
/* Name, message, time: the message starts around the middle when there's
   room, like on GitHub. */
table.tree td.name {
  white-space: nowrap;
}
table.tree:has(td.msg) td.name {
  width: 38%;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.tree td.name .gt-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  color: var(--gt-muted);
}
table.tree a.entry,
table.tree .entry {
  color: var(--gt-text);
}
/* The name is the link; hovering the row shows it. */
table.tree tr:hover a.entry {
  text-decoration: underline;
}
table.tree td.msg {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 24px;
}
table.tree td.msg a {
  color: var(--gt-muted);
}
table.tree td.msg a:hover {
  color: var(--gt-text);
}
table.tree td.when {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  color: var(--gt-muted);
}
/* "..": the whole row goes up. */
table.tree tr.up td {
  padding: 0;
}
table.tree a.row-link {
  display: block;
  padding: 7px 12px;
  color: var(--gt-text);
}
@media (max-width: 640px) {
  table.tree td.msg {
    display: none;
  }
  table.tree:has(td.msg) td.name {
    width: auto;
  }
}

/* ---- file view --------------------------------------------------------- */

.code-wrap {
  border: 1px solid var(--gt-border);
  border-top: none;
  border-radius: 0 0 10px 10px;
}
/* Code wraps; nothing scrolls sideways. `anywhere` also lets the table
   shrink to the page width. */
table.code {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--gt-mono);
  font-size: 13px;
  line-height: 1.6;
}
table.code td.ln {
  width: 1%;
  min-width: 48px;
  padding: 0 12px;
  text-align: right;
  user-select: none;
  color: var(--gt-muted);
  vertical-align: top;
}
table.code td.ln a {
  color: inherit;
}
table.code td.ln {
  white-space: nowrap;
}
table.code td.lc {
  padding: 0 16px 0 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
table.code td.lc code {
  font-size: inherit;
}
/* A linked line without JS looks like a selected one. */
table.code tr:target td {
  background: color-mix(in srgb, var(--gt-accent) 16%, transparent);
}
.binary,
.file-markdown {
  border: 1px solid var(--gt-border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 16px 24px;
}

/* ---- markdown ---------------------------------------------------------- */

/* Markdown fills whatever holds it. */
.markdown {
  overflow-wrap: anywhere;
}
.markdown > :first-child {
  margin-top: 0;
}
.markdown h1 {
  font-size: 1.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--gt-border);
}
.markdown h2 {
  font-size: 1.25rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--gt-border);
}
/* Code blocks look like the code view: same box, font, size, colours. */
.markdown pre {
  background: var(--gt-bg);
  border: 1px solid var(--gt-border);
  border-radius: 10px;
  padding: 8px 16px;
  font-family: var(--gt-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.markdown pre code {
  font-size: inherit;
}
.markdown :not(pre) > code {
  background: var(--gt-surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}
.markdown img {
  max-width: 100%;
}
.markdown table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}
.markdown th,
.markdown td {
  border: 1px solid var(--gt-border);
  padding: 5px 10px;
}
.markdown blockquote {
  margin: 0;
  padding: 0 14px;
  color: var(--gt-muted);
  border-left: 3px solid var(--gt-border);
}
.markdown .md-center {
  text-align: center;
}
.markdown .md-right {
  text-align: right;
}
.readme {
  margin-top: 24px;
  border: 1px solid var(--gt-border);
  border-radius: 10px;
}
.readme article,
.readme .readme-plain {
  padding: 16px 24px;
}
/* A plain-text README: as written, in the code font. */
.readme-plain {
  margin: 0;
  font-family: var(--gt-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- commits ----------------------------------------------------------- */

.commit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--gt-border);
  border-radius: 10px;
}
.commit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--gt-border);
}
.commit-row:first-child {
  border-top: none;
}
/* Split by day (days.ts): a timeline down the left with a dot and the
   date for each day, and that day's commits boxed together. */
.commit-list.by-day {
  position: relative;
  padding-left: 28px;
  border: none;
  border-radius: 0;
}
.commit-list.by-day::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 0;
  width: 2px;
  background: var(--gt-border);
}
.commit-day {
  padding: 20px 0 8px;
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  color: var(--gt-muted);
}
.commit-day:first-child {
  padding-top: 0;
}
.commit-day-label {
  position: relative;
}
.commit-day-label::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gt-muted);
  box-shadow: 0 0 0 3px var(--gt-bg);
}
.commit-list.by-day > .commit-row {
  border: 1px solid var(--gt-border);
  border-top: none;
}
.commit-list.by-day > .commit-day + .commit-row {
  border-top: 1px solid var(--gt-border);
  border-radius: 10px 10px 0 0;
}
.commit-list.by-day > .commit-row:has(+ .commit-day),
.commit-list.by-day > .commit-row:last-child {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}
.commit-main {
  flex: 1;
  min-width: 0;
}
.commit-summary {
  color: var(--gt-text);
  font-weight: 550;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.commit-meta {
  font-size: 13px;
}
.commit-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.commit-id {
  font-size: 13px;
}
.pager {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
}

/* Browsing a whole history (commits.ts): the list, as much as fits, and
   the timeline beside it. */
gt-commits {
  display: block;
}
gt-commits.browsing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 24px;
}
/* The buttons at the bottom, level with the timeline card's. */
.commits-main {
  display: flex;
  flex-direction: column;
}
gt-commits .commit-list:focus-visible {
  outline: 2px solid var(--gt-focus);
  outline-offset: 4px;
}
.commits-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}
.commits-nav .button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.commits-nav .gt-icon {
  width: 16px;
  height: 16px;
}
.commits-where {
  margin-left: auto;
  font-size: 13px;
  color: var(--gt-muted);
  font-variant-numeric: tabular-nums;
}
.commits-side {
  position: sticky;
  top: 16px;
}
@media (max-width: 480px) {
  .commits-nav-label {
    display: none;
  }
}
.commits-timeline {
  margin-bottom: 0;
}
.commits-timeline .side-card-body {
  padding: 0 0 8px;
}
/* The track: lines where the date changes, the view of the list over
   them, and their labels over that. */
.tl {
  position: relative;
  overflow: hidden;
  touch-action: none;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
}
.tl-tick {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gt-border);
  z-index: 0;
}
.tl-tick.g0,
.tl-tick.g1 {
  background: color-mix(in srgb, var(--gt-muted) 55%, transparent);
}
.tl-handle {
  position: absolute;
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--gt-accent) 20%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--gt-accent) 55%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--gt-accent) 55%, transparent);
  z-index: 1;
}
.tl-labels {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
/* Year, month, day and time in columns, each unit under its kind. */
.tl-label {
  position: absolute;
  left: 12px;
  right: 8px;
  display: grid;
  grid-template-columns: 4ch 1ch 2ch 1ch 2ch 1ch 5ch;
  font-family: var(--gt-mono);
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  color: var(--gt-muted);
  font-variant-numeric: tabular-nums;
}
.tl-label > span {
  white-space: pre;
  opacity: 0.35;
}
.tl-label > span.on {
  opacity: 1;
}
.tl-head {
  position: relative;
}
.tl-scale-legend > span {
  position: absolute;
  top: 0;
  line-height: 16px;
  font-family: var(--gt-mono);
  font-size: 12px;
  color: var(--gt-muted);
  opacity: 0.8;
}
.tl-scale {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 0;
  pointer-events: none;
}
.tl-legend {
  position: static;
  padding: 0 8px 4px 12px;
  color: var(--gt-muted);
  font-size: 12px;
  opacity: 0.8;
}
.tl-label.g0 > .on,
.tl-label.g1 > .on {
  color: var(--gt-text);
  font-weight: 600;
}
/* A commit still on its way: its shape. */
.commit-skeleton .commit-main {
  display: grid;
  gap: 6px;
  padding: 3px 0;
}
.commit-skeleton .sk {
  margin: 0;
  height: 14px;
}
.commit-skeleton .sk-short {
  height: 11px;
  width: 30%;
}
.sk.sk-id {
  display: inline-block;
  width: 4.5em;
  height: 12px;
  margin: 0;
}

/* ---- commit page (also the CI tab) --------------------------------------- */

/* Like the commit heads elsewhere: which commit, then who, when and how
   its CI went. */
.commit-page-head {
  margin-bottom: var(--gt-space);
}
.commit-page-head h1 {
  margin: 0 0 4px;
}
.commit-page-head h1 a.gt-hash {
  font-family: var(--gt-mono);
}
.commit-page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0;
}
.commit-page-meta .browse-files {
  margin-left: auto;
}
/* Nothing to say (no CI): no gap either. */
gt-status:empty {
  display: none;
}
/* A badge on its way: its shape. */
.status-placeholder {
  display: inline-block;
  vertical-align: middle;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  background: var(--gt-surface-2);
  animation: gt-sk 1.2s ease-in-out infinite alternate;
}
gt-status:not([compact]) > .status-placeholder {
  width: 6em;
  border-radius: 999px;
}
.gt-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* The commit as `git show` prints it (no diff). */
/* A commit (or tag) by its message: the first line a little larger, by
   whom and when, then the rest as written. */
.commit-message {
  position: relative;
  margin: 0 0 var(--gt-space);
  padding: 12px 14px;
  border: 1px solid var(--gt-border);
  border-radius: 10px;
  background: var(--gt-surface);
}
.commit-message p {
  margin: 0;
}
.commit-subject {
  font-size: 1.1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.commit-by {
  margin-top: 2px;
  font-size: 0.9rem;
}
.commit-body {
  margin: 10px 0 0;
}
/* To the commit, from a branch's tip: in the corner, like a card's. */
.commit-open {
  position: absolute;
  top: 10px;
  right: 10px;
}
.commit-message:has(.commit-open) .commit-subject {
  padding-right: 2.5rem;
}
pre.commit-body {
  font-family: var(--gt-mono);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#diff {
  margin-top: 24px;
}

/* ---- diff -------------------------------------------------------------- */

.diff h2 .add,
.diff-files .add {
  color: var(--gt-success);
}
.diff h2 .del,
.diff-files .del {
  color: var(--gt-failure);
}
/* Files on the left, following the page down; above the diffs on small
   screens. */
.diff-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  /* As between artifacts and caches. */
  gap: 0.5rem;
  align-items: start;
}
.diff-nav {
  position: sticky;
  top: 16px;
}
.diff-nav .side-card {
  margin: 0;
}
.diff-nav .side-card-body {
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
.diff-files {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--gt-mono);
  font-size: 12px;
  display: grid;
  gap: 6px;
}
.diff-files li {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.diff-files a {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.diff-counts {
  flex: none;
}
.diff-file {
  border: 1px solid var(--gt-border);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.diff-file-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: var(--gt-surface);
  border-bottom: 1px solid var(--gt-border);
  font-size: 13px;
  word-break: break-all;
}
.diff-file > p {
  margin: 0;
  padding: 10px 12px;
}
.status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--gt-surface-2);
}
.status-added {
  color: var(--gt-success);
}
.status-deleted {
  color: var(--gt-failure);
}
table.diff-table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--gt-mono);
  font-size: 12.5px;
  line-height: 1.55;
}
table.diff-table td {
  padding: 0 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  vertical-align: top;
}
table.diff-table td.ln {
  white-space: nowrap;
  width: 1%;
  min-width: 40px;
  text-align: right;
  color: var(--gt-muted);
  user-select: none;
}
table.diff-table tr.add td {
  background: var(--gt-add-bg);
}
table.diff-table tr.del td {
  background: var(--gt-del-bg);
}
/* The part of a changed line that changed. */
table.diff-table tr.add .diff-change {
  background: var(--gt-add-mark);
  border-radius: 2px;
}
table.diff-table tr.del .diff-change {
  background: var(--gt-del-mark);
  border-radius: 2px;
}
table.diff-table tr.hunk td {
  background: var(--gt-surface-2);
  color: var(--gt-muted);
}

/* Selectable line numbers (lines.ts): the selection, also over added and
   removed lines, and kept in the URL fragment. */
table.code td.ln[data-line],
table.diff-table td.ln[data-line] {
  cursor: pointer;
  user-select: none;
}
table.code td.ln[data-line]:hover,
table.diff-table td.ln[data-line]:hover {
  color: var(--gt-text);
}
table.code tr.line-selected td,
table.diff-table tr.line-selected td {
  background: color-mix(in srgb, var(--gt-accent) 16%, transparent);
}
table.diff-table tr.add.line-selected td {
  background: color-mix(in srgb, var(--gt-accent) 16%, var(--gt-add-bg));
}
table.diff-table tr.del.line-selected td {
  background: color-mix(in srgb, var(--gt-accent) 16%, var(--gt-del-bg));
}
table.code tr.line-selected td.ln,
table.diff-table tr.line-selected td.ln {
  color: var(--gt-accent);
}
.diff-sign {
  display: inline-block;
  width: 1.2em;
  user-select: none;
  color: var(--gt-muted);
}

/* ---- refs, jobs, run ---------------------------------------------------- */

table.refs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--gt-border);
  border-radius: 10px;
  font-size: 14px;
}
table.refs-table td {
  padding: 8px 12px;
  border-top: 1px solid var(--gt-border);
}
table.refs-table tr:first-child td {
  border-top: none;
}
table.refs-table td.muted {
  white-space: nowrap;
}
/* The hash and its status, at the far right. */
table.refs-table td.ref-commit {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}
table.refs-table td.ref-commit > * {
  vertical-align: middle;
}
table.refs-table td.ref-commit .commit-id {
  margin-right: 10px;
}
table.refs-table td.summary {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.job-kind {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gt-muted);
}
.job-name {
  font-family: var(--gt-mono);
}
.job-desc,
.job-label {
  color: var(--gt-muted);
}

/* ---- search ------------------------------------------------------------ */

.search-help {
  margin: 8px 0 16px;
  font-size: 14px;
  color: var(--gt-muted);
}
.search-help code {
  background: var(--gt-surface-2);
  padding: 1px 4px;
  border-radius: 4px;
}
gt-search form {
  display: flex;
  gap: 8px;
}
gt-search form input[type="search"] {
  flex: 1;
}

/* ---- small screens ------------------------------------------------------ */

@media (max-width: 760px) {
  .page-top {
    flex-wrap: wrap;
  }
  .landing,
  .diff-layout,
  gt-commits.browsing {
    grid-template-columns: minmax(0, 1fr);
  }
  .commits-side {
    position: static;
  }
  .diff-nav {
    position: static;
  }
  .diff-nav .side-card-body {
    max-height: none;
  }
  .commit-row {
    flex-wrap: wrap;
  }
  .commit-side {
    width: 100%;
    justify-content: space-between;
  }
  table.refs-table td.summary {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---- run now ------------------------------------------------------------ */

.trigger-button .gt-icon,
.retry-button .gt-icon {
  width: 0.9em;
  height: 0.9em;
}
/* Retry failed: at the end of a group's header. */
.gt-run-group-header :is(.retry-button, .retry-refused) {
  margin-left: auto;
  align-self: center;
}
/* A job's buttons (run now, retry): at the end of its header. */
.gt-panel-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gt-panel-actions:empty {
  display: none;
}
.retry-refused {
  color: var(--gt-failure);
}

/* A button that reads like a link (in running text). */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--gt-accent);
  cursor: pointer;
}
.link-button:hover {
  text-decoration: underline;
}

/* ---- docs ---------------------------------------------------------- */

.doc-section + .doc-section {
  margin-top: 48px;
}
.doc-group {
  margin-top: 32px;
}
.doc-group > h3 {
  font-family: var(--gt-mono);
  font-size: 18px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gt-border);
}
.doc-option {
  margin: 20px 0;
  scroll-margin-top: 16px;
}
.doc-option h4 {
  margin: 0 0 6px;
  font-size: 15px;
}
.doc-option h4 code {
  overflow-wrap: anywhere;
}
.doc-anchor {
  color: var(--gt-text);
}
.doc-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0 0 8px;
  font-size: 13px;
}
.doc-facts dt {
  color: var(--gt-muted);
}
.doc-facts dd {
  margin: 0;
  min-width: 0;
}
.doc-code {
  margin: 0;
  overflow-x: auto;
  font-family: var(--gt-mono);
  font-size: 13px;
}
/* A command's synopsis, above what it does. */
.doc-option > pre.doc-code {
  margin: 0 0 6px;
}
.doc-facts dd.markdown p {
  margin: 0;
}
.doc-option .markdown > :first-child {
  margin-top: 0;
}
.doc-toc,
.doc-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-toc ul {
  padding-left: 12px;
  margin: 4px 0 10px;
  font-family: var(--gt-mono);
  font-size: 13px;
}
.doc-toc li {
  margin: 3px 0;
}
/* The contents stay in view. */
.docs + .landing-side {
  position: sticky;
  top: 16px;
  align-self: start;
}

/* /-/cli/authorize: approving the command line. */
.cli-page {
  max-width: 36rem;
}
.cli-authorize {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cli-code .copy-field input {
  font-family: var(--gt-mono);
}

/* The activity calendar: a week a row, this one on top; pale blue for
   none, the deepest blue at the median, green from the 95th percentile. */
:root {
  --heat-low: #c9d8f5;
  --heat-mid: #2f5fd0;
  --heat-high: #2f9e4f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --heat-low: #1d2a44;
    --heat-mid: #4a7ef0;
    --heat-high: #3fbf63;
  }
}
:root[data-theme="dark"] {
  --heat-low: #1d2a44;
  --heat-mid: #4a7ef0;
  --heat-high: #3fbf63;
}
.activity-total {
  margin: 0 0 8px;
  font-size: 13px;
}
.activity-grid {
  display: grid;
  grid-template-columns: 4ch repeat(7, 16px);
  gap: 3px;
  justify-content: center;
  font-size: 11px;
  line-height: 16px;
}
.activity-weekday,
.activity-month {
  color: var(--gt-muted);
  text-align: center;
  white-space: nowrap;
}
.activity-month {
  text-align: right;
  padding-right: 4px;
}
.activity-day {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}
/* (Steps, not inline colours: the page's policy has none.) */
.activity-day.heat-0 {
  background: var(--heat-low);
}
.activity-day.heat-1 {
  background: color-mix(in oklab, var(--heat-mid) 10%, var(--heat-low));
}
.activity-day.heat-2 {
  background: color-mix(in oklab, var(--heat-mid) 20%, var(--heat-low));
}
.activity-day.heat-3 {
  background: color-mix(in oklab, var(--heat-mid) 30%, var(--heat-low));
}
.activity-day.heat-4 {
  background: color-mix(in oklab, var(--heat-mid) 40%, var(--heat-low));
}
.activity-day.heat-5 {
  background: color-mix(in oklab, var(--heat-mid) 50%, var(--heat-low));
}
.activity-day.heat-6 {
  background: color-mix(in oklab, var(--heat-mid) 60%, var(--heat-low));
}
.activity-day.heat-7 {
  background: color-mix(in oklab, var(--heat-mid) 70%, var(--heat-low));
}
.activity-day.heat-8 {
  background: color-mix(in oklab, var(--heat-mid) 80%, var(--heat-low));
}
.activity-day.heat-9 {
  background: color-mix(in oklab, var(--heat-mid) 90%, var(--heat-low));
}
.activity-day.heat-10 {
  background: color-mix(in oklab, var(--heat-mid) 100%, var(--heat-low));
}
.activity-day.heat-11 {
  background: color-mix(in oklab, var(--heat-high) 10%, var(--heat-mid));
}
.activity-day.heat-12 {
  background: color-mix(in oklab, var(--heat-high) 20%, var(--heat-mid));
}
.activity-day.heat-13 {
  background: color-mix(in oklab, var(--heat-high) 30%, var(--heat-mid));
}
.activity-day.heat-14 {
  background: color-mix(in oklab, var(--heat-high) 40%, var(--heat-mid));
}
.activity-day.heat-15 {
  background: color-mix(in oklab, var(--heat-high) 50%, var(--heat-mid));
}
.activity-day.heat-16 {
  background: color-mix(in oklab, var(--heat-high) 60%, var(--heat-mid));
}
.activity-day.heat-17 {
  background: color-mix(in oklab, var(--heat-high) 70%, var(--heat-mid));
}
.activity-day.heat-18 {
  background: color-mix(in oklab, var(--heat-high) 80%, var(--heat-mid));
}
.activity-day.heat-19 {
  background: color-mix(in oklab, var(--heat-high) 90%, var(--heat-mid));
}
.activity-day.heat-20 {
  background: color-mix(in oklab, var(--heat-high) 100%, var(--heat-mid));
}
.activity-day.empty {
  background: transparent;
}
a.activity-day:hover,
a.activity-day:focus-visible {
  outline: 2px solid var(--gt-text);
  outline-offset: 1px;
}
.activity-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
}
.activity-scale {
  flex: 0 0 64px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--heat-low), var(--heat-mid), var(--heat-high));
}
.activity-popover {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.activity-walking {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--gt-muted);
}
/* An evaluation under way: what it's doing (readers). */
div.eval-progress {
  font-size: 13px;
  margin: 4px 0 8px;
  overflow-wrap: anywhere;
}
div.eval-progress span,
span.eval-progress {
  font-family: var(--gt-mono);
  font-size: 12px;
  color: var(--gt-muted);
  overflow-wrap: anywhere;
}
/* The evaluation's log: its frame folds on its head (folded, plain, once
   it went well). */
.eval-log > summary {
  cursor: pointer;
  list-style: none;
  align-items: center;
}
.eval-log > summary::-webkit-details-marker {
  display: none;
}
/* Folded (it went well): a line, its margins a little smaller. */
.eval-log {
  transition: padding 150ms ease-out;
}
.eval-log > summary {
  transition: margin 150ms ease-out;
}
.eval-log:not([open]),
.eval-log.folding {
  padding-top: 6px;
  padding-bottom: 6px;
}
.eval-log:not([open]) > summary,
.eval-log.folding > summary {
  margin-bottom: 0;
}
.eval-log > gt-log {
  overflow: hidden;
}
.eval-log .eval-actions {
  margin-left: auto;
}
/* A failure's title, and retrying it on its right. */
.gt-error-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
/* The refs card: branches and tags, headed like the CI card's groups. */
.refs-group {
  margin: 0 0 10px;
}
.refs-group:last-child {
  margin-bottom: 0;
}
.refs-group h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gt-muted);
}
.refs-more {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 12px;
}
/* A group's buttons (run what CI paused, retry what failed), together. */
.gt-run-group-actions {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}
