/* The Market and Auction House pages (js/views/market.js, js/views/auction.js)
   and what they share: the page heading, the "not open yet" notice, money
   with coin dots, change badges, sparklines and item icon tiles.

   Layers stay inside .page (z-index 3), below the site bar (30): the sticky
   filter column and table header only stick within the page. */

/* --- the page heading and the market notice ------------------------------- */

/* The pages' heading (js/views/pagehead.js), in the sections' look: a round
   glyph medallion, the title and a note under it, a gold hairline below. */
.page-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.1rem 0.15rem 0.95rem;
  border-bottom: 1px solid var(--panel-rule);
}

.page-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: min(45%, 20rem);
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(247, 231, 172, 0.75), transparent);
}

.page-glyph {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.3rem;
  height: 3.3rem;
  border-radius: 50%;
  border: 1px solid var(--panel-line-strong);
  background: radial-gradient(circle at 35% 28%, rgba(212, 175, 55, 0.28), rgba(10, 8, 14, 0.92) 70%);
  box-shadow: inset 0 1px 0 rgba(255, 235, 180, 0.18), 0 0 24px rgba(212, 175, 55, 0.18);
}

.page-glyph svg {
  width: 1.95rem;
  height: 1.95rem;
  fill: none;
  stroke: var(--gold-bright);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.page-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: clamp(1.625rem, 1.25rem + 1.1vw, 2.3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.1;
  background: linear-gradient(180deg, var(--gold-text-top) 0%, var(--gold-text-mid) 50%, var(--gold-text-low) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 var(--ink-line)) drop-shadow(0 0 16px rgba(212, 175, 55, 0.28));
}

.page-note {
  min-width: 0;
  font-size: var(--fs-text);
  font-style: italic;
  color: var(--text-muted);
}

.market-notice-slot:empty {
  display: none;
}

.market-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.9rem 1.15rem;
  border: 2px solid rgba(154, 123, 255, 0.55);
  border-radius: var(--radius);
  background:
    radial-gradient(110% 120% at 0% 0%, rgba(154, 123, 255, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(36, 29, 46, 0.94), rgba(14, 11, 19, 0.97));
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.5), 0 10px 26px rgba(0, 0, 0, 0.45);
}

.market-notice-warn {
  border-color: rgba(232, 178, 76, 0.6);
}

.market-notice-bad {
  border-color: rgba(226, 86, 79, 0.7);
}

/* Demo prices (market.json "demo": true): frost blue, so it never reads as real data. */
.market-notice-demo {
  border-color: rgba(85, 168, 255, 0.6);
  background:
    radial-gradient(110% 120% at 0% 0%, rgba(85, 168, 255, 0.14), transparent 60%),
    linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
}

.market-notice-demo .market-notice-icon {
  stroke: var(--azure);
  filter: drop-shadow(0 0 8px rgba(85, 168, 255, 0.4));
}

.market-notice-demo .market-notice-title {
  color: var(--text-azure);
}

.market-notice-icon {
  flex: none;
  width: 2.3rem;
  height: 2.3rem;
  fill: none;
  stroke: var(--gold-bright);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.4));
}

.market-notice-words {
  min-width: 0;
}

.market-notice-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-bright);
}

.market-notice-body {
  margin-top: 0.2rem;
  font-size: var(--fs-text);
  color: var(--text);
}

/* --- money: numbers with coin dots (original CSS, no game art) -------------- */

