:root {
  color-scheme: dark;
  --ink: #f2eee7;
  --muted: #a7a29e;
  --gold: #edc47f;
  --gold-soft: #c2a273;
  --bg: #100f13;
  --panel: #1a181e;
  --line: #332d36;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --body: "Inter", "Segoe UI", sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
  font: 15px/1.55 var(--body);
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; background: var(--bg); color: var(--ink) }
button, input, select { font: inherit }
button, a, select, input[type=checkbox] { cursor: pointer }
a { color: inherit; text-decoration: none }
button { color: inherit }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px }
.shell { width: min(1320px, calc(100% - 80px)); margin-inline: auto }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.skip:focus { position: absolute; z-index: 3; padding: 10px; background: var(--panel) }
.top { border-bottom: 1px solid var(--line); background: #141217 }
.masthead { min-height: 66px; display: flex; align-items: center; gap: 23px }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 16px; line-height: 1; letter-spacing: .18em; font-weight: 700; color: var(--gold) }
.brand small { display: block; margin-top: 5px; color: var(--muted); font: 8px/1 var(--body); letter-spacing: .28em }
.mark { display: grid; place-items: center; width: 31px; height: 36px; font-size: 23px; letter-spacing: 0; border: 1px solid #856d4a; border-radius: 6px 6px 13px 13px; background: #26202a }
.mast-label { color: var(--muted); font-size: .83rem; border-left: 1px solid var(--line); padding-left: 20px }
.saved-link { margin-left: auto; color: var(--muted); font-size: .86rem; display: flex; align-items: center; gap: 7px }
.saved-link:hover, .saved-link[aria-current=page] { color: var(--gold) }
.saved-link > span:first-child { font-size: 1.2rem; color: var(--gold) }
#saved-count:not(:empty) { min-width: 22px; padding: 0 5px; border-radius: 20px; text-align: center; background: #2c2430; color: var(--gold) }
.hero { margin-top: 28px; min-height: 248px; display: grid; align-items: center; border: 1px solid #494052; border-radius: 17px; overflow: hidden; background: linear-gradient(90deg, #1b1525 0%, #1b1525f5 28%, #1b1525a0 51%, #1b152518 100%), url("duskveil.webp") 75% center / cover, #251d31 }
.hero-copy { padding: 30px 43px }
h1, h2, h3, p { margin: 0 }
h1 { font: 700 clamp(2.8rem, 5.5vw, 4.8rem)/.98 var(--display); letter-spacing: -.045em }
h1 em { font-style: normal; color: var(--gold) }
.hero p { margin: 15px 0 22px; max-width: 480px; color: #ded5dc; font-size: .99rem }
.stats { display: flex; gap: 24px; align-items: stretch }
.stats a { display: flex; flex-direction: column; min-width: 77px }
.stats a + a { border-left: 1px solid #786484; padding-left: 24px }
.stats b { font: 500 1.25rem/1.2 var(--mono); color: var(--gold) }
.stats span { color: #c4b6c5; font-size: .77rem }
#reference { margin-top: 25px; scroll-margin-top: 12px }
.tabs { display: flex; align-items: center; gap: 5px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto }
.tabs a { padding: 11px 18px; color: var(--muted); border-bottom: 2px solid transparent; font-size: .92rem; font-weight: 650; white-space: nowrap }
.tabs a span { margin-right: 7px; font-family: var(--mono) }
.tabs a:hover { color: var(--ink) }
.tabs a[aria-current=page] { color: var(--gold); border-bottom-color: var(--gold); background: linear-gradient(0deg, #59403e55, transparent) }
.toolbar { display: flex; gap: 10px; align-items: stretch }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 9px; padding: 0 13px; background: var(--panel); min-height: 48px }
.search:focus-within { border-color: var(--gold-soft) }
.search input { flex: 1; background: transparent; color: var(--ink); border: 0; outline: 0; min-width: 0; cursor: text }
.search input::placeholder { color: #aaa2ad }
.search-icon { width: 14px; height: 14px; border: 1.5px solid #bca9be; border-radius: 50%; position: relative; flex: 0 0 14px; margin-right: 3px }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.5px; background: #bca9be; transform: rotate(45deg); right: -5px; bottom: -2px }
kbd { font-family: var(--mono); color: var(--muted); border: 1px solid #49404c; border-radius: 4px; padding: 0 7px }
.select select { min-height: 43px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 0 28px 0 12px; font-size: .86rem }
.toolbar .select select { height: 100%; min-height: 48px }
.catalog-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); align-items: start; gap: 18px; margin-top: 15px }
.catalog-layout:has(.category-nav[hidden]) { grid-template-columns: minmax(0, 1fr) }
.catalog-content { min-width: 0 }
.category-nav { position: sticky; top: 12px; min-width: 0; max-height: calc(100vh - 24px); overflow: auto; border: 1px solid var(--line); border-radius: 11px; padding: 9px; background: var(--panel) }
.category-nav h2 { padding: 4px 9px 8px; color: var(--muted); font-size: .82rem; font-weight: 650 }
.category-list { display: grid; gap: 2px }
.catalog-category { display: flex; align-items: center; justify-content: space-between; gap: 7px; width: 100%; min-height: 35px; padding: 5px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; text-align: left; color: #e3dce5; font-size: .83rem; line-height: 1.2 }
.catalog-category:hover { background: #292230 }
.catalog-category[aria-pressed=true] { color: var(--gold); background: #382b30; border-color: #74594e }
.catalog-category.custom-category { color: var(--gold); font-weight: 700 }
.category-count { flex-shrink: 0; color: var(--muted); font: .72rem var(--mono); font-variant-numeric: tabular-nums }
[aria-pressed=true] > .category-count { color: var(--gold-soft) }
.more-categories { display: none }
.quick { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px }
.quick button { white-space: nowrap; color: #c6bec9; background: #18151c; border: 1px solid var(--line); border-radius: 20px; padding: 5px 11px; font-size: .79rem }
.quick button[aria-pressed=true] { color: var(--gold); background: #382b30; border-color: #74594e }
.list-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 8px 14px; margin: 1px 0 11px }
.list-heading > div:first-child { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap }
.list-heading h2 { font: 700 1.76rem/1.2 var(--display) }
.muted { color: var(--muted); font-size: .82rem }
.list-controls { display: flex; align-items: center; gap: 12px }
.icon-toggle { color: var(--muted); white-space: nowrap; font-size: .8rem }
.icon-toggle input { margin: 0 4px 0 0; accent-color: var(--gold) }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 11px }
.item-card, .command-card, .mob-card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); overflow: hidden }
.item-card:hover, .mob-card:hover, .command-card:hover { border-color: #71586d }
.item-main, .mob-main { display: flex; flex-direction: column; align-items: stretch; width: 100%; text-align: left; border: 0; padding: 0; background: none }
.item-main:focus-visible, .mob-main:focus-visible { outline-offset: -3px }
.item-art { height: 104px; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 80%, #3a2d49, #211b2a 67%, #1d1823); border-bottom: 1px solid #38303e }
.sprite { width: 64px; height: 96px; display: block; flex: 0 0 auto; background-repeat: no-repeat; image-rendering: pixelated }
.sprite.empty { display: grid; place-items: center; color: #a091a7; font: 22px var(--display) }
.item-text { display: flex; flex-direction: column; gap: 4px; padding: 10px 11px 7px; min-height: 71px }
.item-text strong { font-size: .86rem; line-height: 1.24; overflow-wrap: anywhere }
.item-text small { color: var(--muted); font-size: .72rem }
.card-foot { padding: 0 10px 10px; display: flex; align-items: center; justify-content: space-between }
.copy-id, .copy-command { background: #27212d; border: 1px solid #493c50; border-radius: 6px; padding: 3px 7px; font: .78rem/1.55 var(--mono); color: var(--gold) }
.copy-id:hover, .copy-command:hover { border-color: var(--gold-soft) }
.copy-id span { margin-left: 5px }
.star { position: absolute; top: 6px; right: 7px; width: 28px; height: 28px; border: 1px solid #493b4e; border-radius: 6px; background: #1a1520e8; font-size: 17px; color: #c4b5c7; line-height: 1 }
.star[aria-pressed=true] { color: var(--gold); border-color: #836643 }
.mob-card { padding: 13px; min-height: 139px }
.mob-main { padding-right: 20px }
.mob-main strong { font-size: 1rem; line-height: 1.25; margin: 9px 0 7px }
.mob-card .card-foot { padding: 0; margin-top: 12px }
.mob-cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) }
.tag, .overline { color: #d4b6df; font-size: .73rem }
.tag { display: inline-flex; align-self: flex-start; background: #322739; border-radius: 4px; padding: 2px 6px; line-height: 1.45 }
.tag.impact { color: #ffc3af; background: #44272a }
.command-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px }
.command-card { padding: 15px 16px; display: flex; flex-direction: column; gap: 8px }
.command-card h3 { font-size: .97rem; padding-right: 24px; line-height: 1.3 }
.command-card p { color: #cec5d1; font-size: .84rem }
.command-card .tags, .detail-tags { display: flex; flex-wrap: wrap; gap: 6px }
.command-line { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 7px 8px; background: #131016; border: 1px solid var(--line); border-radius: 7px; margin-top: auto }
code { font: .81rem/1.45 var(--mono); color: var(--gold); overflow-wrap: anywhere }
.copy-command { flex-shrink: 0; font-family: var(--body) }
.example { align-self: start; text-align: left }
.command-help { margin: 0 0 10px; color: var(--muted); font-size: .82rem }
.empty-state { padding: 34px 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 7px }
.pages { display: flex; justify-content: center; align-items: center; gap: 11px; margin: 19px 0 }
.plain, .action { border: 1px solid var(--line); border-radius: 7px; padding: 7px 11px; background: #26202b; font-size: .85rem }
.plain:disabled { opacity: .4; cursor: default }
.action { color: #231827; background: var(--gold); font-weight: 700; border-color: transparent }
.plain:hover:not(:disabled) { border-color: var(--gold-soft) }
.action:hover { background: #ffdb9d }
.footer { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .77rem; margin-top: 27px; padding-block: 16px 24px; border-top: 1px solid var(--line) }
dialog { max-width: min(560px, calc(100% - 28px)); width: 100%; border: 1px solid #665269; border-radius: 14px; padding: 17px 20px 22px; color: var(--ink); background: #1d1823; box-shadow: 0 22px 80px #000b }
dialog::backdrop { background: #0b080dc9 }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 10px }
.overline { letter-spacing: .09em; text-transform: uppercase }
.close { font-size: 1.32rem; line-height: 1; padding: 5px 9px }
.detail-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 13px }
.detail-head h2 { font: 700 1.85rem/1.07 var(--display); margin-bottom: 6px }
.detail-art { min-width: 82px; height: 105px; border: 1px solid var(--line); border-radius: 9px; background: radial-gradient(ellipse, #41314f, #241b2e); display: grid; place-items: center }
.detail-copy { color: #d9d0dc; white-space: pre-line; margin: 8px 0 17px }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px }
.quantity { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin-bottom: 8px }
.quantity input { width: 82px; color: var(--ink); background: #131016; border: 1px solid #4a3c4e; padding: 4px 7px; border-radius: 5px; cursor: text }
.toast { position: fixed; z-index: 20; bottom: 19px; left: 50%; transform: translateX(-50%); color: var(--ink); background: #292032; border: 1px solid #766081; padding: 9px 14px; border-radius: 8px; max-width: calc(100vw - 28px); overflow-wrap: anywhere }
@media (max-width: 880px) {
  .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 13px }
  .category-nav { position: static; max-height: none; overflow: visible }
  .category-list { display: flex; flex-wrap: wrap; gap: 6px }
  .catalog-category { width: auto; min-height: 34px; background: #211c26; border-color: var(--line) }
  .category-list:not(.expanded) .extra-category:not([aria-pressed=true]) { display: none }
  .more-categories { display: inline-block; margin: 8px 0 0; padding: 4px 8px; font-size: .8rem }
}
@media (max-width: 720px) {
  .shell { width: calc(100% - 30px) }
  .hero { margin-top: 16px; background-position: 72% center; min-height: 220px }
  .hero-copy { padding: 23px 21px }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .mob-cards, .command-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .toolbar { flex-wrap: wrap }
  .search { flex-basis: 100% }
  .list-heading { align-items: start; flex-direction: column; gap: 8px }
  .list-controls { flex-wrap: wrap }
  .tabs a { padding-inline: 11px }
}
@media (max-width: 460px) {
  .mast-label { display: none }
  .hero p { font-size: .86rem }
  .stats { gap: 10px }
  .stats a + a { padding-left: 10px }
  .stats a { min-width: 65px }
  .stats b { font-size: 1rem }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .command-grid { grid-template-columns: 1fr }
}
