:root {
    color-scheme: dark;
    --bg: #0e1115;
    --panel: #171b20;
    --line: #2b3037;
    --text: #e8ecf0;
    --muted: #a0a9b4;
    --brand: #d7b66d;
    --gearset: #70c999;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; }
button, input { font: inherit; }
a:focus-visible, summary:focus-visible, input:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}
.wrap { max-width: 1600px; margin: auto; padding: 18px 24px 28px; }
.page-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-brand { display: flex; align-items: center; gap: 9px; font-weight: 650; }
.brand-mark { color: var(--brand); font-size: 12px; letter-spacing: .04em; }
.top-actions { display: flex; gap: 16px; }
.button { color: var(--muted); text-decoration: none; font-size: 13px; }
.button:hover { color: var(--text); }
.page-heading { margin: 20px 0 16px; }
h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.025em; }
.page-caption { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.edition { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.edition > a { text-decoration: none; }
.edition > a:hover { text-decoration: underline; }
.edition details { max-width: 700px; }
.edition summary { cursor: pointer; }
.edition p { margin: 6px 0 0; }
.data-warning { padding: 10px 12px; border: 1px solid var(--brand); border-radius: 5px; color: var(--brand); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.tab.active { background: #20252b; border-color: var(--line); color: var(--text); }
.tab:hover { color: var(--text); }
.tab-count { color: var(--muted); font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.search { width: 280px; min-width: 0; max-width: 100%; margin-left: auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 5px; background: #14181d; color: var(--text); }
.search::placeholder { color: var(--muted); }
.details-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; cursor: pointer; color: var(--muted); font-size: 12px; }
.details-toggle input { accent-color: var(--gearset); }
.results-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 0; color: var(--muted); font-size: 12px; }
.sets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); align-items: start; gap: 10px; }
.set-card { --set-color: var(--brand); min-width: 0; border: 1px solid var(--line); border-left: 2px solid var(--set-color); border-radius: 5px; padding: 12px; background: var(--panel); }
.set-card[data-kind="gearset"] { --set-color: var(--gearset); background: #151f1d; }
.set-card:hover { border-color: var(--set-color); }
.set-card[hidden] { display: none; }
.set-head { display: flex; align-items: flex-start; gap: 10px; min-height: 40px; margin-bottom: 8px; }
.set-icon { display: grid; place-items: center; flex: 0 0 32px; height: 32px; }
.set-icon img { width: 32px; height: 32px; object-fit: contain; }
.set-name { min-width: 0; }
.set-name h2 { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.set-core { display: flex; align-items: center; gap: 5px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.set-core::before { content: ""; width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.set-core[data-core="Weapon Damage"]::before { background: #e88c8c; }
.set-core[data-core="Armor"]::before { background: #85b9e8; }
.set-core[data-core="Skill Tier"]::before { background: #e8cc7e; }
.bonuses { display: grid; gap: 5px; }
.bonus-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: baseline; gap: 7px; }
.piece, .talent-piece { color: var(--set-color); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bonus-text { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.set-details { margin-top: 8px; padding-top: 5px; border-top: 1px solid var(--line); }
.set-detail summary { display: grid; grid-template-columns: 18px minmax(0, 1fr) 10px; gap: 7px; align-items: start; min-height: 28px; padding: 4px 0; cursor: pointer; list-style: none; font-size: 12px; line-height: 1.5; }
.set-detail summary::-webkit-details-marker { display: none; }
.set-detail summary::after { content: "+"; color: var(--muted); text-align: right; }
.set-detail[open] > summary::after { content: "−"; }
.set-detail summary:hover { color: var(--set-color); }
.talent-summary, .named-summary { min-width: 0; overflow-wrap: anywhere; }
.talent-summary strong, .named-summary strong { font-weight: 550; }
.slot-icon { width: 16px; height: 16px; object-fit: contain; margin-top: 1px; opacity: .75; }
.detail-body { margin: 0 0 8px 25px; color: var(--muted); font-size: 12px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.core-breakdown { margin: 4px 0 8px 25px; font-size: 11px; color: var(--muted); }
.core-breakdown div { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; }
.core-breakdown img { width: 14px; height: 14px; object-fit: contain; }
.pvp-detail > summary { grid-template-columns: minmax(0, 1fr) 10px; color: var(--muted); font-size: 11px; }
.pvp-bonuses { margin: 3px 0 8px; }
.pvp-bonuses .bonus-text { color: var(--muted); font-size: 11px; }
.named-caption { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.named-talent { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
.named-chip-meta { white-space: pre-line; }
.named-chip-meta strong { color: var(--text); font-weight: 550; }
.named-attr-list { display: grid; gap: 6px; }
.named-attr-pair { display: grid; gap: 2px; }
.named-attr { color: var(--text); }
.named-prototype { color: #c4a3e4; }
.named-prototype span { margin-right: 5px; font-size: 10px; }
.talents { margin: 10px 0 0; padding-top: 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.talent { display: block; margin-top: 3px; }
.empty-state { display: none; align-items: center; justify-content: center; min-height: 160px; border: 1px dashed var(--line); border-radius: 5px; color: var(--muted); }
.footer { margin-top: 28px; color: var(--muted); font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 700px) {
    .wrap { padding: 16px; }
    .toolbar { gap: 10px 16px; }
    .search { order: 3; width: 100%; }
    .details-toggle { margin-left: auto; }
    .sets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .wrap { padding: 14px; }
    h1 { font-size: 23px; }
    .page-heading { margin-top: 22px; }
    .sets-grid { grid-template-columns: minmax(0, 1fr); }
    .set-head { min-height: 0; }
    .tab { padding: 8px 10px; }
    .details-toggle { margin-left: 0; }
}