.money {
  display: inline-flex;
  align-items: baseline;
  gap: 0.32em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.money-part {
  display: inline-flex;
  align-items: baseline;
}

.money-num {
  font-weight: 700;
  color: var(--text-strong);
}

.money-high .money-num {
  font-weight: 400;
  color: var(--text-muted);
}

.money-none {
  color: var(--text-faint);
}

.coin {
  display: inline-block;
  flex: none;
  width: 0.62em;
  height: 0.62em;
  margin-left: 0.14em;
  border-radius: 50%;
  translate: 0 -0.04em;
  box-shadow:
    0 0 0 1px var(--ink-line),
    inset 0 -1.5px 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.coin-gold {
  background: radial-gradient(circle at 35% 30%, #fff3c2 0%, #f0c75a 45%, #a8741a 100%);
}

.coin-silver {
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #c9ced8 45%, #747b88 100%);
}

.coin-copper {
  background: radial-gradient(circle at 35% 30%, #ffd9b8 0%, #d07d45 45%, #763a15 100%);
}

/* A change since a day before: a small pill, green up, red down. */
.change {
  display: inline-block;
  padding: 0 0.42rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}

.change-up {
  color: var(--text-ok);
}

.change-down {
  color: var(--text-bad);
}

/* --- sparklines (js/sparkline.js) ------------------------------------------ */

.spark {
  display: block;
  flex: none;
  width: 5.5rem;
  height: 1.65rem;
  overflow: visible;
}

.spark-line,
.spark-base {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.spark-base {
  stroke: var(--gold-dim);
  stroke-dasharray: 3 4;
}

.spark-end,
.spark-dot {
  fill: var(--gold-bright);
  stroke: var(--ink-line);
  stroke-width: 0.8;
}

/* "—" until two days of prices (js/sparkline.js trendOrDash). */
.spark-none {
  display: block;
  flex: none;
  width: 5.5rem;
  font-size: var(--fs-small);
  text-align: center;
  color: var(--text-faint);
  cursor: help;
}

.spark-up .spark-line {
  stroke: var(--ok);
}

.spark-up .spark-end {
  fill: var(--ok);
}

.spark-down .spark-line {
  stroke: var(--bad);
}

.spark-down .spark-end {
  fill: var(--bad);
}

/* --- item icon tiles: the game's icon in a quality-coloured rim ------------- */

.item-tile {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--quality-color) 70%, #000);
  border-radius: 7px;
  background: radial-gradient(circle at 40% 30%, #3a3046, #110d16);
  box-shadow: 0 0 0 1px var(--ink-line), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.item-tile-s {
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 6px;
}

.item-tile-l {
  width: 3.7rem;
  height: 3.7rem;
  border-width: 2.5px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px var(--ink-line), 0 0 16px color-mix(in srgb, var(--quality-color) 35%, transparent);
}

.item-tile-img {
  display: block;
  width: 100%;
  height: 100%;
}

.item-tile-none {
  width: 55%;
  height: 55%;
  rotate: 45deg;
  border-radius: 3px;
  background: color-mix(in srgb, var(--quality-color) 45%, #120c18);
  box-shadow: 0 0 0 1.5px var(--ink-line);
}

/* --- shared buttons ----------------------------------------------------------- */

.ah-reset,
.ah-more,
.mk-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.35rem 1.15rem;
  border: 2px solid rgba(212, 175, 55, 0.5);
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.08), rgba(10, 8, 14, 0.9));
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-gold-bright);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.ah-reset:hover,
.ah-more:hover,
.mk-more:hover {
  border-color: var(--gold);
  color: var(--text-strong);
}

/* --- Auction House: the layout -------------------------------------------------- */

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

/* The filter column stays in view while the list scrolls (below the site bar). */
.ah-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;
}

/* The column's heading: categories and filters are always shown (owner,
   2026-10-31: no folding the whole column away). */
.ah-drawer-head {
  padding: 0.85rem 1.1rem 0.55rem;
}

/* Narrow screens only (below): the button that opens the filters. */
.ah-filter-toggle {
  display: none;
}

.ah-drawer-title {
  margin: 0;
  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);
}

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

/* --- the category tree ------------------------------------------------------- */

.ah-tree,
.ah-tree-sub {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.ah-tree-sub {
  margin: 0.05rem 0 0.2rem;
}

.ah-cat {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  width: 100%;
  min-height: 2.05rem;
  padding: 0.25rem 0.6rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.3;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.ah-depth-1,
.ah-depth-2 {
  font-family: var(--font-body);
  font-size: var(--fs-text);
  font-weight: 600;
  letter-spacing: 0;
}

.ah-depth-1 {
  padding-left: 1.5rem;
}

.ah-depth-2 {
  padding-left: 2.5rem;
  font-weight: 400;
}

.ah-cat:hover {
  background: var(--tint-row);
  color: var(--text-gold-bright);
}

.ah-cat[aria-current="true"] {
  background: linear-gradient(90deg, var(--tint-gold), transparent);
  box-shadow: inset 3px 0 0 var(--gold);
  color: var(--text-gold-bright);
}

.ah-cat-fold {
  flex: none;
  width: 0.85rem;
  text-align: center;
  color: var(--text-gold);
}

.ah-cat-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* --- the filters --------------------------------------------------------------- */

.ah-filters {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: 0.95rem 0.35rem 0;
  border-top: 1px solid var(--gold-line);
}

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

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

.ah-level-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.ah-level {
  width: 5.2rem;
}

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

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

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

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

.ah-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.2rem;
  font-size: var(--fs-text);
  color: var(--text);
  cursor: pointer;
}

.ah-check-box {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--gold);
}

.ah-check-box:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

.ah-reset {
  align-self: flex-start;
}

/* --- the results ---------------------------------------------------------------- */

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

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

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

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

.ah-crumbs {
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-gold);
}

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

/* The header stays under the site bar while the rows scroll by. */
.ah-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;
}

