:root {
  --bg: #ddd;
  --fg: #333;
  --muted: #6e6e73;
  --border: #ccc;
  --accent: #0066cc;
  --code-bg: #f5f5f7;
  --row-hover: #f5f5f7;
}

/* @media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --fg: #f5f5f7;
    --muted: #98989d;
    --border: #38383a;
    --accent: #4c9eff;
    --code-bg: #2c2c2e;
    --row-hover: #2c2c2e;
  }
} */

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  padding-top: 2em;
  font-family: Helvetica, Arial, sans-serif;
  width: 90%;
  min-width: 700px;
  max-width: 1100px;
  margin: auto;
  background: var(--bg);
  color: var(--fg);
}

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

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  background: var(--code-bg);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

pre code {
  background: transparent;
  padding: 0;
}

header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.crumbs {
  margin-block-end: 0.67em;
  margin-inline-end: 0px;
  font-weight: bold;
  unicode-bidi: isolate;
  font-size: 120%;
  line-height: 1em;
}

.crumbs .sep {
  margin: 0 0.15rem;
}

main {
  padding-bottom: 2rem;
}

.readme {
  font-size: 90%;
  margin-top: 2em;
}

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

.readme table {
  border-collapse: collapse;
  margin: 1rem 0;
}

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

.sha-copy {
  cursor: pointer;
  user-select: none;
}

.toolbar {
  margin-bottom: 0.5rem;
}

#filter {
  width: 100%;
  max-width: 360px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: #fff;
  color: var(--fg);
  font: inherit;
  font-size: 80%;
}

#filter:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}

table.listing {
  width: 100%;
  box-shadow: 0 0 0.5em #999;
  margin: 0;
  border: none !important;
  border-collapse: collapse;
  border-spacing: 0;
  background: rgba(255, 255, 255, 0.8);
}

table.listing th,
table.listing td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

table.listing th {
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  background: #000;
  background: -webkit-linear-gradient(top, #444, #000);
  background: -moz-linear-gradient(top, #444, #000);
  background: -ms-linear-gradient(top, #444, #000);
  background: -o-linear-gradient(top, #444, #000);
  background: linear-gradient(top, #444, #000);
  font-size: 14px;
  line-height: 24px;
  border: none;
  text-align: left;
  color: #fff;
}

table.listing tbody tr:hover {
  background: var(--row-hover);
}

table.listing th[data-sort="size"] > div,
table.listing th[data-sort="mtime"] > div {
  justify-content: end;
}

table.listing td.size,
table.listing td.mtime,
table.listing th[data-sort="size"],
table.listing th[data-sort="mtime"] {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

table.listing td.name a {
  color: var(--fg);
}

table.listing td.name a:hover {
  color: var(--accent);
  text-decoration: none;
}

table.listing td.empty {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem;
}

/* table.listing th[data-sort]::after {
  content: ' ';
  position: absolute;
  right: 5px;
  opacity: 0.5;
}

table.listing th[data-dir="asc"]::after {
  content: ' ▲';
  opacity: 1;
}

table.listing th[data-dir="desc"]::after {
  content: ' ▼';
  opacity: 1;
} */

table.listing th[data-sort] > div {
  display: flex;
}

table.listing th[data-sort] > div::after {
  content: ' ↕';
  font-size: 0.8em;
  margin-left: 5px;
  opacity: 0.3;
}

table.listing th[data-dir="asc"] div::after { content: ' ↑'; opacity: 1; }
table.listing th[data-dir="desc"] div::after { content: ' ↓'; opacity: 1; }

footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.75rem;
}