/* The Items page (#/items, js/views/items.js; docs/item-database.md §10):
   the switches on top (Items | Sets, the Show toggles,
   the nine class buttons), the filters beside the list (a drawer above it
   up to 1100 px), the list (a card per row up to 720 px), an opened row
   (the tooltip, the sources, the set) and the Sets view's cards.
   Shared pieces it borrows: .pf-select / .pf-search / .pf-label
   (css/views.css), .chip (quality chips), .bis-chip (tier chips),
   .ah-reset / .ah-more / .ah-check (css/market.css), .item-tile, .tip-*. */

/* --- the switches on top ------------------------------------------------------------ */

.it-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.7rem;
}

.it-view {
  text-decoration: none;
}

.it-view[aria-current="page"] {
  color: var(--text-on-gold);
  background: linear-gradient(180deg, var(--gold-bright), var(--surface-gold) 55%, #c99a2e);
  box-shadow: 0 0 0 1px var(--ink-line), 0 4px 12px rgba(212, 175, 55, 0.25);
}

.it-view:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

/* The Show group: three switches (role="switch", aria-checked), one per group of items. */
.it-show {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.6rem;
}

.it-show-label {
  margin-right: 0.15rem;
}

.it-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.6rem;
  padding: 0.3rem 0.9rem 0.3rem 0.4rem;
  border: 1px solid var(--panel-line-strong);
  border-radius: 999px;
  background: rgba(6, 5, 9, 0.7);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 700;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.it-switch:hover {
  border-color: var(--gold);
}

.it-switch:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

.it-switch-track {
  position: relative;
  flex: none;
  width: 2.75rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: #1b1622;
  transition: background var(--t-fast), border-color var(--t-fast);
}

.it-switch-knob {
  position: absolute;
  top: 0.15rem;
  left: 0.17rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #8c8176;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  transition: translate var(--t-fast), background var(--t-fast);
}

.it-switch[aria-checked="true"] .it-switch-track {
  border-color: var(--jade);
  background: #1d4d38;
}

.it-switch[aria-checked="true"] .it-switch-knob {
  translate: 1.2rem 0;
  background: #c9f5dc;
}

/* each group's colour when on: seen green (above), expected blue, everything else ember */
.it-switch-expected[aria-checked="true"] .it-switch-track {
  border-color: #5aaeff;
  background: #1c3a5c;
}

.it-switch-expected[aria-checked="true"] .it-switch-knob {
  background: #d6ebff;
}

.it-switch-other[aria-checked="true"] .it-switch-track {
  border-color: var(--ember);
  background: #5a3414;
}

.it-switch-other[aria-checked="true"] .it-switch-knob {
  background: #ffe1bf;
}

/* The line under them: what the list holds. */
.it-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  font-size: var(--fs-small);
  color: var(--text-ok);
}

.it-line::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 8px rgba(79, 211, 154, 0.6);
}

.it-line-all {
  color: var(--text-warn);
}

.it-line-all::before {
  background: var(--ember);
  box-shadow: 0 0 8px rgba(255, 138, 43, 0.6);
}

/* The nine class buttons: a class-coloured disc with the class icon, the name beside it. */
.it-classes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.it-class {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.2rem 0.85rem 0.2rem 0.25rem;
  border: 1px solid color-mix(in srgb, var(--class-color) 45%, transparent);
  border-radius: 999px;
  background: #0f0b14;
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--class-text);
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), translate var(--t-fast);
}

.it-class:hover {
  translate: 0 -1px;
  border-color: var(--class-color);
}

.it-class:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

.it-class[aria-pressed="true"] {
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, color-mix(in srgb, var(--class-color) 30%, #0f0b14), #0f0b14);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--class-color) 70%, transparent), 0 0 14px color-mix(in srgb, var(--class-color) 45%, transparent);
}

.it-class-disc {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--class-color) 55%, #120c18), color-mix(in srgb, var(--class-color) 25%, #08060b) 75%);
  border: 2px solid color-mix(in srgb, var(--class-color) 70%, #000);
}

.it-class-disc .ci {
  width: 82%;
  height: 82%;
}

.it-class-note {
  margin: 0 0 0.85rem;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* --- loading, not published, failed --------------------------------------------- */

.it-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.4rem 1.5rem;
}

.it-state-title {
  font-family: var(--font-display);
  font-size: var(--fs-name);
  font-weight: 700;
  color: var(--text-gold-bright);
}

.it-state-text {
  max-width: 44rem;
  font-size: var(--fs-text);
  color: var(--text-muted);
}

/* --- the Items view: filters beside the list -------------------------------------- */

.it-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 17rem) minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}

