/* Items: the search (templates/items.html), one item (item_detail.html) and
   the comparison (item_compare.html). Classes start with it- so they never
   collide with site CSS. Every color comes from the scheme tokens. */
.it {
    /* Secondary text that stays at AA on the page and panel grounds. */
    --meta: color-mix(in srgb, var(--text) 40%, var(--text-dim));
    --wash: color-mix(in srgb, var(--highlight) 12%, transparent);
    --shade: 0 10px 28px rgba(0, 0, 0, .28);
    width: 100%;
}
.it [hidden] { display: none !important; }
.it :focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.it :where(h1, h2, p, ul, ol, dl, dd, pre) { margin: 0; }
.it :where(ul, ol) { padding: 0; list-style: none; }
.it-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.it svg { flex: none; }

/* page head */
.it-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 8px; font-size: 13px; color: var(--meta); text-decoration: none; }
.it-back svg { width: 14px; height: 14px; }
.it-back:hover { color: var(--highlight); }
.it-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; margin: 0 0 22px; }
.it-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.it .it-head h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; color: var(--text-bright); text-wrap: balance; overflow-wrap: anywhere; }
.it-deck { margin-top: 6px; max-width: 64ch; font-size: 14.5px; line-height: 1.6; color: var(--meta); text-wrap: pretty; }

/* tags: rarity, hidden, and the plain ones */
.it-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--bg-active); font-size: 11.5px; font-weight: 600; line-height: 1.45; color: var(--text); white-space: nowrap; vertical-align: 1px; }
.it-tag.is-unique { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.it-tag.is-rare { background: var(--wash); color: var(--highlight); }
.it-tag.is-hidden { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.it-head .it-tag { padding: 2px 9px; }

/* the search row: a name box, the common filters, and the button for the rest */
.it-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.it-q { flex: 1 1 160px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); color: var(--text-dim); }
.it-q svg { width: 15px; height: 15px; }
.it .it-q input { flex: 1; width: auto; min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; font-size: 13.5px; color: var(--text-bright); }
.it .it-q input::-webkit-search-decoration, .it .it-q input::-webkit-search-cancel-button { -webkit-appearance: none; }
.it-q:focus-within, .it-sel:focus-within { border-color: var(--highlight); }
.it-sel { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding-left: 12px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); font-size: 13px; color: var(--meta); white-space: nowrap; }
.it .it-sel select { width: auto; max-width: 100px; text-transform: capitalize; height: 100%; margin: 0; padding: 0 28px 0 0; border: 0; background-color: transparent; background-position: right 10px center; box-shadow: none; font-size: 13px; font-weight: 600; color: var(--text-bright); }
.it-sel.it-lv { padding-right: 6px; }
.it .it-lv input { width: 46px; height: 26px; margin: 0; padding: 0 4px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-body); font-size: 13px; font-weight: 600; text-align: center; color: var(--text-bright); -moz-appearance: textfield; }
.it .it-lv input::-webkit-inner-spin-button, .it .it-lv input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.it-more { display: inline-flex; align-items: center; gap: 8px; height: 36px; margin: 0; padding: 0 12px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); font: inherit; font-size: 13px; font-weight: 600; color: var(--text-bright); cursor: pointer; }
.it-more:hover { border-color: var(--border-hover); }
.it-more[aria-expanded="true"] { border-color: var(--border-hover); background: var(--bg-active); }
.it-more svg { width: 14px; height: 14px; }
.it-n { min-width: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: var(--wash); font-size: 11.5px; line-height: 18px; text-align: center; color: var(--highlight); }
.it-n[data-n="0"] { display: none; }
.it-narrow { display: none; }

/* a list of checkboxes that folds out of its field, for filters that take several values */
.it-ms { position: relative; }
.it-ms-field { display: inline-flex; align-items: center; height: 100%; padding: 0 28px 0 0; font-weight: 600; color: var(--text-bright); cursor: pointer; }
.it-ms-field::after { content: ""; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border-right: 1.6px solid var(--text-dim); border-bottom: 1.6px solid var(--text-dim); transform: rotate(45deg); }
.it-ms-val { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-ms-val.is-any { font-weight: 400; color: var(--text-dim); }
.it-ms-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 260px; max-width: 80vw; display: none; flex-direction: column; overflow: hidden; border: 1px solid var(--border-hover); border-radius: 10px; background: var(--bg-panel); box-shadow: var(--shade); font-size: 13.5px; color: var(--text); white-space: normal; }
.it-ms.is-open .it-ms-pop { display: flex; }
.it .it-ms-pop input[type=text] { width: auto; margin: 8px; height: 32px; font-size: 13px; }
.it-ms-opts { max-height: 260px; overflow-y: auto; padding: 0 0 6px; }
.it-ms-opts label { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer; }
.it-ms-opts label:hover { background: var(--bg-hover); }

