:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1c1f24;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --hover: #f1f5ff;
  --danger: #b91c1c;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --panel: #1a1d23;
    --text: #e6e8eb;
    --muted: #9aa1ab;
    --line: #2a2e36;
    --accent: #7aa2ff;
    --hover: #222838;
    --danger: #f87171;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
a { color: inherit; text-decoration: none; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form {
  width: 100%; max-width: 340px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 28px;
  display: grid; gap: 14px;
}
.login h1 { margin: 0 0 4px; font-size: 20px; }
.login label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.login input {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
.login input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.msg { margin: 0; color: var(--danger); font-size: 13px; }
button {
  font: inherit; cursor: pointer; border-radius: 8px; padding: 9px 14px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
header button { background: transparent; color: var(--muted); border-color: var(--line); padding: 5px 12px; font-size: 13px; }
header button:hover { color: var(--text); }

/* browse */
header {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
header form { margin: 0; flex: none; }
.crumbs { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.crumbs a { color: var(--accent); }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--muted); margin: 0 6px; font-weight: 400; }

main { max-width: 960px; margin: 0 auto; padding: 16px; }
.list {
  list-style: none; margin: 0; padding: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.list li {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: 0; }
.list li:hover { background: var(--hover); }
.list a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; min-width: 0; }
.list .name { overflow-wrap: anywhere; }
.list .size, .list time { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.list time { padding-right: 14px; }
.list .empty { display: block; padding: 24px; color: var(--muted); text-align: center; }
.icon { flex: none; width: 18px; height: 18px; border-radius: 3px; }
.dir .icon, .up .icon { background: #f5b942; clip-path: polygon(0 15%, 40% 15%, 50% 28%, 100% 28%, 100% 90%, 0 90%); }
.file .icon { border: 2px solid var(--muted); border-radius: 2px; width: 14px; margin: 0 2px; }
.dir .name { font-weight: 600; }

@media (max-width: 600px) {
  .list li { grid-template-columns: 1fr auto; gap: 0 12px; }
  .list .size { display: none; }
}
