:root {
  --page: #f7f7f5;
  --surface: #ffffff;
  --raised: #f1f1ee;
  --line: #dededa;
  --text: #1b1b1a;
  --soft: #5f5f5b;
  --faint: #8a8a85;
  --link: #185fa5;
  --add-bg: #eaf3de;
  --add-text: #27500a;
  --remove-bg: #fcebeb;
  --remove-text: #791f1f;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #161615;
    --surface: #1e1e1d;
    --raised: #262624;
    --line: #363633;
    --text: #ecece8;
    --soft: #a9a9a3;
    --faint: #7c7c77;
    --link: #85b7eb;
    --add-bg: #173404;
    --add-text: #c0dd97;
    --remove-bg: #501313;
    --remove-text: #f7c1c1;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
}

.brand { color: var(--text); font-weight: 500; }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
}

h1 { font-size: 20px; font-weight: 500; margin: 8px 0 12px; }

.empty { color: var(--soft); }

h2 { font-size: 16px; font-weight: 500; margin: 0 0 8px; }
code, .mono, pre { font-family: var(--mono); font-size: 12.5px; }
.soft { color: var(--soft); }
.faint { color: var(--faint); }
.grow { flex: 1; min-width: 0; }
.pad { padding: 12px 14px; }

.bar .who { color: var(--soft); }
.bar form { margin: 0; }

button, .button, input, select {
  font: inherit;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 5px 10px;
}
button, .button { cursor: pointer; display: inline-block; }
.button:hover, button:hover { background: var(--raised); text-decoration: none; }
button.plain { border-color: transparent; background: none; color: var(--link); padding: 0; }
button.primary, .button.primary { background: var(--text); color: var(--page); border-color: var(--text); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
}
.card.narrow { max-width: 380px; margin: 40px auto; }
.card label { display: block; color: var(--soft); margin: 0 0 12px; }
.card label input { display: block; width: 100%; margin-top: 4px; }
.card label.short input { width: 180px; }
.row { display: flex; gap: 8px; align-items: flex-end; }
.slash { font-size: 18px; color: var(--faint); padding-bottom: 16px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 12px; }
.card label.choice { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; color: var(--text); margin: 0; }
.card label.choice input { width: auto; margin: 3px 0 0; }
.actions { display: flex; justify-content: flex-end; }
.notice { background: var(--remove-bg); color: var(--remove-text); border-radius: 6px; padding: 8px 10px; }

.repos { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.repos li { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.repos li:last-child { border-bottom: 0; }
.repos .owner { color: var(--link); }
.repos a { font-size: 15px; color: var(--text); }

.tag { font-size: 11px; color: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; margin-left: 8px; vertical-align: 1px; }
.repo-name { font-size: 17px; }
.repo-name strong { font-weight: 500; }
.repo-name a strong { color: var(--text); }
.about { margin: 4px 0 0; }

.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin: 10px 0 12px; }
.tabs a { padding: 8px 0; color: var(--soft); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { color: var(--text); font-weight: 500; border-bottom-color: var(--text); }
.count { color: var(--faint); font-weight: 400; }

.toolbar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.pick { position: relative; }
.pick summary, .pick-static { list-style: none; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 5px 10px; cursor: pointer; }
.pick-static { cursor: default; }
.pick .menu { position: absolute; z-index: 2; top: 36px; left: 0; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.pick .menu a { display: block; padding: 5px 8px; border-radius: 4px; color: var(--text); }
.pick .menu a:hover { background: var(--raised); text-decoration: none; }
.path { font-family: var(--mono); font-size: 12.5px; }
.path strong { font-weight: 500; }
.clone { width: 320px; max-width: 100%; font-family: var(--mono); font-size: 12px; color: var(--soft); }

.box { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin: 0 0 12px; overflow: hidden; }
.box-head, .box-foot { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: var(--raised); flex-wrap: wrap; }
.box-head { border-bottom: 1px solid var(--line); }
.box-foot { border-top: 1px solid var(--line); }
details.box > summary.box-head { cursor: pointer; }
details.box:not([open]) > summary.box-head { border-bottom: 0; }

table { border-collapse: collapse; width: 100%; }
.files td { padding: 7px 12px; border-bottom: 1px solid var(--line); }
.files tr:last-child td { border-bottom: 0; }
.files .name { white-space: nowrap; }
.files .name::before { content: ""; display: inline-block; width: 9px; height: 11px; margin-right: 9px; border: 1.5px solid var(--faint); border-radius: 2px; vertical-align: -1px; }
.files .name.folder::before { height: 8px; width: 12px; background: var(--link); border-color: var(--link); margin-right: 6px; }
.clip { max-width: 0; width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.when { white-space: nowrap; text-align: right; }
a.quiet { color: var(--soft); }

.readme, .code, .message { margin: 0; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.code { background: var(--raised); border-radius: 6px; margin: 0 0 12px; }
.message { padding: 6px 0 0; color: var(--soft); }

.lines td, .diff td { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; padding: 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; }
.lines .n, .diff .n { width: 1%; min-width: 44px; text-align: right; color: var(--faint); white-space: nowrap; user-select: none; padding: 0 8px; }
.lines .n a { color: var(--faint); }
.lines tr:target td { background: var(--raised); }
.diff .add td { background: var(--add-bg); color: var(--add-text); }
.diff .del td { background: var(--remove-bg); color: var(--remove-text); }
.diff .hunk td, .diff .meta td { background: var(--raised); color: var(--soft); }

.commits, .changed { list-style: none; margin: 0; padding: 0; }
.commits li, .changed li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.commits li:last-child, .changed li:last-child { border-bottom: 0; }
.commits .subject { color: var(--text); font-weight: 500; }
.pager { display: flex; gap: 8px; }
.counts { display: flex; gap: 12px; margin: 0 0 10px; }
.plus { color: var(--add-text); }
.minus { color: var(--remove-text); }
.status { width: 14px; font-family: var(--mono); color: var(--soft); }
.status.s-A { color: var(--add-text); }
.status.s-D { color: var(--remove-text); }

.bar a { margin-left: 4px; }
button.danger { color: var(--remove-text); }
select { padding: 5px 8px; }
.card label select { display: block; width: 100%; margin-top: 4px; }
.commits form { margin: 0; }
.made { background: var(--add-bg); color: var(--add-text); border-radius: 6px; padding: 10px 12px; margin: 0 0 12px; }
.made .token { display: block; width: 100%; margin-top: 6px; font-family: var(--mono); font-size: 12.5px; }

.tabs .grow { flex: 1; }
.notice.good { background: var(--add-bg); color: var(--add-text); }
.people { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 12px; }
.people form { display: flex; gap: 6px; align-items: center; margin: 0; }
.row select, .row button { margin-bottom: 12px; }
.danger-zone { border-color: var(--remove-text); }

.notice.quiet { background: var(--raised); color: var(--soft); }

.blame .by { width: 1%; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: inherit; color: var(--soft); border-right: 1px solid var(--line); padding: 0 10px; }
.blame tr.start td { border-top: 1px solid var(--line); }
.blame tr.start:first-child td { border-top: 0; }
.compare select { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; font: inherit; padding: 5px 8px; max-width: 260px; }