/* the other filters, folded under the search row */
.it-panel { margin: 0 0 18px; padding: 16px 18px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.it-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.it-field { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; font-size: 12.5px; color: var(--meta); }
.it-field.is-wide { grid-column: span 2; }
.it .it-field select, .it .it-field input[type=text], .it .it-field input[type=number] { width: 100%; max-width: none; height: 36px; margin: 0; border-radius: 8px; font-size: 13.5px; }
.it-field .it-ms-field { position: relative; height: 36px; padding: 0 30px 0 10px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-body); font-size: 13.5px; }
.it-field .it-ms-val { max-width: none; }
.it-pair { display: flex; align-items: center; gap: 8px; color: var(--meta); }
.it .it-pair input { flex: 1; min-width: 0; }
.it-check { align-self: end; display: flex; align-items: center; gap: 8px; min-height: 36px; margin: 0; font-size: 13.5px; color: var(--text); cursor: pointer; }

/* filters in use, each with a cross that takes it off */
.it-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; font-size: 13px; }
.it-chips:not(:has(.it-chip:not(.is-primary))) { display: none; }
.it-chip { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 3px 0 11px; box-sizing: border-box; border-radius: 999px; background: var(--wash); color: var(--text-bright); }
.it-chip.is-primary { display: none; }
.it-chip a { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--highlight); text-decoration: none; }
.it-chip a:hover { background: color-mix(in srgb, var(--highlight) 20%, transparent); color: var(--highlight); }
.it-chip svg { width: 12px; height: 12px; }
.it-clear { padding: 0 4px; color: var(--meta); text-decoration: none; }
.it-clear:hover { color: var(--highlight); }

/* tick boxes drawn in the theme's colors */
.it .it-c-pick input, .it .it-ms-opts input, .it .it-check input {
    appearance: none; -webkit-appearance: none; flex: none; width: 16px; height: 16px; min-width: 0; margin: 0; padding: 0;
    display: inline-grid; place-content: center; box-sizing: border-box; border: 1.5px solid var(--border-hover); border-radius: 4px;
    background: var(--bg-body); cursor: pointer;
}
.it .it-c-pick input::before, .it .it-ms-opts input::before, .it .it-check input::before {
    content: ""; width: 8px; height: 4px; border-left: 2px solid var(--bg-body); border-bottom: 2px solid var(--bg-body);
    transform: translateY(-1px) rotate(-45deg); opacity: 0;
}
.it .it-c-pick input:checked, .it .it-ms-opts input:checked, .it .it-check input:checked { border-color: var(--highlight); background: var(--highlight); }
.it .it-c-pick input:checked::before, .it .it-ms-opts input:checked::before, .it .it-check input:checked::before { opacity: 1; }
.it .it-c-pick input:hover:not(:disabled), .it .it-ms-opts input:hover, .it .it-check input:hover { border-color: var(--highlight); }
.it .it-c-pick input:disabled { opacity: .35; cursor: not-allowed; }

/* the count and the sort */
.it-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 10px; }
.it-count { font-size: 13px; color: var(--meta); }
.it-count b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.it-sort { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--meta); }
.it .it-sort select { width: auto; max-width: 240px; height: 30px; margin: 0; padding: 0 28px 0 10px; border-radius: 7px; background-color: var(--bg-secondary); font-size: 13px; font-weight: 600; color: var(--text-bright); }

