:root {
  color-scheme: light;
  --background: #fbfaf7;
  --surface: #ffffff;
  --text: #24211d;
  --muted: #6c665d;
  --line: #dfd9cf;
  --accent: #1f6f78;
  --accent-soft: #e8f3f4;
  --folder-row: #eef7f8;
  --folder-row-hover: #dceff1;
  --file-row: #fffaf1;
  --file-row-hover: #fff2da;
  --parent-row: #f1eee8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #154f56;
}

.site-header,
.site-footer,
.directory-shell,
.document-shell {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
}

.site-header {
  padding: 32px 0 20px;
  border-bottom: 1px solid var(--line);
}

.site-footer {
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
}

h1 {
  margin: 10px 0 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.path-label,
.directory-summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.back-link,
.crumbs a {
  font-size: 0.95rem;
  font-weight: 650;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  background: var(--accent-soft);
  border: 1px solid #d3e8ea;
  border-radius: 6px;
  text-decoration: none;
}

.crumbs a:hover {
  background: #dceff1;
}

.crumbs span {
  color: #948d82;
}

.directory-shell {
  padding: 24px 0 40px;
}

.listing {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
}

.listing th,
.listing td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.listing th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.listing-row.folder-row {
  background: var(--folder-row);
}

.listing-row.file-row {
  background: var(--file-row);
}

.listing-row.parent-row {
  background: var(--parent-row);
}

.listing-row.folder-row:hover {
  background: var(--folder-row-hover);
}

.listing-row.file-row:hover {
  background: var(--file-row-hover);
}

.listing-row.parent-row:hover {
  background: #e8e2d8;
}

.listing-row.folder-row td:first-child {
  box-shadow: inset 4px 0 0 var(--accent);
}

.listing-row.file-row td:first-child {
  box-shadow: inset 4px 0 0 #c8872d;
}

.listing-row.parent-row td:first-child {
  box-shadow: inset 4px 0 0 var(--muted);
}

.listing tr:last-child td {
  border-bottom: 0;
}

.listing a {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.listing .size,
.listing .modified {
  width: 1%;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.document-shell {
  padding: 24px 0;
}

.document-text {
  margin: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .listing {
    display: block;
    overflow-x: auto;
  }

  .listing .modified {
    display: none;
  }

  .document-text {
    padding: 14px;
    font-size: 0.9rem;
  }
}