.it-side {
  position: sticky;
  top: 3.8rem;
  max-height: calc(100vh - 4.8rem);
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

.it-drawer-head {
  padding: 0.85rem 1.1rem 0.55rem;
}

.it-drawer-title {
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: 800;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-gold);
}

.it-filter-toggle {
  display: none;
}

.it-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0 1rem 1.1rem;
}

.it-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.it-fs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.it-fs > legend {
  margin-bottom: 0.35rem;
  padding: 0;
}

.it-range {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.it-level {
  width: 5.2rem;
}

.it-dash {
  color: var(--text-muted);
}

.it-qualities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr));
  gap: 0.4rem;
}

.it-q {
  min-height: 2.3rem;
  font-family: var(--font-body);
}

/* --- the list ------------------------------------------------------------------------ */

.it-results {
  min-width: 0;
}

.it-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem 1rem;
  margin-bottom: 0.7rem;
}

.it-search-field {
  flex: 1 1 16rem;
}

.it-count {
  padding-bottom: 0.55rem;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.it-notfound {
  margin-bottom: 0.7rem;
  padding: 0.55rem 0.8rem;
  border-left: 3px solid var(--gold-dim);
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.it-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.it-th {
  position: sticky;
  top: 3.05rem;
  z-index: 1;
  padding: 0;
  border-bottom: 2px solid var(--gold-line);
  background: var(--stone-850);
  text-align: left;
  font-weight: 400;
}

.it-sort,
.it-sort-plain {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  min-height: 2.6rem;
  padding: 0.3rem 0.5rem;
  border: 0;
  background: transparent;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--track-label);
  line-height: 1.25;
  text-transform: uppercase;
  text-align: inherit;
  color: var(--text-gold);
}

.it-sort {
  cursor: pointer;
}

.it-sort[hidden],
.it-sort-plain[hidden] {
  display: none;
}

.it-sort:hover,
.it-th[aria-sort] .it-sort {
  color: var(--text-gold-bright);
}

.it-sort:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: -3px;
}

.it-sort-mark {
  flex: none;
}

.it-c-ilvl,
.it-c-req {
  text-align: right;
}

.it-c-ilvl .it-sort,
.it-c-req .it-sort {
  justify-content: flex-end;
}

.it-row > td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.13);
  vertical-align: middle;
}

.it-row {
  cursor: pointer;
  scroll-margin-top: 6.5rem; /* below the sticky site bar and the sticky column heads */
}

.it-row:hover > td {
  background: var(--tint-row);
}

.it-row-open > td {
  background: var(--tint-gold);
  border-bottom-color: transparent;
}

.it-row > .it-c-name {
  min-width: 14rem;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--quality-color) 75%, transparent);
}

/* a third-party row: an orange edge, so it never passes for game data */
.it-row-third > .it-c-name {
  box-shadow: inset 3px 0 0 var(--ember);
}

.it-row-linked > td {
  border-top: 1px dashed var(--gold-line);
}

.it-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.it-words {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.3;
}

/* The name opens the row (a button: keyboard and screen readers get it too). */
.it-name {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: var(--fs-text);
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  color: var(--quality-color);
  overflow-wrap: anywhere;
  cursor: pointer;
}

.it-name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.it-name:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
  border-radius: 3px;
}

.it-kind {
  font-size: var(--fs-small);
  color: var(--text-faint);
}

.it-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-top: 0.15rem;
}

/* The trust mark: seen in the game (green, a tick), expected in the game (a calm blue pill),
   not seen in the game yet (a calm grey pill),
   third party (orange), no data; for a lookup without `play`: tooltip read in game (green, a tick),
   game data. */
.it-trust {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-faint);
}

.it-trust-checked,
.it-trust-seen {
  color: var(--text-ok);
}

.it-trust-unseen {
  padding: 0.05rem 0.5rem;
  border: 1px solid rgba(211, 198, 168, 0.32);
  border-radius: 8px;
  white-space: nowrap;
  background: rgba(211, 198, 168, 0.07);
  color: var(--text-muted);
}

.it-trust-expected {
  padding: 0.05rem 0.5rem;
  border: 1px solid rgba(147, 202, 255, 0.42);
  border-radius: 8px;
  white-space: nowrap;
  background: rgba(147, 202, 255, 0.09);
  color: var(--text-azure);
}

.it-trust-game {
  color: var(--text-muted);
}