/* the results: a row per item, its columns set by the kind of item */
.it-table { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.it-rows { min-width: 900px; font-size: 13.5px; line-height: 1.35; }
.it-rows[data-cols="weapon"] { --cols: 22px minmax(0, 1.7fr) 52px 76px 150px minmax(0, 1.6fr) 150px; }
.it-rows[data-cols="armor"] { --cols: 22px minmax(0, 1.7fr) 52px 96px 150px minmax(0, 1.6fr) 150px; }
.it-rows[data-cols="any"] { --cols: 22px minmax(0, 1.7fr) 52px 96px 110px minmax(0, 1.6fr) 150px; }
.it-tr { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 0 14px; min-height: 42px; padding: 9px 16px; box-sizing: border-box; border-top: 1px solid var(--border); }
.it-tr:first-child { border-top: 0; }
.it-tr.is-head { min-height: 40px; padding-top: 0; padding-bottom: 0; font-size: 12.5px; color: var(--meta); }
.it-tr:not(.is-head):hover { background: var(--bg-hover); }
.it-tr.is-picked, .it-tr.is-picked:hover { background: var(--wash); }
.it-c-lvl { justify-self: end; font-variant-numeric: tabular-nums; color: var(--text-bright); }
.it-tr.is-head .it-c-lvl { color: inherit; }
.it-tr:not(.is-head) > .it-c-kind, .it-tr:not(.is-head) > .it-c-stat { text-transform: capitalize; }
.it-c-stat { white-space: nowrap; }
.it-c-name { min-width: 0; }
.it-c-name .it-tag { margin-left: 8px; }
.it-c-area { min-width: 0; color: var(--meta); }
.it-ph { display: none; }
.it-sorter { display: inline-flex; align-items: center; gap: 3px; color: var(--meta); text-decoration: none; }
.it-sorter:hover { color: var(--text-bright); }
.it-sorter.is-on { font-weight: 600; color: var(--text-bright); }
.it-sorter svg { width: 11px; height: 11px; }
.it-name { font-weight: 600; color: var(--text-bright); text-decoration: none; overflow-wrap: anywhere; }
.it-name:hover { color: var(--highlight); text-decoration: none; }
.it-dice b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-bright); }
.it-dice span { margin-left: 8px; font-variant-numeric: tabular-nums; color: var(--meta); }
.it-acs { display: inline-flex; gap: 10px; font-variant-numeric: tabular-nums; color: var(--text-bright); }
.it-affs { display: flex; flex-wrap: wrap; gap: 2px 14px; min-width: 0; }
.it-aff { white-space: nowrap; }
.it-aff b { font-weight: 600; font-variant-numeric: tabular-nums; }
.it-aff.pos b { color: var(--accent); }
.it-aff.neg b { color: var(--error); }
.it-c-pick { display: flex; }
.it-c-pick label { display: grid; place-items: center; cursor: pointer; }
.it-empty { padding: 26px 20px; border: 1px dashed var(--border); border-radius: 10px; font-size: 14px; text-align: center; color: var(--meta); }
.it .pagination { margin-top: 18px; }

/* the items picked to compare */
.it-tray { position: sticky; bottom: 16px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 20px 0 0; padding: 10px 12px 10px 16px; border: 1px solid var(--border-hover); border-radius: 10px; background: var(--bg-panel); box-shadow: var(--shade); }
.it-tray > svg { width: 16px; height: 16px; color: var(--highlight); }
.it-tray p { flex: 1 1 300px; min-width: 0; font-size: 13.5px; color: var(--text); }
.it-tray b { font-weight: 600; color: var(--text-bright); }
.it .it-tray .btn { height: 32px; margin: 0; font-size: 13px; }