.ah-sort {
  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);
  cursor: pointer;
}

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

.ah-sort-mark {
  flex: none;
  font-size: var(--fs-label);
}

.ah-c-req,
.ah-c-min,
.ah-c-avg7,
.ah-c-qty,
.ah-c-n {
  text-align: right;
}

.ah-c-req .ah-sort,
.ah-c-min .ah-sort,
.ah-c-avg7 .ah-sort,
.ah-c-qty .ah-sort,
.ah-c-n .ah-sort {
  justify-content: flex-end;
}

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

.ah-row {
  cursor: pointer;
}

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

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

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

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

.ah-words {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

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

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

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

.ah-c-min,
.ah-c-avg7 {
  font-size: var(--fs-small);
  white-space: nowrap;
}

.ah-range {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0 0.1rem;
}

/* The dash is a flex item: its spaces would collapse, so it gets a margin. */
.ah-range-dash {
  margin: 0 0.3em;
  color: var(--text-faint);
}

.ah-c-trend {
  width: 6.3rem;
}

.ah-c-open {
  width: 2.9rem;
  text-align: center;
}

.ah-open,
.ah-close {
  display: inline-grid;
  place-items: center;
  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;
}

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

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

.ah-open[aria-expanded="true"] .ah-chevron {
  rotate: 180deg;
}

.ah-empty {
  margin-top: 0.4rem;
}

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

/* --- the details under an open row ---------------------------------------------- */

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

.ah-detail {
  margin: 0 0.4rem;
  padding: 1rem 1.1rem 1.1rem;
  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);
}

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

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

.ah-detail-name {
  font-size: var(--fs-lead);
  letter-spacing: 0.03em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ah-detail-link {
  color: var(--quality-color);
}

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

.ah-close {
  align-self: start;
}

.ah-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.1rem 1.4rem;
  margin-top: 1rem;
}

.ah-block {
  min-width: 0;
}

.ah-block-title {
  margin-bottom: 0.5rem;
  font-size: var(--fs-small);
  font-weight: 800;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-gold);
}

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

.ah-chart {
  position: relative;
  height: 15rem;
}

/* The chart's title and, hour by hour, its range buttons (24 hours, 7 days,
   30 days; js/views/auction.js chartPanel): the segmented strip of
   components.css, smaller, wrapping under the title on a narrow screen. */
.ah-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.8rem;
  margin-bottom: 0.5rem;
}

.ah-chart-head .ah-block-title {
  margin-bottom: 0;
}

.ah-span {
  padding: 0.2rem;
}

.ah-span-tab {
  min-height: 2rem;
  padding: 0.2rem 0.75rem;
  letter-spacing: 0.05em;
}

.ah-span-tab[aria-pressed="true"] {
  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);
}

/* While the item's hourly file loads: the chart's place, kept, with a quiet note. */
.ah-chart-wait {
  display: grid;
  place-items: center;
}

.ah-facts {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.ah-fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.32rem 0;
  border-bottom: 1px dotted rgba(212, 175, 55, 0.22);
}

.ah-fact-label {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.ah-fact-value {
  margin: 0;
  font-size: var(--fs-small);
  text-align: right;
}

.ah-fact-text {
  font-weight: 700;
  color: var(--text);
}

/* Auction house or vendor? (js/selling.js): the verdict beside a small table
   of what one item and a full stack bring each way after the listing fee. */
.ah-sell {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
}

.ah-sell-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: start;
  gap: 0.9rem 1.6rem;
}

.ah-sell-words {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.ah-verdict {
  font-family: var(--font-display);
  font-size: var(--fs-text);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.ah-verdict::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.5em;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  translate: 0 -0.08em;
}

.ah-verdict-ah {
  color: var(--text-ok);
}

.ah-verdict-vendor {
  color: var(--text-warn);
}

.ah-verdict-none {
  color: var(--text-muted);
}

.ah-sell-why {
  font-size: var(--fs-small);
  color: var(--text);
}

.ah-sell-basis {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.ah-sell-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}

.ah-sell-table th,
.ah-sell-table td {
  padding: 0.32rem 0 0.32rem 0.9rem;
  border-bottom: 1px dotted rgba(212, 175, 55, 0.22);
  text-align: right;
  vertical-align: baseline;
}

.ah-sell-table tr > :first-child {
  padding-left: 0;
  text-align: left;
}

.ah-sell-col {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-faint);
}

