:root {
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #ececec;
  --hover: #f6f7f9;
  --accent: #1f5fbf;
  --folder: #8a8f98;
  --max: 920px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
header, main, footer { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
header { padding-top: 48px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
h1 { margin: 0; font-size: 1.8rem; letter-spacing: -0.02em; }
.tagline { margin: 2px 0 0; color: var(--muted); }
.intro { margin: 20px 0; color: var(--muted); }

/* Folder listing */
.list { list-style: none; margin: 0; padding: 0; }
.root { border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); }
.list .list .row:last-child { border-bottom: 0; }
.list .list { border-top: 1px solid var(--line); }
summary, .file > a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px; min-height: 56px;
  color: inherit; text-decoration: none; cursor: pointer;
}
summary { list-style: none; position: sticky; top: 0; background: #fff; z-index: 1; }
summary::-webkit-details-marker { display: none; }
summary:hover, .file > a:hover { background: var(--hover); }
summary::before {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 0 4px;
  border-right: 2px solid var(--folder); border-bottom: 2px solid var(--folder);
  transform: rotate(-45deg); transition: transform .15s;
}
details[open] > summary::before { transform: rotate(45deg); }
.ic { flex: none; width: 22px; height: 22px; }
.dir .ic { fill: var(--folder); }
.file .ic { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.name { font-weight: 600; }
.file .name { color: var(--accent); font-weight: 500; }
.note { color: var(--muted); font-size: .9rem; }
.meta { flex: none; color: var(--muted); font-size: .8rem; text-align: right; white-space: nowrap; }
.d0 > details > summary .name { font-size: 1.1rem; }

/* Indentation per level */
.d0 > details > .list > .row > details > summary,
.d0 > details > .list > .file > a { padding-left: 32px; }
.d1 > details > .list > .file > a { padding-left: 64px; }
.d1 > details > summary { top: 56px; }

.downloads { padding: 0 8px 12px 64px; display: flex; flex-wrap: wrap; gap: 12px; }
.dl { font-size: .85rem; color: var(--accent); }
.empty { padding: 12px 8px 12px 64px; color: var(--muted); font-style: italic; }

/* Text pages (library) */
.back { margin: 0 0 8px; font-size: .9rem; }
.back a, .actions a { color: var(--accent); }
.actions { display: flex; align-items: center; gap: 16px; margin: 20px 0 12px; font-size: .9rem; }
.actions button { font: inherit; padding: 6px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--hover); cursor: pointer; }
.text { white-space: pre-wrap; word-wrap: break-word; font: .9rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--hover); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 0 0 40px; }

footer { padding-top: 40px; padding-bottom: 40px; color: var(--muted); font-size: .85rem; }

@media (max-width: 600px) {
  header { padding-top: 28px; }
  h1 { font-size: 1.5rem; }
  summary, .file > a { gap: 4px 10px; align-items: flex-start; padding: 12px 4px; }
  summary::before { margin-top: 8px; }
  .file > a { flex-wrap: wrap; }
  .file > a .meta { flex-basis: 100%; text-align: left; white-space: normal; padding-left: 32px; }
  summary .meta { padding-top: 3px; }
  .d0 > details > .list > .row > details > summary,
  .d0 > details > .list > .file > a { padding-left: 16px; }
  .d1 > details > .list > .file > a { padding-left: 32px; }
  .d1 > details > summary { position: static; }
  .downloads, .empty { padding-left: 32px; }
}