.it-trust-third {
  padding: 0.05rem 0.5rem;
  border: 1px solid rgba(255, 138, 43, 0.6);
  border-radius: 8px;
  white-space: nowrap;
  background: rgba(255, 138, 43, 0.12);
  color: var(--text-ember);
}

.it-trust-none {
  font-style: italic;
  color: var(--text-faint);
}

.it-trust-big {
  font-size: var(--fs-small);
}

.it-tick {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.it-linked {
  font-size: var(--fs-label);
  font-style: italic;
  color: var(--text-muted);
}

.it-quality {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--quality-color);
}

.it-num {
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.it-day {
  white-space: nowrap;
}

.it-stats {
  font-size: var(--fs-small);
  line-height: 1.4;
  color: var(--text-tip-green);
}

.it-stat-chosen {
  font-weight: 800;
  color: var(--text-gold-bright);
}

.it-sep,
.it-more-stats,
.it-none {
  color: var(--text-faint);
}

.it-c-stat {
  min-width: 9rem;
}

.it-c-open {
  width: 2.6rem;
  text-align: center;
}

.it-open {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: 50%;
  color: var(--text-gold);
}

.it-chevron,
.it-close-icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: rotate var(--t-fast);
}

.it-row-open .it-chevron {
  rotate: 180deg;
}

.it-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.it-more {
  display: flex;
  margin: 1rem auto 0;
}

/* --- an opened row ------------------------------------------------------------------- */

.it-detail-row > td {
  padding: 0 0 0.9rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.13);
  background: var(--tint-gold);
  cursor: default;
}

.it-detail {
  margin: 0 0.4rem;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid rgba(212, 175, 55, 0.38);
  border-radius: var(--radius-sm);
  background: #16111c;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.it-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.95rem;
  margin-bottom: 1rem;
}