.ah-sell-label {
  font-weight: 400;
  color: var(--text-muted);
}

.ah-net {
  display: inline-flex;
  align-items: baseline;
}

.ah-net-loss .money-num,
.ah-net-sign {
  font-weight: 700;
  color: var(--text-bad);
}

.ah-better {
  font-weight: 700;
  white-space: nowrap;
  color: var(--text-muted);
}

.ah-better-ah,
.ah-better-ah .money-num {
  color: var(--text-ok);
}

.ah-better-vendor,
.ah-better-vendor .money-num {
  color: var(--text-warn);
}

.ah-better-none {
  font-weight: 400;
  color: var(--text-faint);
}

.ah-better-amount {
  white-space: nowrap;
}

.ah-sell-each {
  color: var(--text-faint);
}

/* In the list: the vendor pays more than a full stack fetches (js/views/auction.js vendorPaysMore). */
.ah-vendor-tag {
  display: inline-block;
  margin-left: 0.2rem;
  padding: 0 0.42rem;
  border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
  color: var(--text-warn);
}

.ah-craft {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
}

.ah-craft-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.ah-recipe {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ah-recipe-title {
  font-size: var(--fs-small);
}

.ah-recipe-prof {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

.ah-recipe-src,
.ah-uses {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.ah-recipe-items,
.ah-crafters,
.ah-recipe-total {
  font-size: var(--fs-small);
  color: var(--text);
}

.ah-recipe-label {
  font-weight: 800;
  color: var(--text-gold);
}

.ah-recipe-item,
.ah-reagent-name {
  font-weight: 700;
  color: var(--quality-color);
}

.ah-reagents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0.25rem 1.2rem;
}

.ah-reagent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.45rem;
  font-size: var(--fs-small);
}

.ah-reagent-count {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ah-reagent-name {
  overflow-wrap: anywhere;
}

.ah-crafter {
  font-weight: 700;
  color: var(--class-text);
}

.ah-crafter:hover {
  text-decoration: underline;
}

.ah-crafter-sub {
  color: var(--text-muted);
}

/* --- Auction House on narrower screens -------------------------------------------- */

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

/* Up to 1100 px the filter column would squeeze the table past the page's
   edge: the filters become the drawer above the list (its Filters button). */
@media (max-width: 1100px) {
  .ah-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The filters become a drawer above the list, closed until asked for. */
  .ah-side {
    position: static;
    max-height: none;
    overflow: visible;
  }

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

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

  .ah-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;
  }

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

  .ah-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);
  }

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

  .ah-filter-toggle .ah-chevron {
    width: 1.2rem;
    height: 1.2rem;
    margin-left: auto;
    transition: rotate var(--t-fast);
  }

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

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

  .ah-side-open .ah-drawer-body {
    padding-top: 0.75rem;
  }
}

/* Phones: every row is a small card, the column heads become sort buttons. */
@media (max-width: 720px) {
  .ah-table,
  .ah-table > tbody {
    display: block;
  }

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

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

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

  .ah-th.ah-c-open,
  .ah-th.ah-c-trend {
    display: none;
  }

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

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

  .ah-row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem 0.7rem;
    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);
  }

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

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

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

  .ah-row > .ah-c-name {
    grid-row: 1;
    grid-column: 1 / -1;
    min-width: 0;
    padding-right: 2.7rem;
    box-shadow: none;
  }

  /* Price and the 7-day average side by side, then level, units, auctions and the trend. */
  .ah-row > .ah-c-min {
    grid-row: 2;
    grid-column: 1 / 3;
  }

  .ah-row > .ah-c-avg7 {
    grid-row: 2;
    grid-column: 3 / 5;
  }

  .ah-row > .ah-c-req {
    grid-row: 3;
    grid-column: 1;
  }

  .ah-row > .ah-c-qty {
    grid-row: 3;
    grid-column: 2;
  }

  .ah-row > .ah-c-n {
    display: block;
    grid-row: 3;
    grid-column: 3;
  }

  /* The trend needs no heading here (its line has an accessible name). */
  .ah-row > .ah-c-trend {
    grid-row: 3;
    grid-column: 4;
    align-self: end;
    width: auto;
  }

  .ah-row > .ah-c-trend[data-label]::before {
    content: none;
  }

  /* Not on sale: only the level (the dashes say nothing on a card). */
  .ah-row-unpriced > .ah-c-min,
  .ah-row-unpriced > .ah-c-avg7,
  .ah-row-unpriced > .ah-c-qty,
  .ah-row-unpriced > .ah-c-n,
  .ah-row-unpriced > .ah-c-trend {
    display: none;
  }

  .ah-row-unpriced > .ah-c-req {
    grid-row: 2;
  }

  .ah-c-trend .spark {
    width: 100%;
    max-width: 5.5rem;
    margin-top: 0.15rem;
  }

  .ah-row > .ah-c-open {
    position: absolute;
    top: 0.6rem;
    right: 0.4rem;
    width: auto;
  }

  .ah-row > td[data-label]::before {
    content: attr(data-label);
    display: block;
    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);
  }

  .ah-range {
    justify-content: flex-start;
  }

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

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

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

  .ah-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-sell-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .ah-better {
    white-space: normal;
  }

  .ah-chart {
    height: 12.5rem;
  }
}

