:root {
  --bg: #fafaf8; --card: #fff; --ink: #1d1d1b; --muted: #6b6b66; --line: #e4e3de;
  --accent: #1f5fbf; --accent-soft: #e8f0fb; --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --card: #1f1f1d; --ink: #ecebe6; --muted: #a09f99; --line: #34332f; --accent: #7fb0ff; --accent-soft: #1d2a3d; }
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: 14px; }

.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs button, .pill, .icon { font: inherit; border: 1px solid transparent; background: none; color: var(--ink);
  padding: 6px 12px; border-radius: var(--radius); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tools { display: flex; gap: 6px; }
.pill { border-color: var(--line); }
.icon { font-size: 20px; line-height: 1; padding: 4px 8px; }

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters input, .filters select, dialog select { font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); color: var(--ink); }
.filters input { flex: 1 1 260px; }

.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { position: sticky; top: 0; background: var(--card); font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none; }
th[aria-sort="ascending"]::after { content: " ▲"; font-size: 10px; }
th[aria-sort="descending"]::after { content: " ▼"; font-size: 10px; }
tbody tr:hover { background: var(--accent-soft); }
td:first-child { min-width: 240px; }
.badge { font-size: 11px; background: var(--accent); color: var(--card); padding: 1px 6px; border-radius: 10px; }
#more { display: block; margin: 16px auto; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); max-width: 420px; width: 90%; }
dialog label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; }
footer { padding: 16px 20px; text-align: center; font-size: 13px; color: var(--muted); }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; padding: 8px 12px; }
  .tabs { order: 3; flex-basis: 100%; }
  .tools { margin-left: auto; }
  main { padding: 12px; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  td { border: 0; padding: 2px 0; }
  td:first-child { font-weight: 600; font-size: 15px; }
  td:empty { display: none; }
}