/* one item */
.it-one { max-width: 920px; }
.it-seg { display: inline-flex; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary); }
.it .it-seg button { min-height: 34px; margin: 0; padding: 7px 13px; border: 0; border-left: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; font: inherit; font-size: 13.5px; line-height: 1.3; color: var(--text); cursor: pointer; }
.it .it-seg button:first-child { border-left: 0; }
.it .it-seg button:hover { background: var(--bg-hover); color: var(--text-bright); }
.it .it-seg button[aria-pressed="true"] { background: var(--bg-active); font-weight: 600; color: var(--text-bright); }
.it .it-seg button:focus-visible { outline-offset: -2px; }
.it-plate { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.it-band { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 44px; padding: 24px 26px 22px; border-bottom: 1px solid var(--border); }
.it-band-label { font-size: 12.5px; color: var(--meta); }
.it-big { margin-top: 2px; font-size: 48px; line-height: 1; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text-bright); }
.it-big-sub { margin-top: 6px; font-size: 14px; color: var(--text); }
.it-big-sub b { font-weight: 600; color: var(--text-bright); }
.it-acgrid { display: flex; flex-wrap: wrap; gap: 8px 30px; }
.it-acgrid .it-big { font-size: 40px; }
.it-typeinfo { max-width: 60ch; font-size: 15px; line-height: 1.55; white-space: pre-line; color: var(--text-bright); }
.it-cells { display: flex; flex-wrap: wrap; gap: 8px 36px; }
.it-big.is-word { max-width: 22ch; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.it-facts { display: flex; flex-wrap: wrap; gap: 14px 36px; padding-bottom: 2px; }
.it-facts dt { font-size: 12.5px; color: var(--meta); }
.it-facts dd { margin-top: 3px; font-size: 16px; font-weight: 600; color: var(--text-bright); }
.it-facts dd::first-letter { text-transform: uppercase; }
.it-facts dd.is-raw::first-letter { text-transform: none; }
.it-wflags { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; font-weight: 500; }
.it-wflags li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--bg-active); color: var(--text); }
.it-wflags svg, .it-wflags i { width: 13px; height: 13px; }
.it-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); border-bottom: 1px solid var(--border); }
.it-sec { min-width: 0; padding: 18px 26px 20px; }
.it-split > .it-sec + .it-sec { border-left: 1px solid var(--border); }
.it-sec.is-rule { border-bottom: 1px solid var(--border); }
.it .it-sec h2 { margin: 0 0 8px; padding: 0; border: 0; font-size: 13.5px; font-weight: 600; letter-spacing: 0; color: var(--text-bright); }
.it-ledger > div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 14px; }
.it-ledger > div:first-child { border-top: 0; }
.it-ledger dt { color: var(--text); }
.it-ledger dd { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-bright); }
.it-ledger .pos { color: var(--accent); }
.it-ledger .neg { color: var(--error); }
.it-ledger .is-extra dt::after { content: "  not shown by identify"; font-size: 12px; color: var(--meta); }
.it-props { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; font-weight: 500; }
.it-props li { padding: 3px 10px; border-radius: 999px; background: var(--bg-active); color: var(--text); }
.it-props .is-deny { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.it-props .is-allow { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.it-props .is-info { background: var(--wash); color: var(--highlight); }
.it-src li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.it-src li:first-child { border-top: 0; }
.it-src-ico { width: 34px; height: 34px; display: grid; place-items: center; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; color: var(--meta); }
.it-src-ico svg, .it-src-ico i { width: 15px; height: 15px; }
.it-src-name { font-weight: 600; color: var(--text-bright); overflow-wrap: anywhere; }
.it-src-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; font-size: 13px; color: var(--meta); }
.it-src-meta svg, .it-src-meta i { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }
.it-src-map { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text); text-decoration: none; white-space: nowrap; }
.it-src-map svg, .it-src-map i { width: 13px; height: 13px; }
.it-src-map:hover { color: var(--highlight); }
.it-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px 24px; padding: 16px 26px 18px; background: var(--bg-body); }
.it-foot dt { font-size: 12.5px; color: var(--meta); }
.it-foot dd { margin-top: 2px; color: var(--text-bright); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.it-foot .is-wide { grid-column: span 2; }
.it-raw { position: relative; }
.it .it-raw pre { margin: 0; padding: 20px 26px; border: 0; background: none; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.it-copy { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; height: 30px; margin: 0; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-panel); font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; }
.it-copy:hover { border-color: var(--border-hover); color: var(--text-bright); }
.it-copy svg, .it-copy i { width: 13px; height: 13px; }
.it-copy.is-copied { color: var(--accent); }
.it-find { position: relative; display: flex; align-items: center; gap: 10px; height: 44px; margin: 14px 0 0; padding: 0 14px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); color: var(--meta); }
.it-find:focus-within { border-color: var(--highlight); }
.it-find svg, .it-find > i { width: 16px; height: 16px; }
.it .it-find input { flex: 1; width: auto; min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; font-size: 14px; color: var(--text-bright); }
.it-find-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; display: none; flex-direction: column; overflow: hidden; border: 1px solid var(--border-hover); border-radius: 10px; background: var(--bg-panel); box-shadow: var(--shade); }
.it-find-results.active { display: flex; }
.it-find-results a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--text-bright); text-decoration: none; }
.it-find-results a:first-child { border-top: 0; }
.it-find-results a:hover, .it-find-results a:focus { background: var(--bg-hover); color: var(--text-bright); }
.it-find-results .cpr-type { font-size: 12.5px; color: var(--meta); white-space: nowrap; }
.it-staff { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--meta); }
.it-staff form { margin: 0; }

