:root {
  --fg: #1b1b1b;
  --muted: #6b6b6b;
  --line: #d8d8d8;
  --bg: #ffffff;
  --accent: #0b5aa2;
  --active: #1a7f37;
  --wip: #9a6700;
  --missing: #b23c3c;
  --gone: #8a8a8a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: ui-monospace, "SF Mono", "Menlo", "Consolas", "DejaVu Sans Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
}

header {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--fg); text-decoration: none; }
nav a { color: var(--accent); text-decoration: none; }
.asof { margin-left: auto; color: var(--muted); }

main { padding: 16px; }

.search { margin-bottom: 12px; }
.search input {
  width: 100%;
  max-width: 480px;
  padding: 5px 8px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 3px;
}

table {
  border-collapse: collapse;
  width: 100%;
}
th, td {
  text-align: left;
  padding: 4px 12px 4px 0;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}
thead th { color: var(--muted); font-weight: 400; border-bottom: 1px solid var(--fg); }
thead a { color: inherit; text-decoration: none; }
thead a:hover { color: var(--fg); }
.arrow { color: var(--accent); }
tbody tr:hover { background: #f5f7fa; }

td.id a { color: var(--accent); text-decoration: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.path { width: 100%; max-width: 0; }
td.path a, td.path .pathwrap { display: flex; min-width: 0; color: var(--fg); text-decoration: none; }
.dir {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  direction: rtl;
  text-align: left;
  color: var(--muted);
}
td.via { color: var(--muted); }
td.seen { white-space: nowrap; color: var(--muted); }
.name { flex: none; font-weight: 600; }
td.path a:hover .name { color: var(--accent); }
.copypath { cursor: pointer; }
td.path .copypath:hover .name { color: var(--accent); }
.copypath.copied .name, .copypath.copied .dir { color: var(--active); }

#copybubble {
  position: fixed;
  z-index: 50;
  transform: translate(-50%, -145%);
  padding: 2px 7px;
  font-size: 11px;
  color: var(--bg);
  background: var(--fg);
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease-out;
  white-space: nowrap;
}
#copybubble.show { opacity: 0.92; }
.src { color: var(--muted); }
.na { color: var(--muted); }

.status { font-weight: 600; }
.status-active { color: var(--active); }
.status-wip { color: var(--wip); }
.status-missing { color: var(--missing); }
.status-gone { color: var(--gone); }
.status-retired { color: var(--gone); }
tr.retired td { color: var(--gone); }
tr.retired .name { color: var(--gone); font-weight: 400; }
h1 .status-retired { font-size: 13px; font-weight: 400; }
.curate { margin: 0 0 16px; }

.empty { color: var(--muted); }
.note { color: var(--muted); margin: -4px 0 12px; }

.search select {
  padding: 5px 8px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 3px;
  margin-left: 8px;
}

h2 { font-size: 15px; margin: 22px 0 8px; }
tr.cov-total td, tr.cov-residue td { font-weight: 700; }

h1 { font-size: 22px; margin: 4px 0 2px; }
.fullpath { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.fullpath span { color: var(--fg); word-break: break-all; }
.fullpath .copypath:hover { color: var(--accent); }
.fullpath .copypath.copied { color: var(--active); }

table.spec { width: auto; }
table.spec th {
  color: var(--muted);
  font-weight: 400;
  padding-right: 24px;
  border-bottom: 1px solid var(--line);
}
table.spec td { border-bottom: 1px solid var(--line); }

.auth { display: flex; align-items: center; gap: 6px; }
.auth input {
  padding: 4px 7px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.auth .who { color: var(--active); font-weight: 600; }

button {
  font: inherit;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}
button:hover { border-color: var(--fg); }

th.act, td.act { white-space: nowrap; padding-right: 10px; width: 1%; }
td.act form { display: inline; }
td.act button { padding: 2px 8px; margin-right: 4px; }
button.accept { color: var(--active); border-color: var(--active); }
button.reject { color: var(--missing); border-color: var(--missing); }
button.restore { color: var(--accent); border-color: var(--accent); }

details.ignored { margin-top: 20px; }
details.ignored summary { color: var(--muted); cursor: pointer; }
details.ignored table { margin-top: 8px; }

.badge {
  display: inline-block;
  padding: 0 6px;
  font-size: 11px;
  color: var(--bg);
  background: var(--wip);
  border-radius: 3px;
  vertical-align: middle;
}
.withdraw { display: inline; margin: 0 4px 0 0; }
button.badge { border: none; margin-right: 4px; cursor: pointer; }
button.badge:hover { background: var(--missing); }

.register { display: flex; gap: 8px; margin: 0 0 12px; }
.register input {
  flex: 1;
  max-width: 480px;
  padding: 5px 8px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 3px;
}

h2 { font-size: 13px; font-weight: 400; color: var(--muted); margin: 24px 0 8px; }
.tablewrap { overflow-x: auto; }
table.head { border-collapse: collapse; width: 100%; }
table.head th, table.head td {
  border: 1px solid var(--line);
  padding: 4px 8px;
  text-align: left;
  vertical-align: top;
}
table.head th { color: var(--muted); font-weight: 400; white-space: nowrap; }
table.head td .cellimg {
  max-height: 220px;
  max-width: 300px;
  border: 1px solid var(--line);
  display: block;
}
table.head td .cellaudio { height: 34px; width: 100%; min-width: 300px; }
table.head td .celltext {
  margin: 0;
  font: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  min-width: 240px;
  max-height: 300px;
  overflow: auto;
}
table.head td .celltext code.hljs { background: transparent; padding: 0; }

button.aictx { font: inherit; padding: 4px 10px; margin: 8px 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 3px; background: var(--bg); color: var(--accent); }