.it-detail-words {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.it-detail-name {
  font-size: var(--fs-name);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.it-detail-link {
  font-weight: 700;
  color: var(--quality-color);
}

.it-detail-facts {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.it-close {
  display: inline-grid;
  place-items: center;
  align-self: start;
  width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 50%;
  background: rgba(10, 8, 14, 0.75);
  color: var(--text-gold-bright);
  cursor: pointer;
}

.it-close:hover {
  border-color: var(--gold);
  color: var(--text-strong);
}

.it-close:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

.it-detail-grid {
  display: grid;
  grid-template-columns: minmax(14rem, 21rem) minmax(0, 1fr);
  gap: 1rem 1.5rem;
  align-items: start;
}

.it-detail-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.it-detail-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

/* The game-style tooltip, drawn in place (the same lines as the hover box). */
.it-tip {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  width: 100%;
  padding: 0.6rem 0.8rem 0.65rem;
  border: 1.5px solid #7d6a45;
  border-radius: var(--radius-sm);
  background: #07060e;
  box-shadow: 0 0 0 1px var(--ink-line), 0 8px 18px rgba(0, 0, 0, 0.5);
  font-size: var(--fs-small);
  line-height: 1.35;
}

.it-wowhead {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--text-azure);
}

.it-wowhead:hover {
  color: var(--text-strong);
}

.it-detail-trust {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.it-trust-text {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.it-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.it-block-title {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-gold);
}

.it-block-empty {
  font-size: var(--fs-small);
  font-style: italic;
  color: var(--text-muted);
}

.it-block-note {
  font-size: var(--fs-small);
  color: var(--text-faint);
}

.it-sources {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.it-source {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(212, 175, 55, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.it-source-glyph {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.12);
  color: var(--text-gold);
}

.it-source-glyph .bis-src-svg {
  width: 1.1rem;
  height: 1.1rem;
}

.it-source-words {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.it-source-name {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

.it-source-facts {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.it-source-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.it-src-tag {
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: var(--fs-label);
  font-weight: 700;
}

.it-src-game {
  border: 1px solid rgba(130, 226, 173, 0.5);
  background: rgba(130, 226, 173, 0.1);
  color: var(--text-ok);
}

.it-src-classic {
  border: 1px solid rgba(255, 138, 43, 0.6);
  background: rgba(255, 138, 43, 0.12);
  color: var(--text-ember);
}

.it-src-moved {
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--text-muted);
}

.it-set-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.it-set-name {
  font-family: var(--font-display);
  font-size: var(--fs-text);
  font-weight: 700;
  color: var(--text-tip-yellow);
}

.it-bonuses {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.it-bonus {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.3rem;
  font-size: var(--fs-small);
  line-height: 1.35;
}

.it-bonus-n {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}

.it-bonus-text {
  color: var(--text-tip-green);
}

/* --- the Sets view --------------------------------------------------------------------- */

.it-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

/* a pressed tier chip glows in its tier's colour */
.it-tier-chip[aria-pressed="true"]:not([data-tier=""]) {
  border-color: var(--tier);
  background: color-mix(in srgb, var(--tier) 18%, #0f0b14);
  box-shadow: 0 0 10px color-mix(in srgb, var(--tier) 45%, transparent), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.it-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 0.9rem;
  align-items: start;
}

/* A tier's heading spans the grid. */
.it-tier-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  grid-column: 1 / -1;
  margin-top: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--gold-line);
}

.it-tier-head:first-child {
  margin-top: 0;
}

.it-tier-name {
  font-family: var(--font-display);
  font-size: var(--fs-lead);
  font-weight: 700;
  color: var(--text-gold-bright);
}

.it-tier-count {
  font-size: var(--fs-small);
  color: var(--text-faint);
}

/* A tier badge: the tier's own colour (Molten Core's ember, Naxxramas' frost ...). */
.it-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 2.6rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--tier);
  border-radius: 6px;
  background: color-mix(in srgb, var(--tier) 16%, #0c0910);
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-gold);
}

.it-badge-d1,
.it-card-d1,
.it-tier-d1 {
  --tier: #5aa6ff;
}

.it-badge-d2,
.it-card-d2,
.it-tier-d2 {
  --tier: #a48cff;
}

.it-badge-t1,
.it-card-t1,
.it-tier-t1 {
  --tier: #ff8a2b;
}

.it-badge-t2,
.it-card-t2,
.it-tier-t2 {
  --tier: #e2463c;
}

.it-badge-zg,
.it-card-zg,
.it-tier-zg {
  --tier: #3fbf7f;
}

.it-badge-aq,
.it-card-aq,
.it-tier-aq {
  --tier: #e0b44a;
}

.it-badge-t3,
.it-card-t3,
.it-tier-t3 {
  --tier: #4fd6ff;
}

.it-badge-pvp,
.it-card-pvp,
.it-tier-pvp {
  --tier: #d65a8c;
}

.it-badge-other,
.it-card-other,
.it-tier-other {
  --tier: #9a8d77;
}

.it-badge-d1 { color: var(--text-azure); }
.it-badge-d2 { color: var(--text-arcane); }
.it-badge-t1 { color: var(--text-ember); }
.it-badge-t2 { color: var(--text-bad); }
.it-badge-zg { color: var(--text-ok); }
.it-badge-aq { color: var(--text-warn); }
.it-badge-t3 { color: var(--text-tip-cyan); }
.it-badge-pvp { color: var(--text-shame); }
.it-badge-other { color: var(--text-muted); }

.it-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-top: 3px solid var(--tier);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--tier) 14%, transparent), transparent 60%),
    #120e17;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.it-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.it-card-name {
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-text);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-gold-bright);
  overflow-wrap: anywhere;
}

