:root {
  --bg0: #0f1410;
  --bg1: #182018;
  --ink: #e7efe6;
  --muted: #9aab9a;
  --line: #2a382c;
  --accent: #c4a35a;
  --danger: #e07a5f;
  --ok: #7d9b76;
  --font: "Segoe UI", "IBM Plex Sans", sans-serif;
  --mono: "Cascadia Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #243124 0%, transparent 55%),
    linear-gradient(160deg, var(--bg0), #121813 55%, #1a2218);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 920px; margin: 0 auto; padding: 28px 20px 60px; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; gap: 16px;
}
.brand {
  font-size: 1.35rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--ink); text-decoration: none;
}
nav { display: flex; gap: 14px; align-items: center; color: var(--muted); }
nav a { color: var(--muted); }
.inline { display: inline; margin: 0; }
.linkish {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; padding: 0;
}
.linkish:hover { color: var(--accent); }
.panel {
  background: color-mix(in srgb, var(--bg1) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 26px;
  backdrop-filter: blur(6px);
}
.auth { max-width: 420px; margin: 40px auto; }
h1 { margin: 0 0 10px; font-size: 1.55rem; font-weight: 650; }
.note, .meta { color: var(--muted); margin: 0 0 18px; line-height: 1.45; }
.err { color: var(--danger); }
.stack { display: grid; gap: 14px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
label { display: grid; gap: 6px; font-size: 0.92rem; color: var(--muted); }
input, select, button, summary {
  font: inherit;
}
input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #101610;
  color: var(--ink);
}
button[type="submit"] {
  justify-self: start;
  padding: 11px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #1a1408;
  font-weight: 650;
  cursor: pointer;
}
button[type="submit"]:hover { filter: brightness(1.05); }
.checks { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.checks legend { padding: 0 6px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.check input { width: auto; }
details { border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; }
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 10px;
  text-align: left;
}
.stats span { display: block; font-size: 1.35rem; font-weight: 700; }
.stats small { color: var(--muted); font-weight: 600; }
.stats .explain { margin: 6px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 14px 16px;
  margin: 0;
}
.block legend { padding: 0 6px; color: var(--ink); font-weight: 650; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 8px 0 0; line-height: 1.4; }
.all-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  margin: 12px 0 4px;
}
.picker.disabled {
  opacity: 0.55;
  pointer-events: none;
}
.all-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  margin: 12px 0 4px;
}
.picker.disabled { opacity: 0.45; pointer-events: none; }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.picker-results {
  margin-top: 8px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101610;
}
.picker-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
}
.picker-item:hover { background: #1a241c; }
.picker-item strong { color: var(--accent); margin-right: 6px; }
.picker-item em { color: var(--muted); font-style: normal; display: block; font-size: 0.8rem; }
.picker-empty { padding: 10px; color: var(--muted); font-size: 0.9rem; }
.picker-selected {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
}
.picker-selected.empty { color: var(--muted); font-size: 0.88rem; align-items: center; }
.chip {
  border: 1px solid var(--line);
  background: #1a241c;
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip:hover { border-color: var(--danger); color: var(--danger); }
.facts { margin: 0 0 18px; display: grid; gap: 10px; }
.facts > div { display: grid; grid-template-columns: 160px 1fr; gap: 8px; }
.facts dt { color: var(--muted); margin: 0; }
.facts dd { margin: 0; }
.sub { font-size: 1rem; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.tag { color: var(--accent); font-style: normal; font-size: 0.85rem; }
.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters-clip {
  max-height: 4.5em;
  overflow: auto;
  line-height: 1.35;
  word-break: break-word;
}
.progress-wrap { margin: 0 0 18px; }
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: #101610;
  border: 1px solid var(--line);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 35%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8a7340, var(--accent), #e2c987);
}
.progress-bar.indeterminate {
  animation: progress-slide 1.2s ease-in-out infinite;
}
.progress-bar.determinate {
  transition: width 0.35s ease;
  animation: none;
}
.progress-label { margin: 8px 0 0; font-size: 0.88rem; }
@keyframes progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.mono { font-family: var(--mono); }
.status { margin: 8px 0; }
.errbox {
  background: #1c1210;
  border: 1px solid #5a3028;
  color: #f0b4a4;
  padding: 12px;
  border-radius: 8px;
  overflow: auto;
  white-space: pre-wrap;
}
.hidden { display: none; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