/* --- Market: the pulse ---------------------------------------------------------------- */

.mk-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.mk-stats {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
}

.mk-stat .stat-value {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.mk-stat .stat-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.mk-mover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1rem 1.4rem;
}

.mk-movers {
  min-width: 0;
}

.mk-mover-list,
.mk-mat-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.mk-mover,
.mk-mat {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--tint-row);
}

.mk-words {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

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

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

.mk-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-size: var(--fs-small);
}

.mk-change {
  align-self: flex-end;
}

.mk-empty,
.mk-foot {
  font-size: var(--fs-small);
  font-style: italic;
  color: var(--text-muted);
}

/* --- Market: the layout --------------------------------------------------------------- */

/* The pulse and the treasure on top (the treasure as tall as the pulse), the materials below. */
.mk-top {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: stretch;
}

.mk-treasure {
  display: flex;
  flex-direction: column;
}

.mk-treasure > .mk-body {
  flex: 1;
  justify-content: center;
}

@media (max-width: 1080px) {
  .mk-top {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Market: material prices, a card per profession ---------------------------------- */

.mk-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1240px) {
  .mk-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .mk-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mk-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.85rem 0.85rem 0.95rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--tint-row), rgba(0, 0, 0, 0.25));
  box-shadow: inset 0 1px 0 rgba(255, 235, 180, 0.06);
}

.mk-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mk-badge {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
}

.mk-card-words {
  min-width: 0;
}

.mk-card-title {
  font-size: var(--fs-name);
  color: var(--text-gold-bright);
}

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

.mk-crafter {
  font-weight: 700;
  color: var(--class-text);
}

.mk-crafter:hover {
  text-decoration: underline;
}

.mk-rank {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.mk-more {
  align-self: flex-start;
}

/* --- Market: treasure on sale (the Treasure Vault's look) ------------------------------ */

.mk-jackpot-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mk-jackpot-price {
  margin-top: 0.45rem;
  font-size: var(--fs-lead);
}

.mk-range {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.mk-find-price {
  font-size: var(--fs-small);
}

.mk-browse {
  font-weight: 700;
}

/* Phones: the line stays in its row, just shorter. */
@media (max-width: 720px) {
  .mk-mover,
  .mk-mat {
    gap: 0.5rem;
  }

  .mk-mover > .spark,
  .mk-mat > .spark,
  .mk-mover > .spark-none,
  .mk-mat > .spark-none {
    width: 3.2rem;
  }
}

/* --- Market v2: the tabs (js/views/market.js; the Crafting page's bookmark tabs) ------ */

.mk-tabs {
  padding: 0;
}

.mk-tab svg {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mk-tab-short {
  display: none;
}

.mk-page {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
  padding-top: var(--gap);
}

/* Phones: the seven tabs as a grid of buttons (4 + 3), their short names. */
@media (max-width: 640px) {
  .mk-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    border-bottom: 0;
  }

  .mk-tab {
    justify-content: center;
    min-width: 0;
    margin-bottom: 0;
    padding: 0.35rem 0.4rem;
    border-radius: var(--radius-sm);
    border-bottom-color: rgba(212, 175, 55, 0.3);
    letter-spacing: 0.04em;
  }

  .mk-tab[aria-selected="true"] {
    border-bottom-color: var(--gold-mid);
  }

  .mk-tab svg {
    width: 1.1rem;
    height: 1.1rem;
  }

  .mk-tab-long {
    display: none;
  }

  .mk-tab-short {
    display: inline;
  }

  .mk-page {
    padding-top: var(--sp-4);
  }
}

/* Two panels side by side (deals and flips, hot sellers and "post it"), stacked below 1080 px. */
.mk-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.mk-mid {
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
}

@media (max-width: 1080px) {
  .mk-pair,
  .mk-mid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Market v2: item rows ------------------------------------------------------------- */

.mk-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* The Troll watch and the farm list: two columns of rows on wide screens. */
.mk-list-wide {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr));
  gap: 0.3rem 1rem;
}

.mk-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.4rem 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--tint-row);
}

