:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #777;
  --line: #e4e4e4;
  --accent: #1a1a1a;
  --accent-fg: #fff;
  --error: #c0392b;
  --notice: #f1f6ee;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --fg: #e8e8e8;
    --muted: #8a8a8a;
    --line: #2a2a2a;
    --accent: #e8e8e8;
    --accent-fg: #141414;
    --error: #ff6b5b;
    --notice: #1c2619;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 820px; margin: 0 auto; padding: 40px 16px; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 40px 0 12px; }
header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--error); min-height: 1em; margin: 8px 0; }

#login { max-width: 300px; margin: 15vh auto 0; }
#login h1 { margin-bottom: 16px; }
#login form { display: flex; flex-direction: column; gap: 8px; }

input:not([type=checkbox]) {
  font: inherit; color: inherit; background: transparent;
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px;
}
input:focus { outline: none; border-color: var(--muted); }
button {
  font: inherit; cursor: pointer; border-radius: 6px; padding: 7px 14px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg);
}
button.ghost { background: transparent; color: var(--fg); border-color: var(--line); padding: 3px 10px; font-size: 12px; }
button.ghost:hover { border-color: var(--muted); }
button.link { background: none; border: none; color: var(--muted); padding: 0; font-size: 12px; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }

.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.track { flex: 1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

table { width: 100%; border-collapse: collapse; margin-top: 16px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
td.name { word-break: break-all; }
td.actions { text-align: right; white-space: nowrap; }
td.actions button + button { margin-left: 6px; }
.notice { background: var(--notice); padding: 10px 12px; border-radius: 6px; margin: 8px 0; }
.notice code { font-size: 13px; }
body:not(.is-admin) .owner-col { display: none; }

#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--accent-fg); padding: 8px 14px; border-radius: 6px;
}

@media (max-width: 560px) {
  th:nth-child(4), td:nth-child(4) { display: none; }
}