.it-card-who {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.it-card-class {
  font-weight: 700;
  color: var(--class-text);
}

.it-card-id {
  font-size: var(--fs-label);
  color: var(--text-faint);
}

.it-meter {
  display: flex;
  height: 0.45rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

/* seen pieces green, then expected ones blue */
.it-meter-fill {
  display: block;
  flex: none;
  width: calc(var(--share, 0) * 100%);
  height: 100%;
  background: linear-gradient(90deg, #2f9c69, var(--jade));
}

.it-meter-expected {
  background: linear-gradient(90deg, #3a7fc4, #7dbcff);
}

.it-card-count {
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  color: var(--text-ok);
}

.it-pieces {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.it-piece-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.it-piece-link:hover {
  background: var(--tint-row);
}

.it-piece-link:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 1px;
}

.it-piece-words {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.25;
}

.it-piece-name {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--quality-color);
  overflow-wrap: anywhere;
}

.it-piece-slot {
  font-size: var(--fs-label);
  color: var(--text-faint);
}

.it-trust-small {
  margin-top: 0.1rem;
}

.it-card-hidden {
  font-size: var(--fs-small);
  font-style: italic;
  color: var(--text-faint);
}

.it-card .it-bonuses {
  padding-top: 0.5rem;
  border-top: 1px solid rgba(212, 175, 55, 0.14);
}

.it-set-empty {
  margin-top: 0.4rem;
}

/* --- narrower screens -------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .it-c-changed {
    display: none;
  }
}

/* Up to 1100 px the filters become a drawer above the list (its Filters button). */
@media (max-width: 1100px) {
  .it-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .it-side {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .it-drawer-head {
    padding: 0.4rem;
  }

  .it-drawer-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .it-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--panel-line-strong);
    border-radius: var(--radius-sm);
    background: rgba(10, 8, 14, 0.55);
    font-family: var(--font-display);
    font-size: var(--fs-small);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-gold);
    cursor: pointer;
  }

  .it-filter-toggle:hover {
    border-color: var(--gold);
    color: var(--text-gold-bright);
  }

  .it-filter-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--gold);
    font-family: var(--font-body);
    letter-spacing: 0;
    color: var(--text-on-gold);
  }

  .it-filter-count[hidden] {
    display: none;
  }

  .it-filter-toggle .it-chevron {
    margin-left: auto;
  }

  .it-filter-toggle[aria-expanded="true"] .it-chevron {
    rotate: 180deg;
  }

  .it-side:not(.it-side-open) .it-drawer-body {
    display: none;
  }

  /* two columns of filters while there is room */
  .it-side-open .it-drawer-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    align-items: start;
    padding-top: 0.75rem;
  }

  .it-side-open .it-drawer-body > .it-fs:has(.it-qualities) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .it-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Phones: every row is a card, the column heads become sort buttons; the
   class buttons go into a grid, icon over name. */
@media (max-width: 720px) {
  .it-top {
    flex-direction: column;
    align-items: stretch;
  }

  .it-views {
    align-self: flex-start;
  }

  /* the Show group: the label on its own line, then one full-width switch per row */
  .it-show {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }

  .it-show .it-switch {
    width: 100%;
  }

  .it-classes {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .it-class {
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.35rem 0.1rem 0.3rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--fs-label);
    letter-spacing: 0;
  }

  .it-trust-third,
  .it-trust-unseen,
  .it-trust-expected {
    white-space: normal;
  }

  .it-class-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .it-table,
  .it-table > tbody {
    display: block;
  }

  .it-table > thead {
    display: block;
    margin-bottom: 0.5rem;
  }

  .it-table > thead > tr {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .it-th {
    position: static;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    background: rgba(10, 8, 14, 0.75);
  }

  .it-th.it-c-open,
  .it-th.it-c-stat:not([aria-sort]) .it-sort-plain {
    display: none;
  }

  .it-th.it-c-stat:has(.it-sort-plain:not([hidden])) {
    display: none;
  }

  .it-th.it-c-changed {
    display: block;
  }

  .it-sort {
    min-height: 2.2rem;
    padding: 0.2rem 0.75rem;
  }

  .it-th[aria-sort] {
    border-color: var(--gold);
    background: var(--tint-gold);
  }

  /* a card: the name, then "Quality Rare · Item lvl 65 · …" wrapping as it must, then the stats */
  .it-row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 1.1rem;
    padding: 0.7rem 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--quality-color) 75%, transparent);
  }

  .it-row-third {
    box-shadow: inset 3px 0 0 var(--ember);
  }

  .it-row:hover > td,
  .it-row-open > td {
    background: none;
  }

  .it-row-open {
    background: var(--tint-gold);
  }

  .it-row > td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .it-row > .it-c-name {
    flex: 1 1 100%;
    min-width: 0;
    padding-right: 2.6rem;
    box-shadow: none;
  }

  .it-row > .it-c-stat {
    order: 2;
    flex: 1 1 100%;
    min-width: 0;
  }

  .it-row > .it-c-stat:has(.it-none) {
    display: none;
  }

  .it-row > .it-c-changed {
    display: block;
  }

  .it-row > .it-c-open {
    position: absolute;
    top: 0.65rem;
    right: 0.45rem;
    width: auto;
  }

  .it-row {
    scroll-margin-top: 4.5rem;
  }

  .it-row > td[data-label]::before {
    content: attr(data-label);
    margin-right: 0.4rem;
    white-space: nowrap;
    font-family: var(--font-display);
    font-size: var(--fs-label);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-faint);
  }

  .it-detail-row {
    display: block;
  }

  .it-detail-row > td {
    display: block;
    padding: 0 0 0.8rem;
  }

  .it-detail {
    margin: 0;
    padding: 0.85rem 0.8rem 0.95rem;
  }

  .it-detail-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .it-switch-knob,
  .it-class,
  .it-chevron {
    transition: none;
  }
}