.mk-mover {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
}

.mk-mover > .spark,
.mk-mover > .spark-none {
  width: 4rem;
}

.mk-value {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.mk-price-line {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.35rem;
}

.mk-price-note {
  font-size: var(--fs-small);
  color: var(--text-faint);
  text-align: right;
}

.mk-profit {
  font-weight: 700;
  color: var(--text-ok);
}

.mk-profit .money-num {
  color: var(--text-ok);
}

.mk-plus {
  white-space: nowrap;
}

.mk-gold .money-num {
  color: var(--text-gold-bright);
}

/* A discount: the change pill's shape, good news green. */
.mk-off {
  display: inline-block;
  padding: 0 0.42rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text-ok);
}

.mk-go {
  align-self: flex-start;
}

.mk-link-button {
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: inherit;
  font-style: normal;
  font-weight: 700;
  color: var(--text-gold);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.mk-link-button:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

/* Sort and quality choices above a list. */
.mk-seg {
  align-self: flex-start;
  padding: 0.2rem;
}

.mk-seg-tab {
  min-height: 2.2rem;
  padding: 0.2rem 0.8rem;
  letter-spacing: 0.05em;
}

.mk-seg-tab[aria-pressed="true"] {
  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);
}

/* --- Market v2: the watch star ----------------------------------------------------- */

.mk-star {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.mk-star:hover {
  border-color: var(--panel-line-strong);
  background: var(--gold-glass);
}

.mk-star:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 1px;
}

.mk-star-glyph {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: var(--gold-dim);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.mk-star:hover .mk-star-glyph {
  stroke: var(--gold);
}

.mk-star-on .mk-star-glyph {
  fill: var(--gold-bright);
  stroke: var(--gold-mid);
}

/* --- Market v2: the trust badge and its reasons --------------------------------------- */

.mk-trust {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-faint);
}

.mk-trust-high {
  color: var(--text-ok);
}

.mk-trust-medium {
  color: var(--text-gold);
}

.mk-trust-low {
  color: var(--text-bad);
}

/* Three bars like a signal: how many are lit says the level (the word says it too). */
.mk-trust-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 0.8rem;
}

.mk-trust-bar {
  width: 3px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.25;
}

.mk-trust-bar:nth-child(1) {
  height: 40%;
}

.mk-trust-bar:nth-child(2) {
  height: 70%;
}

.mk-trust-bar:nth-child(3) {
  height: 100%;
}

.mk-trust-bar-on {
  opacity: 1;
}

.mk-reasons {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mk-reason {
  display: grid;
  grid-template-columns: 0.9rem minmax(0, 1fr);
  gap: 0.35rem;
  font-size: var(--fs-small);
  line-height: 1.4;
}

.mk-reason-sign {
  font-weight: 800;
  text-align: center;
  color: var(--text-faint);
}

.mk-reason-good .mk-reason-sign {
  color: var(--text-ok);
}

.mk-reason-bad .mk-reason-sign {
  color: var(--text-bad);
}

.mk-reason-text {
  color: var(--text-muted);
}

.mk-sales-line {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* --- Market v2: the market index -------------------------------------------------------- */

.mk-index {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem 0.75rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--tint-row), rgba(0, 0, 0, 0.25));
}

.mk-index-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.9rem;
}

.mk-index-head .vault-title {
  margin-bottom: 0;
}

.mk-index-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
}

.mk-index-change {
  font-size: var(--fs-text);
  padding: 0.05rem 0.6rem;
}

.mk-index-words {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.mk-breadth {
  display: flex;
  gap: 2px;
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.mk-breadth-seg {
  flex: 1 1 0;
  min-width: 2px;
}

.mk-breadth-up {
  background: var(--ok);
}

.mk-breadth-flat {
  background: var(--gold-mid);
}

.mk-breadth-down {
  background: var(--bad);
}

.mk-breadth-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.mk-breadth-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.mk-breadth-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
}

/* --- Market v2: the troll's corner (a wanted notice, dark) ------------------------------- */

.mk-wanted {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem 0.9rem;
  border: 2px dashed rgba(214, 69, 63, 0.55);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(214, 69, 63, 0.16), transparent 65%),
    linear-gradient(180deg, rgba(30, 14, 18, 0.9), rgba(10, 8, 14, 0.9));
}

