@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #181a1b;
  --surface:   #1f2223;
  --border:    #2a2e30;
  --text:      #c8cdd0;
  --muted:     #55606a;
  --accent:    #49aaff;
  --accent2:   #26ccaa;
  --dir-color: #f0c040;
  --hover:     #242a2d;
  --font:      'JetBrains Mono', monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.3;
  min-height: 100vh;
}

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

a:hover {
  color: var(--accent);
}

h1 {
  padding: 6px 0 6px 0;
}

p {
  padding: 2px 0 2px 0;
}

.root-body {
  display: grid;
  place-items: center;
}

.root-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.root-folder-icon {
  width: 32px;
  height: 32px;
}

.root-label {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  letter-spacing: .02em;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  background: var(--surface);
}

.crumb-root {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.crumb-root:visited { color: var(--muted); }
.crumb-root:hover { color: var(--accent); }

.crumb-sep { color: var(--border); user-select: none; }

.crumb {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.crumb:visited { color: var(--muted); }
.crumb:hover { color: var(--accent); }
.crumb:last-child { color: var(--text); }

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 8px 12px 12px;
}

.entry-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.entry-table {
  table-layout: fixed;
}

.entry-table .col-size {
  width: 4.5rem;
}

.entry-table .col-date {
  width: 8.5rem;
}

.directory-item-count {
  margin-top: 10px;
  padding-right: 6px;
  text-align: right;
}

.directory-item-count .count {
  font-size: 11px;
  color: var(--muted);
}

.directory-custom-header {
  margin: 0 0 10px 0;
}

.directory-custom-footer {
  margin: 10px 0 0 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 3px 6px 4px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
thead th:last-child { text-align: right; }
thead th.col-date { text-align: right; }

tbody tr {
  transition: background .1s;
  border-bottom: 1px solid #1e2325;
}
tbody tr:hover { background: var(--hover); }

td {
  padding: 3px 6px;
  vertical-align: middle;
}
td.col-size { text-align: right; color: var(--muted); white-space: nowrap; }
td.col-date { text-align: right; color: var(--muted); white-space: nowrap; font-size: 11px; }

.entry-link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text);
  transition: color .15s;
  width: 100%;
  min-width: 0;
}
.entry-link:hover { color: var(--accent); }
.entry-link.is-dir { color: var(--dir-color); }
.entry-link.is-dir:hover { color: #ffe080; }

.entry-file-name {
  display: block;
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: .75;
}

.up-row {
  margin-bottom: 6px;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
  font-size: 11px;
}

body.mobile-list-view .entry-columns { grid-template-columns: 1fr; gap: 0; }
body.mobile-list-view .entry-columns .entry-table:not(:first-child) thead { display: none; }
body.mobile-list-view .col-date-part.time { display: none; }
body.mobile-list-view .entry-table .col-date { width: 5.5rem; }
body.mobile-list-view .entry-link { align-items: flex-start; }
body.mobile-list-view .entry-file-name {
  white-space: normal;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
  max-height: calc(1.25em * 2);
}
body.mobile-compact-view td,
body.mobile-compact-view th { padding: 4px 5px; }
body.mobile-compact-view .container { padding: 6px 8px 10px; }
body.mobile-compact-view header { padding: 5px 8px; }

@media (max-width: 980px) and (min-width: 701px) {
  .entry-table .col-size,
  td.col-size { display: none; }

  body.force-mobile-list .entry-table .col-size,
  body.force-mobile-list td.col-size { display: table-cell; }
}
