/* gwitt default stylesheet: plain, with clearly separated blocks.
 * Override with css_path in the config. */
:root {
  --fg: #222;
  --dim: #6a6a6a;
  --bg: #fff;
  --soft: #f4f4f4;
  --line: #d4d4d4;
  --accent: #2a5db0;
  --add: #e9f6e9;
  --del: #fbeaea;
  --hunk: #eef2f9;
  --red: #b3261e;
  --green: #2d7a2d;
  --mono: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.3rem; margin: 1.2rem 0 .8rem; overflow-wrap: anywhere; }
h2 { font-size: 1rem; margin: 1.5rem 0 .5rem; }
h3 { font-size: 1rem; margin: 0; }
pre, code, textarea, .oid, .mode, .crumbs { font-family: var(--mono); font-size: 13px; }
pre { margin: 0; overflow-x: auto; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.dim, .desc { color: var(--dim); }
.narrow { max-width: 26rem; }

/* ---- header and tabs ---- */
header.top { background: var(--soft); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; padding-top: .7rem; padding-bottom: .7rem; }
.brand { font-weight: 700; font-size: 1.05rem; color: var(--fg); }
.crumb { font-size: 1.05rem; color: var(--dim); }
.crumb a { font-weight: 600; }
header .desc { font-size: .9rem; }
nav.user { margin-left: auto; display: flex; gap: 1rem; align-items: baseline; }
.me { font-weight: 600; }
nav.tabs { border-bottom: 1px solid var(--line); }
nav.tabs .wrap { display: flex; overflow-x: auto; }
nav.tabs a { padding: .55rem .9rem; color: var(--fg); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
nav.tabs a:hover { background: var(--soft); text-decoration: none; }
nav.tabs a.active { border-bottom-color: var(--accent); font-weight: 600; }
main.wrap { padding-bottom: 2.5rem; }
footer { color: var(--dim); font-size: 12px; border-top: 1px solid var(--line); padding: .8rem 16px; }

/* ---- controls ---- */
input, select, textarea, button { font: inherit; color: var(--fg); }
input:not([type=checkbox]), select, textarea { border: 1px solid var(--line); border-radius: 3px; padding: .35rem .5rem; background: var(--bg); }
input:focus, select:focus, textarea:focus { outline: 2px solid #9db6e0; outline-offset: 0; border-color: var(--accent); }
textarea { width: 100%; font-family: var(--mono); font-size: 13px; }
button, a.button {
  display: inline-block; cursor: pointer; padding: .3rem .8rem; font-weight: 600; font-size: 13px;
  border: 1px solid #bdbdbd; border-radius: 3px; background: #f7f7f7; color: var(--fg);
}
button:hover, a.button:hover { background: #ececec; text-decoration: none; }
button.link { background: none; border: none; padding: 0; color: var(--accent); font-weight: normal; font-size: inherit; }
button.link:hover { background: none; text-decoration: underline; }
button.danger, .danger { color: var(--red); }
form.inline { display: inline; margin: 0; }
form.stack { display: flex; flex-direction: column; gap: .8rem; max-width: 46rem; }
form.stack label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; }
form.stack button { align-self: flex-start; }
form.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
label.check { flex-direction: row !important; align-items: center; gap: .4rem !important; font-weight: normal !important; }
.flash { border: 1px solid var(--line); border-left-width: 4px; padding: .5rem .75rem; background: var(--soft); }
.flash.error { border-color: var(--red); color: var(--red); background: #fdf3f2; }

/* ---- page layout helpers ---- */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.head-row > div { display: flex; gap: .8rem; align-items: center; }
.search input { width: 15rem; max-width: 100%; }
p.clone { display: flex; gap: .5rem; align-items: center; margin: 1rem 0; color: var(--dim); }
.clone input { font-family: var(--mono); font-size: 12px; width: 28rem; max-width: 75vw; background: var(--soft); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1.5rem; align-items: start; }
@media (max-width: 760px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.cols h2 { margin-top: .5rem; }
ul.refs { list-style: none; margin: 0 0 .5rem; padding: 0; border: 1px solid var(--line); }
ul.refs li { padding: .3rem .6rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
ul.refs li:last-child { border-bottom: none; }

/* ---- tables as panels ---- */
table { border-collapse: collapse; }
table.list { width: 100%; border: 1px solid var(--line); margin-bottom: .5rem; }
table.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--dim); background: var(--soft); padding: .4rem .6rem; border-bottom: 1px solid var(--line); }
table.list td { padding: .35rem .6rem; border-bottom: 1px solid #e6e6e6; vertical-align: top; }
table.list tbody tr:last-child td { border-bottom: none; }
table.list tbody tr:hover td { background: #fafafa; }
table.list tr.section td { background: var(--soft); font-weight: 600; color: var(--dim); border-top: 1px solid var(--line); }
table.list td.sub { padding-left: 1.6rem; }
td.msg { width: 100%; overflow-wrap: anywhere; }
table.repos td:nth-child(2), table.tree td:nth-child(2) { width: 100%; }
td.author, td.age { white-space: nowrap; color: var(--dim); font-size: 13px; }
td.oid { white-space: nowrap; }
td.mode { color: var(--dim); width: 7rem; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
a.dir { font-weight: 600; }
@media (max-width: 640px) {
  td.author, .repos td:nth-child(3), .repos th:nth-child(3) { display: none; }
}

/* lists of issues / patches */
ul.items { list-style: none; margin: 0 0 .5rem; padding: 0; border: 1px solid var(--line); }
ul.items li { padding: .55rem .75rem; border-bottom: 1px solid #e6e6e6; }
ul.items li:last-child { border-bottom: none; }
ul.items a.title { font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
ul.items .dim { font-size: 13px; margin-top: .1rem; }
nav.filter { display: flex; gap: 0; margin: .5rem 0 .75rem; flex-wrap: wrap; align-items: center; }
nav.filter a { padding: .25rem .7rem; border: 1px solid var(--line); margin-right: -1px; background: var(--bg); }
nav.filter a.active { background: var(--soft); font-weight: 600; color: var(--fg); }
nav.filter a:hover { text-decoration: none; background: var(--soft); }
nav.pager { display: flex; gap: .5rem; margin: .75rem 0; }
nav.pager a { padding: .25rem .7rem; border: 1px solid var(--line); }
ul.labels { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .4rem; }

/* ---- files ---- */
.crumbs { margin: 1rem 0 .5rem; overflow-wrap: anywhere; }
.blob-head { display: flex; gap: 1rem; align-items: baseline; padding: .4rem .75rem; background: var(--soft); border: 1px solid var(--line); border-bottom: none; color: var(--dim); font-size: 13px; }
table.blob { width: 100%; border: 1px solid var(--line); table-layout: fixed; }
table.blob td { vertical-align: top; padding: .4rem .6rem; }
td.lines { width: 4.5rem; text-align: right; background: var(--soft); border-right: 1px solid var(--line); user-select: none; }
td.lines a { color: #999; }
td.code { overflow-x: auto; }
td.code pre { overflow: visible; }

/* ---- commits and diffs ---- */
.commit-body { white-space: pre-wrap; padding: .6rem .75rem; border: 1px solid var(--line); background: var(--soft); margin: .5rem 0 1rem; }
table.meta { margin-bottom: 1rem; }
table.meta th { text-align: left; font-weight: 600; color: var(--dim); padding: .1rem 1rem .1rem 0; font-size: 13px; vertical-align: top; }
table.meta td { padding: .1rem 0; overflow-wrap: anywhere; }
details.diffstat { border: 1px solid var(--line); margin: 1rem 0; font-size: 13px; }
details.diffstat > summary {
  display: flex; gap: .6rem; align-items: baseline; cursor: pointer; list-style: none;
  padding: .3rem .6rem; background: var(--soft); font-weight: 600; user-select: none;
}
details.diffstat > summary::-webkit-details-marker { display: none; }
details.diffstat > summary::before { content: "\25B8"; color: var(--dim); width: .8em; }
details.diffstat[open] > summary::before { content: "\25BE"; }
details.diffstat[open] > summary { border-bottom: 1px solid var(--line); }
details.diffstat .ds-title { flex: 1; }
table.diffstat { width: 100%; }
table.diffstat td { padding: .2rem .6rem; border-bottom: 1px solid #e6e6e6; }
table.diffstat td:nth-child(2) { width: 100%; overflow-wrap: anywhere; }
table.diffstat tbody tr:last-child td { border-bottom: none; }
td.st { color: var(--dim); font-size: 12px; white-space: nowrap; }
.add { color: var(--green); }
.del { color: var(--red); }
section.file { border: 1px solid var(--line); margin: 1rem 0; }
section.file h3 { font-family: var(--mono); font-size: 13px; padding: .4rem .75rem; background: var(--soft); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
section.file > p { margin: 0; padding: .5rem .75rem; }
table.diff { width: 100%; font-family: var(--mono); font-size: 12.5px; }
table.diff td { padding: 0 .6rem; white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; }
table.diff td.ln { width: 3.5rem; min-width: 3.5rem; text-align: right; color: #999; border-right: 1px solid #e6e6e6; white-space: nowrap; user-select: none; }
table.diff tr.add td { background: var(--add); }
table.diff tr.del td { background: var(--del); }
table.diff tr.hunk td { background: var(--hunk); color: var(--dim); padding-top: .15rem; padding-bottom: .15rem; }
table.diff tr.eofnl td { color: var(--dim); }

/* ---- issues and patches ---- */
.label { display: inline-block; font-size: 12px; line-height: 1.5; padding: 0 .4rem; margin-left: .3rem; border: 1px solid; border-radius: 3px; background: var(--bg); }
.lbl-gray { color: #555; } .lbl-red { color: #a32020; } .lbl-orange { color: #a8530a; }
.lbl-yellow { color: #826400; } .lbl-green { color: #2d7a2d; } .lbl-teal { color: #19706f; }
.lbl-blue { color: #2a5db0; } .lbl-purple { color: #6b3fa0; }
.state { display: inline-block; font-size: 12px; font-weight: 600; padding: .05rem .5rem; border: 1px solid; border-radius: 3px; text-transform: uppercase; letter-spacing: .03em; }
.state-open { color: var(--green); background: #eef7ee; }
.state-closed { color: #555; background: var(--soft); }
.state-merged { color: #6b3fa0; background: #f3eef9; }
article.comment { border: 1px solid var(--line); margin: 1rem 0; }
article.comment > header { padding: .4rem .75rem; background: var(--soft); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--dim); }
article.comment > header strong { color: var(--fg); }
article.comment > .markdown, article.comment > p { padding: .1rem .75rem; }
.comment-form { margin-top: 1rem; }
.actions-row { display: flex; gap: .5rem; margin: 1rem 0; }
.labels-form fieldset { border: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; padding: .6rem .75rem; }
.labels-form legend { font-weight: 600; padding: 0 .3rem; }
details.revise { border: 1px solid var(--line); padding: .5rem .75rem; margin: 1rem 0; }
details.revise summary { cursor: pointer; font-weight: 600; }
details.revise[open] summary { margin-bottom: .75rem; }
section.patch { margin-top: 2rem; padding-top: .5rem; border-top: 2px solid var(--line); }
section.patch h2 { margin-top: .5rem; }
ol.series { border: 1px solid var(--line); margin: .5rem 0; padding: .5rem .75rem .5rem 2.2rem; }

/* ---- markdown / readme ---- */
.readme { border: 1px solid var(--line); margin-top: 1.5rem; }
.readme > h2 { margin: 0; padding: .4rem .75rem; font-size: 13px; font-family: var(--mono); background: var(--soft); border-bottom: 1px solid var(--line); }
.readme > .markdown, .readme > pre { padding: .5rem 1rem 1rem; }
.markdown { overflow-wrap: anywhere; }
.markdown img { max-width: 100%; }
.markdown pre { background: var(--soft); border: 1px solid #e6e6e6; padding: .6rem .75rem; }
.markdown code { background: var(--soft); padding: 0 .25rem; }
.markdown pre code { background: none; padding: 0; }
.markdown table { margin: .75rem 0; display: block; overflow-x: auto; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: .3rem .6rem; }
.markdown th { background: var(--soft); }
.markdown blockquote { margin: .5rem 0; padding: 0 1rem; color: var(--dim); border-left: 3px solid var(--line); }
.markdown .align-center { text-align: center; } .markdown .align-right { text-align: right; }
.markdown li > input[type=checkbox] { margin-right: .3rem; }

/* ---- branch/tag switcher ---- */
.pathbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0 .5rem; }
.pathbar h1, .pathbar .crumbs { margin: 0; }
details.refsel { position: relative; }
details.refsel > summary {
  list-style: none; cursor: pointer; padding: .25rem .7rem; font-size: 13px; white-space: nowrap;
  border: 1px solid #bdbdbd; border-radius: 3px; background: #f7f7f7;
}
details.refsel > summary::-webkit-details-marker { display: none; }
details.refsel > summary::after { content: " \25BE"; color: var(--dim); }
details.refsel[open] > summary { background: #ececec; }
.refsel-menu {
  position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; display: flex; gap: 0;
  background: var(--bg); border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0,0,0,.12);
  max-height: 22rem; min-width: 18rem; overflow-y: auto;
}
.refsel-group { display: flex; flex-direction: column; min-width: 10rem; padding-bottom: .3rem; }
.refsel-group + .refsel-group { border-left: 1px solid var(--line); }
.refsel-head { font-size: 12px; font-weight: 600; color: var(--dim); background: var(--soft); padding: .3rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .2rem; }
.refsel-group a, .refsel-group > span { padding: .15rem .6rem; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.refsel-group a:hover { background: var(--soft); text-decoration: none; }
.refsel-group a.current { font-weight: 700; color: var(--fg); }
.refsel-group a.current::before { content: "\2713 "; }

/* ---- issue <-> patch cross references ---- */
ul.xrefs { list-style: none; margin: .5rem 0 1rem; padding: 0; border: 1px solid var(--line); }
ul.xrefs li { padding: .3rem .75rem; border-bottom: 1px solid #e6e6e6; overflow-wrap: anywhere; }
ul.xrefs li:last-child { border-bottom: none; }
ul.xrefs li.xrefs-head { background: var(--soft); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--dim); }

/* ---- issue / patch page sidebar ---- */
.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .with-side { grid-template-columns: minmax(0, 1fr); } }
.main-col > article.comment:first-child { margin-top: 0; }
.side-col { display: flex; flex-direction: column; gap: .75rem; }
.side-box { border: 1px solid var(--line); font-size: 13px; }
.side-box > h3 { font-size: 12px; font-weight: 600; color: var(--fg); background: var(--soft); border-bottom: 1px solid var(--line); padding: .35rem .65rem; }
.side-box > h3 .dim { font-weight: normal; }
.side-box > p, .side-box > form, .side-box > .side-action { margin: 0; padding: .45rem .65rem; }
.side-box > ul { list-style: none; margin: 0; padding: 0; }
.side-box > ul li { padding: .35rem .65rem; border-bottom: 1px solid #e6e6e6; overflow-wrap: anywhere; }
.side-box > ul li:last-child { border-bottom: none; }
.side-box dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; margin: 0; padding: .45rem .65rem; }
.side-box dt { color: var(--dim); }
.side-box dd { margin: 0; overflow-wrap: anywhere; }
.side-box .side-action { border-top: 1px solid #e6e6e6; }
.side-box form.labels-form { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.side-box form.labels-form button { margin-top: .3rem; }
.side-box .label { margin-left: 0; margin-right: .3rem; }
.side-box .state { font-size: 11px; }
.who { font-weight: 600; }
.mail { font-size: 12px; }
.small { font-size: 12px; }


/* ---- mail threads ---- */
pre.mail { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: .6rem .75rem; font-size: 13px; }
pre.mail .q { color: var(--dim); }
pre.mail .sig { color: #999; }
.mail-msg > header { display: flex; flex-wrap: wrap; gap: .3rem; align-items: baseline; }
.mail-msg .addr { color: var(--dim); }
.msg-links { margin-left: auto; }
.list-hint { margin: 1rem 0; padding: .5rem .75rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--soft); }
.list-hint p { margin: 0; }
.list-hint pre.cmd { margin: .4rem 0; padding: .4rem .6rem; overflow-x: auto; background: var(--bg); border: 1px solid var(--line); }
.list-hint.dim { border-left-color: var(--line); }