/* In a fight: what one hit from a weapon does against each defense (game.db weapon_fights) */
.it-fight { margin: 14px 0 0; padding: 20px 26px 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.it-fight-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin: 0 0 16px; }
.it .it-fight h2 { margin: 0; padding: 0; border: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--text-bright); }
.it-fight-deck { margin-top: 4px; max-width: 60ch; font-size: 13.5px; line-height: 1.55; color: var(--meta); }
.it-fight-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.it .it-fight-tools select { width: auto; max-width: 100%; height: 34px; }
.it .it-fight-tools .it-seg button { min-height: 32px; padding: 0 12px; font-size: 13px; }
.it-fight-rows { overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-body); }
.it .it-fight-tr { display: grid; grid-template-columns: minmax(0, 1.25fr) 120px 150px minmax(0, 1.6fr); gap: 0 16px; align-items: center; width: 100%; margin: 0; padding: 11px 16px; box-sizing: border-box; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; font: inherit; font-size: 13.5px; text-align: left; color: var(--text); cursor: pointer; }
.it .it-fight-tr.is-head { height: 38px; padding-top: 0; padding-bottom: 0; border-top: 0; font-size: 12.5px; color: var(--meta); cursor: default; }
.it .it-fight-tr:not(.is-head):hover { background: var(--bg-hover); }
.it .it-fight-tr[aria-pressed="true"] { background: var(--wash); box-shadow: inset 3px 0 0 var(--highlight); }
.it-fight-who { min-width: 0; }
.it-fight-who b { display: block; font-size: 14px; font-weight: 600; color: var(--text-bright); }
.it-fight-who span { display: block; margin-top: 1px; font-size: 12.5px; color: var(--meta); }
.it-fight-top { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--ansi-3); }
.it-fight-each { font-variant-numeric: tabular-nums; }
.it-fight-each b { font-weight: 600; color: var(--text-bright); }
.it-fight-each span { display: block; font-size: 12.5px; color: var(--meta); }
.it-fight-mix { min-width: 0; }
.it-fight-bar { display: flex; height: 8px; overflow: hidden; border-radius: 4px; background: var(--bg-active); }
.it-fight-key { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 5px; font-size: 12px; color: var(--meta); }
.it-fight-key i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; }
.it-fight .s0 { background: var(--highlight); }
.it-fight .s1 { background: color-mix(in srgb, var(--highlight) 62%, var(--bg-active)); }
.it-fight .s2 { background: color-mix(in srgb, var(--highlight) 36%, var(--bg-active)); }
.it-fight .s3 { background: color-mix(in srgb, var(--highlight) 20%, var(--bg-active)); }
.it-fight-swings { margin-top: 16px; }
.it-fight-swings-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 0 0 8px; }
.it .it-fight-swings h3 { margin: 0; padding: 0; border: 0; font-size: 13.5px; font-weight: 600; color: var(--text-bright); }
.it-fight-swings-head > span { font-size: 12.5px; color: var(--meta); }
.it-fight-log { padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--mud-bg); font-family: var(--font-mono); font-size: 13px; line-height: 1.75; color: var(--mud-fg); }
.it-fight-log > div { display: flex; justify-content: space-between; gap: 16px; }
.it-fight-log .v { color: var(--ansi-3); }
.it-fight-log .n { font-variant-numeric: tabular-nums; color: var(--meta); }
.it-fight-fine { margin-top: 14px; font-size: 12.5px; line-height: 1.55; color: var(--meta); }

