:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #111722;
  --panel-strong: #17202e;
  --line: #2a3444;
  --text: #e8edf5;
  --muted: #9ba8ba;
  --accent: #6ee7ff;
  --trade: #74f2a6;
  --restricted: #ff8f9c;
  --chip: #1b2534;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.42 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(9, 11, 16, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.wrap { max-width: 1300px; margin: 0 auto; padding: 14px 16px; }
h1 { margin: 0 0 10px; font-size: 22px; letter-spacing: 0; }
.summary, .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pill, .chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--chip);
  color: #d6deea;
  font-size: 12px;
}
.pill { min-height: 28px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.pill strong { color: var(--text); }
.chip.BTA, .chip.BTC, .chip.restricted { color: var(--restricted); background: #351b24; }
.chip.BoE, .chip.trade { color: var(--trade); background: #163022; }
.controls {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(4, minmax(125px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}
label { display: grid; gap: 4px; font-size: 12px; font-weight: 650; color: var(--muted); }
input, select, button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
}
input::placeholder { color: #6f7d90; }
button { cursor: pointer; font-weight: 700; }
main.wrap { padding-top: 12px; }
.section, .category {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  margin-bottom: 12px;
  overflow: hidden;
}
summary {
  cursor: pointer;
  user-select: none;
  padding: 10px 12px;
  font-weight: 760;
  background: var(--panel-strong);
  border-bottom: 1px solid var(--line);
}
.section.trade > summary { color: var(--trade); }
.section.priority > summary { color: var(--accent); }
.section.restricted > summary { color: var(--restricted); }
.category-body {
  padding: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}
.item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
}
.icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: #222d3b;
  object-fit: contain;
}
.title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.name { font-weight: 780; overflow-wrap: anywhere; }
.meta { color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
details.item-extra { margin-top: 6px; }
.item-extra > summary {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-weight: 700;
}
.details-grid { display: grid; gap: 6px; margin-top: 6px; }
.line { overflow-wrap: anywhere; }
.effect-name { font-weight: 700; }
blockquote {
  margin: 4px 0 0;
  padding-left: 10px;
  border-left: 3px solid var(--line);
  color: #c3ccda;
}
.empty { padding: 20px; text-align: center; color: var(--muted); }
@media (max-width: 1000px) {
  .controls { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .controls label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .wrap { padding: 10px; }
  .controls { grid-template-columns: 1fr 1fr; }
  .item { grid-template-columns: 38px minmax(0, 1fr); }
  .title { display: block; }
}