.mk-wanted-kicker {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-shame);
}

.mk-wanted-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mk-wanted-name {
  font-family: var(--font-display);
  font-size: var(--fs-name);
  font-weight: 800;
  line-height: 1.2;
  color: var(--quality-color);
  overflow-wrap: anywhere;
}

.mk-wanted-ask {
  font-size: var(--fs-lead);
  color: var(--text);
}

.mk-wanted-why {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--text-shame);
}

.mk-wanted-usual {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* --- Market v2: how we read the market --------------------------------------------------- */

.mk-how .mk-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1rem 1.6rem;
}

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

.mk-how-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.7rem 1.2rem;
}

.mk-how-text {
  font-size: var(--fs-note);
  line-height: 1.45;
  color: var(--text-muted);
}

.mk-how-title {
  color: var(--text-gold-bright);
}

.mk-legend {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mk-legend-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.6rem;
}

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

/* --- Market v2: sell-through meter --------------------------------------------------------- */

.mk-through {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.mk-meter {
  display: inline-block;
  width: 3.2rem;
  height: 0.45rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.25);
}

.mk-meter-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-mid), var(--gold-bright));
}

/* --- Market v2: the watchlist ----------------------------------------------------------- */

.mk-watch-add {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 28rem;
}

.mk-found:empty {
  display: none;
}

.mk-watch-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mk-watch-head {
  font-size: var(--fs-note);
  color: var(--text-muted);
}

.mk-watch-head-hit {
  font-weight: 700;
  color: var(--text-gold-bright);
}

.mk-watch-row {
  grid-template-columns: auto minmax(0, 1fr) auto minmax(9rem, 12rem) auto;
}

/* A hit: the cheapest listing is at or under the target. */
.mk-hit {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.2), var(--tint-row) 60%);
  box-shadow: inset 3px 0 0 var(--gold-bright), 0 0 16px rgba(212, 175, 55, 0.18);
}

.mk-target {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.mk-target-input {
  min-height: 2.3rem;
}

.mk-target-input[aria-invalid="true"] {
  border-color: var(--bad);
}

.mk-target-hint {
  font-size: var(--fs-label);
  color: var(--text-faint);
}

.mk-hit .mk-target-hint {
  font-weight: 700;
  color: var(--text-gold-bright);
}

/* --- Market v2: the troll watch -------------------------------------------------------- */

.mk-odd .mk-odd-why {
  grid-column: 2 / -1;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.mk-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.mk-chip {
  display: inline-block;
  padding: 0 0.45rem;
  border: 1px solid rgba(214, 69, 63, 0.55);
  border-radius: 999px;
  background: rgba(214, 69, 63, 0.12);
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--text-shame);
}

/* Phones: the rows keep icon, name and value in one line; the star stays; the
   watchlist's target box and the troll's reasons go under the name. */
@media (max-width: 720px) {
  .mk-row {
    gap: 0.45rem;
  }

  .mk-mover > .spark,
  .mk-mover > .spark-none {
    display: none;
  }

  .mk-mover {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  /* icon, name and star on top; the value block under the name */
  .mk-row,
  .mk-watch-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    row-gap: 0.15rem;
  }

  .mk-row > .mk-value {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-start;
  }

  .mk-row .mk-price {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.5rem;
  }

  .mk-row .mk-price-note {
    text-align: left;
  }

  .mk-watch-row .mk-target {
    grid-column: 2 / -1;
    grid-row: 3;
  }

  .mk-odd .mk-odd-why {
    grid-row: 3;
  }

  .mk-src {
    display: none;
  }

  .mk-star {
    width: 2.25rem;
    height: 2.25rem;
  }

  .mk-legend-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }
}

/* --- Auction House details: the watch star and "Can we trust it?" (Market v2) --------- */

.ah-detail-tools {
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: 0.3rem;
}

.ah-trust {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--panel-rule);
}

.ah-trust-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem 0.8rem;
}

.ah-trust-title {
  margin: 0;
  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);
}

.ah-trust-fair,
.ah-trust-sales {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* --- Market: the Darkmoon Faire tab (js/views/darkmoon.js) ------------------------------ */

.dmf-faire > .mk-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 1rem 1.4rem;
  align-items: center;
}