/* the comparison: a column per item, a row per fact */
.it-cmp { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.it-cmp-grid { min-width: 760px; font-size: 14px; line-height: 1.4; }
.it-cmp-row { display: grid; grid-template-columns: 170px repeat(var(--n, 2), minmax(0, 1fr)); }
.it-cmp-row.is-head { border-bottom: 1px solid var(--border); }
.it-cmp-corner { align-self: end; padding: 16px 18px; font-size: 12.5px; color: var(--meta); }
.it-cmp-item { position: relative; min-width: 0; padding: 16px 44px 14px 16px; border-left: 1px solid var(--border); }
.it-cmp-item .it-name { display: block; font-size: 15px; line-height: 1.35; }
.it-cmp-sub { display: block; margin-top: 3px; font-size: 13px; color: var(--meta); }
.it-cmp-x { position: absolute; top: 12px; right: 10px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--meta); }
.it-cmp-x:hover { background: var(--bg-hover); color: var(--text-bright); }
.it-cmp-x svg { width: 14px; height: 14px; }
.it-cmp-group { padding: 14px 18px 6px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text-bright); }
[data-pane] > .it-cmp-group:first-child { border-top: 0; }
.it-cmp-label { min-width: 0; padding: 8px 18px; color: var(--meta); overflow-wrap: anywhere; }
.it-cmp-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; padding: 8px 16px; border-left: 1px solid var(--border); font-variant-numeric: tabular-nums; color: var(--text-bright); overflow-wrap: anywhere; }
.it-cmp-cell.is-best { font-weight: 600; color: var(--accent); }
.it-cmp-cell.pos { color: var(--accent); }
.it-cmp-cell.neg { color: var(--error); }
.it-cmp-cell.is-none { color: var(--text-fade); }
.it-best { padding: 0 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); font-size: 11px; font-weight: 600; line-height: 1.6; color: var(--accent); }
.it .it-cmp-raw pre { margin: 0; padding: 14px 16px; border: 0; background: none; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.it-cmp-raw { min-width: 0; border-left: 1px solid var(--border); }

@media (max-width: 700px) {
    .it .it-head h1 { font-size: 24px; }
    /* the search row folds into the Filters button */
    .it-bar .it-sel { display: none; }
    .it-form.is-open .it-bar .it-sel { display: inline-flex; flex: 1 1 calc(50% - 4px); }
    .it .it-form.is-open .it-bar .it-sel select { flex: 1; max-width: none; }
    .it-form.is-open .it-bar .it-lv { justify-content: flex-start; }
    .it-q { flex-basis: 100%; height: 44px; }
    .it .it-q input { font-size: 15px; }
    .it-more { height: 44px; padding: 0 14px; font-size: 14px; }
    .it-wide { display: none; }
    .it-narrow { display: inline; }
    .it-n.it-narrow:not([data-n="0"]) { display: inline-block; }
    .it-grid { grid-template-columns: 1fr 1fr; }
    .it-field.is-wide { grid-column: 1 / -1; }
    .it-chips, .it-chips:not(:has(.it-chip:not(.is-primary))) { display: flex; }
    .it-chips:not(:has(.it-chip)) { display: none; }
    .it-chip.is-primary { display: inline-flex; }
    .it-chip { height: 32px; }
    .it-chip a { width: 28px; height: 28px; }
    .it .it-sort select { height: 36px; }
    /* each item is a short block */
    .it-rows { min-width: 0; }
    .it-tr.is-head { display: none; }
    .it-tr.is-head + .it-tr { border-top: 0; }
    .it-tr {
        grid-template-columns: auto auto minmax(0, 1fr) 44px;
        grid-template-areas: "name name name pick" "lvl kind stat pick" "affs affs affs pick" "area area area pick";
        align-items: baseline; gap: 4px 14px; padding: 12px 6px 12px 14px;
    }
    .it-c-pick { grid-area: pick; align-self: start; }
    .it-c-pick label { width: 44px; height: 44px; margin-top: -10px; }
    .it .it-c-pick input { width: 18px; height: 18px; }
    .it-c-name { grid-area: name; font-size: 15px; }
    .it-c-lvl { grid-area: lvl; justify-self: start; }
    .it-c-kind { grid-area: kind; }
    .it-c-stat { grid-area: stat; }
    .it-c-affs { grid-area: affs; }
    .it-c-area { grid-area: area; font-size: 13px; }
    .it-ph { display: inline; color: var(--text); }
    .it .pagination a, .it .pagination span { min-width: 40px; height: 40px; }
    .it-tray { bottom: 12px; padding: 8px 8px 8px 14px; }
    .it-tray p { flex-basis: auto; }
    /* one item */
    .it-band { padding: 20px 18px 18px; gap: 14px 28px; }
    .it-big { font-size: 40px; }
    .it-big.is-word { font-size: 26px; }
    .it-sec { padding: 16px 18px 18px; }
    .it-split > .it-sec + .it-sec { border-left: 0; border-top: 1px solid var(--border); }
    .it-src li { grid-template-columns: 34px minmax(0, 1fr); }
    .it-src-map { grid-column: 2; }
    .it-foot { padding: 14px 18px 16px; }
    .it .it-raw pre { padding: 52px 16px 16px; font-size: 12.5px; }
    .it-fight { padding: 16px 14px 18px; }
    .it .it-fight-tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who each" "top top" "mix mix"; gap: 4px 12px; }
    .it .it-fight-tr.is-head { display: none; }
    .it-fight-who { grid-area: who; }
    .it-fight-each { grid-area: each; text-align: right; }
    .it-fight-top { grid-area: top; }
    .it-fight-mix { grid-area: mix; }
}
