:root {
  --bg: #0e0e0e;
  --fg: #ececec;
  --muted: #8e8e8e;
  --green: #1f6b4a;
  --green-bright: #3dba7a;
  --row: #161616;
  --row-hover: #1e1e1e;
  --border: #2a2a2a;
  --input: #141414;
  --icon-folder: #3dba7a;
  --icon-file: #8eb4a0;
  --amber: #c9a227;
  --amber-bg: rgba(201, 162, 39, 0.12);
  --amber-border: rgba(201, 162, 39, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.35;
  padding: 1.75rem 1.25rem 3rem;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 76rem;
  margin: 0 auto;
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.brand {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 18rem;
}

.brand img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 8px;
  flex: 0 0 auto;
  object-fit: cover;
  background: #111;
}

.brand-text {
  min-width: 0;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
}

h1 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.sub {
  color: var(--muted);
  margin: 0;
  font-size: 0.9rem;
  max-width: 40rem;
}

.notice {
  margin: 0.85rem 0 0;
  padding: 0.55rem 0.8rem;
  border-radius: 7px;
  border: 1px solid var(--amber-border);
  background: var(--amber-bg);
  color: #f0e2a8;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  max-width: 42rem;
}

.notice a {
  color: #ffe9a0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-quiet {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.link-quiet:hover {
  color: #fff;
}

.btn-sub {
  display: inline-block;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  border: 1px solid #2a8a5c;
}

.btn-sub:hover {
  background: #258a58;
  color: #fff;
}

.btn-empty {
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-empty:hover {
  color: var(--fg);
  border-color: #3a3a3a;
}

.btn-empty[aria-pressed="true"] {
  color: var(--green-bright);
  border-color: rgba(61, 186, 122, 0.45);
}

.toolbar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 1.15rem 0 0.7rem;
}

.search-wrap {
  flex: 1 1 auto;
  position: relative;
}

.search-wrap input {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 7px;
  padding: 0.58rem 0.8rem 0.58rem 2.1rem;
  font-size: 0.9rem;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--green-bright);
  box-shadow: 0 0 0 2px rgba(61, 186, 122, 0.15);
}

.search-wrap .search-ico {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.9rem;
  height: 0.9rem;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.85;
}

.search-wrap .search-ico::after {
  content: "";
  position: absolute;
  width: 0.35rem;
  height: 1.5px;
  background: var(--muted);
  right: -0.2rem;
  bottom: -0.05rem;
  transform: rotate(45deg);
}

.crumb {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0 0 0.55rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0;
}

.crumb a {
  color: var(--green-bright);
  text-decoration: none;
}

.crumb a:hover {
  text-decoration: underline;
}

.crumb .sep {
  margin: 0 0.4rem;
  opacity: 0.5;
}

.list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--row);
}

/* Name flexes; Type / Modified get fixed room */
.list-head,
.row {
  display: grid;
  /* Modified wider so date + time fit (e.g. Jul 18, 2026 · 14:05) */
  grid-template-columns: minmax(0, 1fr) 9.5rem 11.5rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0 0.9rem;
  min-height: 2.55rem;
  font-size: 0.88rem;
}

@media (max-width: 700px) {
  .list-head,
  .row {
    grid-template-columns: minmax(0, 1fr) 9rem;
  }

  .col-type {
    display: none;
  }
}

.list-head {
  background: #121212;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  min-height: 2.15rem;
}

.row {
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.1s ease;
}

.row:first-of-type {
  border-top: none;
}

a.row:hover,
button.row:hover {
  background: var(--row-hover);
}

button.row {
  width: 100%;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  text-align: left;
  font: inherit;
  color: inherit;
  display: grid;
  padding: 0 0.9rem;
}

.name {
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.name .label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.name .hint {
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.35rem;
}

.ico {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 0.9rem;
  position: relative;
}

.ico-folder {
  background: var(--icon-folder);
  border-radius: 0 2px 2px 2px;
  opacity: 0.9;
}

.ico-folder::before {
  content: "";
  position: absolute;
  left: 0;
  top: -0.22rem;
  width: 0.42rem;
  height: 0.28rem;
  background: var(--icon-folder);
  border-radius: 2px 2px 0 0;
  opacity: 0.95;
}

.ico-file {
  width: 0.85rem;
  height: 1.05rem;
  border: 1.5px solid var(--icon-file);
  border-radius: 2px;
  background: transparent;
}

.ico-file::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 0.28rem 0.28rem 0;
  border-color: transparent transparent var(--icon-file) transparent;
  opacity: 0.7;
}

.col-type,
.col-date {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.col-type {
  overflow: visible;
}

.col-date {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 1.6rem 1rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.empty a {
  color: var(--green-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-empty[hidden] {
  display: none;
}

.count {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.pager-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.pager-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.pager-controls button {
  background: var(--row);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 5px;
  min-width: 2rem;
  height: 1.9rem;
  padding: 0 0.5rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.pager-controls button:hover:not(:disabled) {
  background: var(--row-hover);
  border-color: var(--green);
}

.pager-controls button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pager-controls button.is-active {
  background: var(--green);
  border-color: #2a8a5c;
  color: #fff;
  font-weight: 600;
}

.pager-controls .ellipsis {
  color: var(--muted);
  padding: 0 0.2rem;
  font-size: 0.78rem;
}

footer {
  margin-top: 1.6rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.76rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  justify-content: space-between;
}

footer a {
  color: var(--green-bright);
}

.sr-only {
  position: absolute;
  left: -9999px;
}