.dmf-when {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--tint-row), rgba(0, 0, 0, 0.25));
}

.dmf-open {
  border-color: rgba(130, 226, 173, 0.45);
}

.dmf-when-big {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: var(--fs-name);
  font-weight: 700;
  color: var(--text-gold-bright);
}

.dmf-when-sub {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.dmf-pill {
  display: inline-block;
  padding: 0.05rem 0.6rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-ok);
}

.dmf-pill-shut {
  color: var(--text-muted);
}

.dmf-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.6rem 1.2rem;
}

.dmf-fact {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: var(--fs-small);
  line-height: 1.4;
}

.dmf-fact-title {
  font-weight: 700;
  color: var(--text-gold-bright);
}

.dmf-fact-text {
  color: var(--text-muted);
}

/* the plan's choices */
.dmf-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.7rem 1rem;
}

.dmf-field {
  flex: 0 1 8.5rem;
}

.dmf-rep {
  flex: 0 1 15rem;
}

.dmf-rep .pf-select {
  flex: 1 1 8rem;
  width: auto;
}

.dmf-points {
  flex: 0 0 5.5rem;
  width: 5.5rem;
}

.dmf-crafts {
  flex: 0 1 auto;
}

.dmf-crafts .mk-seg,
.dmf-goals {
  flex-wrap: wrap;
  border-radius: var(--radius-sm);
}

.dmf-free-check {
  align-self: center;
}

.dmf-goal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  margin-top: 0.7rem;
}

.dmf-goal-pick {
  gap: 0.4rem;
}

.dmf-goal-n {
  font-variant-numeric: tabular-nums;
}

.dmf-goal-label {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

.dmf-plans {
  margin-top: 1rem;
}

.dmf-plan {
  gap: 0.6rem;
}

.dmf-plan-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dmf-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.8rem;
}

.dmf-total-gold {
  font-family: var(--font-display);
  font-size: var(--fs-title);
  font-weight: 700;
}

.dmf-total-bits {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* a step, a turn-in, a prize: icon, words, price (the materials of a craft under the words) */
.dmf-step,
.dmf-turnin,
.dmf-prize {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
}

.dmf-step > .item-tile,
.dmf-turnin > .item-tile,
.dmf-prize > .item-tile {
  margin-top: 0.1rem;
}

.dmf-step-title {
  font-size: var(--fs-text);
  color: var(--text);
}

.dmf-step-title .mk-name {
  font-size: inherit;
}

.dmf-mats {
  grid-column: 2 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-left: 0.2rem;
  font-size: var(--fs-small);
}

.dmf-mat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.6rem;
  color: var(--text-muted);
}

.dmf-mat-each {
  color: var(--text-faint);
}

.dmf-mat-total {
  min-width: 5.5rem;
  text-align: right;
}

.dmf-ticket {
  --quality-color: var(--gold);
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-gold-bright);
}

.dmf-free-word {
  font-weight: 700;
  color: var(--text-ok);
}

.dmf-best {
  font-weight: 700;
}

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

.dmf-shut {
  opacity: 0.62;
}

.dmf-sub-head {
  margin-top: 0.6rem;
  font-family: var(--font-display);
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dmf-list-tools {
  display: flex;
  justify-content: flex-end;
}

.dmf-list-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dmf-pair {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

.dmf-chip-ah {
  border-color: rgba(130, 226, 173, 0.55);
  background: rgba(130, 226, 173, 0.12);
  color: var(--text-ok);
}

.dmf-chip-tickets {
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(212, 175, 55, 0.12);
  color: var(--text-gold);
}

@media (max-width: 1080px) {
  .dmf-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .dmf-faire > .mk-body {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Phones: the price goes under the words; the controls two to a row. */
@media (max-width: 560px) {
  .dmf-step,
  .dmf-turnin,
  .dmf-prize {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .dmf-step > .mk-price,
  .dmf-turnin > .mk-price,
  .dmf-prize > .mk-price {
    grid-column: 2;
    align-items: flex-start;
  }

  .dmf-step .mk-price-line,
  .dmf-turnin .mk-price-line,
  .dmf-prize .mk-price-line,
  .dmf-step .mk-price-note,
  .dmf-turnin .mk-price-note,
  .dmf-prize .mk-price-note {
    justify-content: flex-start;
    text-align: left;
  }

  .dmf-field {
    flex: 1 1 8rem;
  }

  .dmf-rep,
  .dmf-crafts {
    flex: 1 1 100%;
  }

  .dmf-mat {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dmf-mat-each {
    display: none;
  }
}
