:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --bg-2: #12151a;
  --panel: #161a20;
  --panel-2: #1c2128;
  --line: #2c323b;
  --line-soft: #20252d;
  --text: #e6e8eb;
  --muted: #9aa3ae;
  --faint: #6d7682;
  --accent: #f0c14b;
  --accent-ink: #1a1408;
  --good: #6fcf6f;
  --warn: #e8a341;
  --bad: #e2675a;
  --q-common: #e6e8eb;
  --q-uncommon: #5fdc4f;
  --gold: #f5c542;
  --silver: #c9ced4;
  --copper: #d58c58;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ── Masthead ─────────────────────────────────────────────── */
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font: 600 clamp(28px, 4.4vw, 42px)/1.1 var(--display);
  letter-spacing: .01em;
}

/* ── Panels ───────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.controls { padding: 16px 18px; display: grid; gap: 16px; }
.control-row { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: flex-end; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .field > span {
  padding: 0;
  margin-bottom: 6px;
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Segmented radio groups */
.seg { display: block; }
.seg label { display: inline-block; margin: 0 -1px 0 0; }
.seg input, .chips input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  padding: 7px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  transition: background .12s, color .12s;
}
.seg label:first-of-type span { border-radius: 8px 0 0 8px; }
.seg label:last-of-type span { border-radius: 0 8px 8px 0; }
.seg span:hover { color: var(--text); }
.seg input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  position: relative;
}
.seg input:focus-visible + span,
.chips input:focus-visible + span,
.switch input:focus-visible + .track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Tier chips */
.chips label { display: inline-block; margin-right: 6px; }
.chips span {
  display: block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}
.chips input:checked + span { color: var(--text); border-color: var(--accent); background: rgba(79, 156, 255, .1); }

/* Switch */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.track {
  flex: none;
  width: 44px; height: 24px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background .15s;
}
.track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: transform .15s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--accent-ink); }
.switch-text strong { display: block; font-weight: 600; }
.switch-text small { color: var(--muted); font-size: 12.5px; }

.field select {
  appearance: none;
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a89b8c'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 7px 32px 7px 12px;
  cursor: pointer;
}

/* ── Status line ──────────────────────────────────────────── */
.status {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  align-items: center; justify-content: space-between;
  margin: 16px 2px 12px;
}
.snapshot { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.snapshot b { color: var(--text); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--good); box-shadow: 0 0 0 3px rgba(111, 207, 111, .15); }
.dot.stale { background: var(--warn); }
.dot.err { background: var(--bad); }
.dot.busy { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 7px 14px;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--muted); }

.banner {
  background: rgba(226, 103, 90, .12);
  border: 1px solid rgba(226, 103, 90, .45);
  border-radius: var(--radius);
  color: #f3b6ae;
  margin-bottom: 12px;
  padding: 10px 14px;
}

/* ── Best value ───────────────────────────────────────────── */
.best {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.best-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 13px 16px;
}
.best-card.top { border-color: rgba(79, 156, 255, .55); background: linear-gradient(160deg, rgba(79, 156, 255, .1), var(--panel) 60%); }
.best-card .label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.best-card .value { font-size: 22px; font-weight: 700; margin: 2px 0; }
.best-card .value small { color: var(--muted); font-size: 13px; font-weight: 500; }
.best-card .sub { color: var(--muted); font-size: 13px; }

/* ── Table ────────────────────────────────────────────────── */
.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
/* Scoped to the site's own tables, so Wowhead's tooltip tables are left alone. */
.table-scroll table { border-collapse: collapse; }
.table-scroll > table { width: 100%; min-width: 860px; }
.table-scroll th, .table-scroll td { padding: 10px 14px; text-align: left; vertical-align: middle; }
thead th {
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
thead button {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
}
thead button:hover { color: var(--text); }
thead button[aria-sort]::after { content: " ▲"; color: var(--accent); font-size: 9px; }
thead button[aria-sort="descending"]::after { content: " ▼"; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { width: 1%; color: var(--faint); }

tbody tr.row { border-top: 1px solid var(--line-soft); cursor: pointer; }
tbody tr.row:first-child { border-top: 0; }
tbody tr.row:hover { background: rgba(255, 255, 255, .025); }
tbody tr.row.open { background: rgba(79, 156, 255, .05); }
tr.row.unpriced { opacity: .55; }
.item-cell { display: flex; align-items: center; gap: 9px; }
/* The link is the icon's frame: it shows as an empty slot until the image fades in. */
.icon-link { display: inline-flex; flex: none; width: 36px; height: 36px; border-radius: 6px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
.icon-link.small { width: 20px; height: 20px; border-radius: 4px; }
img.icon { opacity: 0; transition: opacity .25s ease; }
img.icon.in { opacity: 1; }
.icon-link:hover .icon { border-color: var(--accent); }
.icon-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chev { color: var(--faint); font-size: 10px; transition: transform .12s; width: 10px; }
tr.open .chev { transform: rotate(90deg); color: var(--accent); }
.crate-name { font-weight: 600; white-space: nowrap; }
.q-raw .crate-name { color: var(--q-common); }
.q-crafted .crate-name { color: var(--q-uncommon); }
.crate-meta { color: var(--faint); font-size: 12px; white-space: nowrap; }

.medal {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 700;
}

.fill-main { white-space: nowrap; }
.fill-sub { color: var(--faint); font-size: 12px; white-space: nowrap; }
.warn { color: var(--warn); }
.na { color: var(--faint); }
.off .money, .off .na { opacity: .4; text-decoration: line-through; text-decoration-color: var(--faint); }

.per { font-weight: 700; font-size: 16px; }

.money { white-space: nowrap; }
.coin { margin-left: 4px; }
.coin:first-child { margin-left: 0; }
.coin i { font-style: normal; font-weight: 600; font-size: .82em; margin-left: 1px; }
.coin.g i { color: var(--gold); }
.coin.s i { color: var(--silver); }
.coin.c i { color: var(--copper); }

/* Expanded bundle list */
tr.detail > td { background: var(--bg-2); padding: 4px 14px 14px 46px; border-top: 1px solid var(--line-soft); }
.bundles { width: auto; min-width: 0; }
.bundles th, .bundles td { padding: 6px 22px 6px 0; font-size: 13.5px; }
.bundles th { background: none; border-bottom: 1px solid var(--line-soft); }
.bundles tr.best-bundle td:first-child { color: var(--accent); font-weight: 600; }
.tag {
  display: inline-block; margin-left: 8px; padding: 0 7px;
  border: 1px solid currentColor; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
}
.detail-note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }

.empty td { color: var(--muted); padding: 34px 14px; text-align: center; }

/* ── Favor editor ─────────────────────────────────────────── */
.favor-panel { margin-top: 14px; padding: 12px 18px; }
.favor-panel summary { cursor: pointer; font-weight: 600; }
.favor-panel[open] summary { margin-bottom: 8px; }
.note { color: var(--muted); font-size: 13px; margin: 0 0 12px; max-width: 78ch; }
.favor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.favor-tier { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; }
.favor-tier h3 { font-size: 14px; margin: 0 0 8px; }
.favor-tier h3 small { color: var(--warn); font-weight: 500; margin-left: 6px; }
.favor-tier label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; margin-top: 6px; }
.favor-tier .white { color: var(--q-common); }
.favor-tier .green { color: var(--q-uncommon); }
.favor-tier input {
  width: 72px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 4px 8px;
  text-align: right;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer { color: var(--faint); font-size: 12.5px; padding-top: 22px; padding-bottom: 40px; }
.footer p { margin: 0 0 6px; max-width: 90ch; }

@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .seg span { padding: 7px 11px; }
  th, td { padding: 9px 10px; }
}

/* ── Site navigation ──────────────────────────────────────── */
.nav { background: #080b11; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 10; }
.nav-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 26px; min-height: 50px; }
.brand { color: var(--text); font: 600 19px/1 var(--display); letter-spacing: .02em; text-decoration: none; }
.brand span { color: var(--accent); }
.nav nav { display: flex; gap: 4px; }
.nav nav a {
  border-radius: 7px;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 12px;
  text-decoration: none;
}
.nav nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav nav a.active { color: var(--accent); background: rgba(79, 156, 255, .1); }

/* ── Home page ────────────────────────────────────────────── */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.tool-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text);
  display: flex; flex-direction: column;
  padding: 22px 24px;
  text-decoration: none;
  transition: border-color .12s, transform .12s;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-card h2 { font: 600 23px/1.2 var(--display); margin: 0 0 8px; }
.tool-card p { color: var(--muted); margin: 0 0 18px; flex: 1; }
.tool-card .go { color: var(--accent); font-weight: 600; }

/* ── Crafting profit ──────────────────────────────────────── */
.field input[type="search"], .range input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 7px 12px;
}
.field input[type="search"] { width: 100%; min-width: 150px; }
.field.grow { flex: 1 1 170px; max-width: 280px; }
.range { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.range input { width: 76px; text-align: right; }
.field input:focus-visible, .field select:focus-visible, .range input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.count { color: var(--muted); margin: 0 2px 10px; }
.count b { color: var(--text); }

.icon {
  flex: none;
  width: 36px; height: 36px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-block;
  object-fit: cover;
}
.icon.small { width: 20px; height: 20px; border-radius: 4px; }
.item-name { font-weight: 600; }
.yield { color: var(--muted); font-weight: 500; }
.q0 { color: #9d9d9d; }
.q1 { color: var(--q-common); }
.q2 { color: var(--q-uncommon); }
.q3 { color: #4d9dff; }
.q4 { color: #b972ff; }
.q5 { color: #ff8f2e; }

/* Profit is only coloured when it is a loss. */
.loss .money { color: var(--bad); }
.loss .coin i { color: inherit; opacity: .75; }
.minus { margin-right: 1px; }

.detail-grid { display: flex; flex-wrap: wrap; gap: 10px 48px; align-items: flex-start; }
.mat { display: inline-flex; align-items: center; gap: 8px; }
.src { color: var(--faint); }
.src.vendor { color: var(--accent); }
.sums { margin: 6px 0 0; min-width: 250px; }
.sums div { display: flex; justify-content: space-between; gap: 24px; padding: 5px 0; font-size: 13.5px; }
.sums dt { color: var(--muted); }
.sums dd { margin: 0; font-variant-numeric: tabular-nums; }
.sums .total { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-soft); font-weight: 700; margin: 3px 0; padding: 7px 0; }
.sums .total dt { color: var(--text); }
.detail-note a { color: var(--muted); }

.more { border-top: 1px solid var(--line-soft); padding: 12px; text-align: center; }

/* ── Best craft per profession ────────────────────────────── */
.rank-panel { margin-bottom: 14px; padding: 12px 18px; }
.rank-panel summary { cursor: pointer; font-weight: 600; }
.rank-panel[open] summary { margin-bottom: 8px; }
.rank-panel .best { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 4px; }
.prof-card { background: var(--bg-2); display: flex; flex-direction: column; }
.prof-card .label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.place {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px;
  background: var(--line); color: var(--text);
  font-size: 11px; font-weight: 700; letter-spacing: 0;
}
.prof-card.top .place { background: var(--accent); color: var(--accent-ink); }
.top-crafts { list-style: none; margin: 10px 0 8px; padding: 0; flex: 1; }
.top-crafts li { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.top-crafts li:first-child { border-top: 0; }
.tc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tc-main .item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.tc-sub { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-day { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-day small { display: block; color: var(--faint); font-size: 11px; font-weight: 500; }
.top-crafts li:first-child .tc-day { font-size: 16px; }
.link-btn {
  align-self: flex-start;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font: inherit; font-size: 13px; font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }

/* Cooldown tag next to a recipe name */
.tag.cd { color: var(--warn); font-weight: 600; white-space: nowrap; }
.tag.spec { color: #c4b5fd; font-weight: 600; white-space: nowrap; }
/* Crafting Profit: the Specializations dropdown, a list of ticks under each
   profession's name. Drawn like the other dropdowns. */
.spec-dd { display: block; }
.spec-dd .dd-btn { width: 100%; justify-content: space-between; }
.spec-dd .dd-cur { flex: 1; min-width: 0; }
.spec-dd .dd-cur span { overflow: hidden; text-overflow: ellipsis; text-align: left; }
.spec-dd .dd-menu { position: fixed; top: 0; left: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; z-index: 80; }
.dd-menu li.dd-head { padding: 9px 10px 3px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); cursor: default; }
.dd-menu li.dd-head:hover { background: none; }
.spec-menu li[data-spec="all"] { border-bottom: 1px solid var(--line-soft); border-radius: 8px 8px 0 0; margin-bottom: 2px; }

/* ── Craft amount slider in an expanded recipe ─────────────── */
.sim { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 0 6px; }
.sim label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.sim-range { flex: 1 1 200px; max-width: 360px; accent-color: var(--accent); cursor: pointer; }
.sim-num {
  width: 84px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit; font-weight: 600;
  padding: 4px 8px;
  text-align: right;
}
.sim-range:focus-visible, .sim-num:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mat .tag { margin-left: 0; }

/* On a narrow screen the table scrolls sideways; keep the expanded breakdown
   within the visible width instead of stretching across the whole table. */
.detail-wrap { position: sticky; left: 46px; max-width: calc(100vw - 104px); overflow-x: auto; }
@media (max-width: 640px) {
  tr.detail > td { padding-left: 14px; }
  .detail-wrap { left: 14px; max-width: calc(100vw - 60px); }
  .bundles th, .bundles td { padding-right: 12px; }
}

/* ── Fixed layout for the craft simulator ─────────────────────
   Column and block widths are set, not sized to their contents, so the
   breakdown stays put while the slider changes the numbers. */
.detail-grid { display: grid; grid-template-columns: minmax(0, 580px) 290px; gap: 10px 48px; align-items: start; }
.sums { width: 290px; min-width: 0; margin: 0; }
.mats { table-layout: fixed; width: 100%; }
.mats .c-qty { width: 76px; }
.mats .c-each { width: 110px; }
.mats .c-avail { width: 126px; }
.mats .c-cost { width: 128px; }
.mats th, .mats td { padding-right: 14px; }
.mats td.num, .mats th.num { white-space: nowrap; }
.mats th:last-child, .mats td:last-child { padding-right: 0; }
.avail { color: var(--faint); font-size: 12.5px; }
.avail.warn { color: var(--warn); }
.avail.vendor { color: var(--accent); }
.sim-notes { min-height: 1.5em; }

@media (max-width: 1320px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .sums { width: 100%; max-width: 320px; }
  .sim-notes { min-height: 3em; }
}
@media (max-width: 640px) {
  /* Too narrow for every column: the breakdown scrolls sideways at a set
     width, so large amounts never push it wider and add a scrollbar. */
  .mats { min-width: 480px; }
  .mats .c-qty { width: 72px; }
  .mats .c-each { width: 88px; }
  .mats .c-avail { width: 98px; }
  .mats .c-cost { width: 116px; }
  .mats th, .mats td { padding-right: 10px; }
  .sim-notes { min-height: 4.5em; }
}

/* ── Wowhead item tooltip ─────────────────────────────────────
   A solid panel behind the whole tooltip, wide enough to sit behind the item
   icon that Wowhead hangs off its left edge. */
/* The tooltip never takes the mouse. Otherwise, when it lands on top of the
   icon being hovered, the icon loses the pointer, the tooltip hides, the icon
   gets the pointer back, and the two flicker. */
.wowhead-tooltip, .wowhead-tooltip * { pointer-events: none !important; }

.wowhead-tooltip::before {
  content: "";
  position: absolute;
  inset: -8px -8px -8px -54px;
  z-index: -1;
  background: #080b11;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}

/* ── Price graphs ─────────────────────────────────────────────
   One series, so one colour: the line wears the accent and every label,
   axis and number stays in text colours. Grid and axes are kept quiet. */
.chart-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 10px; }
.chart-title { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.tabs { display: inline-flex; }
.tabs button {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  margin-right: -1px;
  padding: 5px 11px;
}
.tabs button:first-child { border-radius: 7px 0 0 7px; }
.tabs button:last-child { border-radius: 0 7px 7px 0; margin-right: 0; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); position: relative; }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; position: relative; }

.chart { position: relative; margin-top: 12px; min-height: 240px; }
.chart svg { display: block; max-width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .zero { stroke: var(--faint); stroke-width: 1; }
.chart .axis-text { fill: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--accent); stroke: var(--bg-2); stroke-width: 2; }
.chart-empty { color: var(--muted); margin: 0; padding: 100px 0; text-align: center; }
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: #080b11;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  font-size: 13px; font-weight: 600;
  padding: 6px 10px;
  white-space: nowrap;
  z-index: 2;
}
.tip-when, .tip-sub { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; }

.chart-stats { display: flex; flex-wrap: wrap; gap: 10px 34px; margin: 12px 0 0; }
.chart-stats dt { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.chart-stats dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-stats small { display: block; color: var(--faint); font-size: 11.5px; font-weight: 500; }

.trend-slot { margin-top: 12px; }
.item-link { color: inherit; text-decoration: none; }
.item-link:hover { text-decoration: underline; }
.field.grow.wide { max-width: 420px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; color: var(--muted); }

/* The hidden attribute always wins, even over a display set by a class. */
[hidden] { display: none !important; }

/* ── Auction house browser ────────────────────────────────── */
.cat {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%;
  background: none; border: 0; border-radius: 6px;
  color: var(--text); cursor: pointer;
  font: inherit; font-weight: 600; text-align: left;
  padding: 6px 8px;
}
.cat.sub { color: var(--muted); font-size: 13.5px; font-weight: 500; padding: 4px 8px; }
.cat .n { color: var(--faint); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cat:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.cat[aria-pressed="true"] { background: rgba(79, 156, 255, .12); color: var(--accent); }
.cat:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Auctions first, then the graph at full width below them. */
.ah-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.ah-detail > section { min-width: 0; overflow-x: auto; }
.listings { width: auto; margin-top: 12px; }
.listings th, .listings td { padding-right: 14px; white-space: nowrap; }
.listings th:last-child, .listings td:last-child { padding-right: 0; }

@media (max-width: 900px) {
}

/* A calm notice, as opposed to the red error banner. */
.banner.note { background: rgba(79, 156, 255, .1); border-color: rgba(79, 156, 255, .4); color: var(--text); }

/* ── Loading ──────────────────────────────────────────────────
   Placeholders hold the layout while data loads, a thin bar under the
   navigation shows that something is happening, and content rises in once
   when it arrives. All of it stands still for people who ask for less motion. */
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes load-slide { from { transform: translateX(-110%); } to { transform: translateX(320%); } }
@keyframes draw-line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.skel {
  display: inline-block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #1c2128 30%, #2a313b 50%, #1c2128 70%);
  background-size: 300% 100%;
  animation: shimmer 1.6s linear infinite;
  vertical-align: middle;
}
.skel.thin { height: 9px; opacity: .7; }
.skel.big { height: 22px; }
.skel.box { width: 36px; height: 36px; border-radius: 6px; flex: none; }
.skel-stack { display: inline-flex; flex-direction: column; gap: 8px; }
.skel-row td { border-top: 1px solid var(--line-soft); }
.skel-row:first-child td { border-top: 0; }
.skel-lines { display: grid; gap: 14px; padding: 8px 8px 6px; }
.skel-lines .skel { display: block; }

.nav { min-height: 51px; }
.load-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; opacity: 0; transition: opacity .3s ease .15s; }
.load-bar.on { opacity: 1; transition-delay: 0s; }
.load-bar i { display: block; height: 100%; width: 30%; background: var(--accent); border-radius: 2px; animation: load-slide 1.15s ease-in-out infinite; }
.load-bar.known i { animation: none; transition: width .35s ease; }

.btn.busy::before {
  content: "";
  display: inline-block;
  width: 11px; height: 11px;
  margin-right: 8px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -1px;
  animation: spin .7s linear infinite;
}

.reveal > * { animation: rise .32s ease both; }
.reveal > :nth-child(2) { animation-delay: 25ms; }
.reveal > :nth-child(3) { animation-delay: 50ms; }
.reveal > :nth-child(4) { animation-delay: 75ms; }
.reveal > :nth-child(5) { animation-delay: 100ms; }
.reveal > :nth-child(6) { animation-delay: 125ms; }
.reveal > :nth-child(7) { animation-delay: 150ms; }
.reveal > :nth-child(8) { animation-delay: 175ms; }
.reveal > :nth-child(n+9) { animation-delay: 200ms; }

tr.detail.enter .detail-wrap { animation: rise .24s ease both; }
table.refreshing tbody { opacity: .45; pointer-events: none; }
.table-scroll tbody { transition: opacity .18s ease; }
.count { min-height: 1.5em; }

.chart-skel {
  height: 240px;
  border-radius: 8px;
  display: grid; place-items: center;
  background:
    linear-gradient(90deg, transparent 30%, rgba(255, 255, 255, .035) 50%, transparent 70%) 0 0 / 300% 100%,
    repeating-linear-gradient(to bottom, transparent 0 49px, var(--line-soft) 49px 50px);
  animation: shimmer 1.6s linear infinite;
}
.chart-load-text { color: var(--faint); font-size: 13px; }
.chart svg { animation: fade .25s ease both; }
.chart .line.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-line .7s ease-out .05s forwards; }
.chart-stats > div { animation: fade .3s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── Slim top of page ─────────────────────────────────────────
   The header is a compact title, the auction house pickers are always
   on show, and every other control opens from the Filters button. */

.controls { display: block; padding: 14px 18px; }
.top-row { justify-content: space-between; }
.house { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: flex-end; }

.filter-btn { display: inline-flex; align-items: center; gap: 8px; }
.filter-btn .caret { color: var(--muted); font-size: 12px; transition: transform .2s ease; }
.filter-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.filter-btn[aria-expanded="true"] .caret { transform: rotate(180deg); color: var(--accent); }
.badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 700;
}

/* The panel opens downwards: its row grows from nothing to its content's height. */
.filters { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .24s ease; }
.filters.open { grid-template-rows: 1fr; }
.filters-inner {
  min-height: 0; overflow: hidden;
  display: grid; gap: 16px;
  margin: 0 -4px; padding: 0 4px;        /* room for focus rings at the edges */
  opacity: 0; transition: opacity .2s ease, padding .24s ease;
}
.filters.open .filters-inner { padding: 16px 4px 4px; opacity: 1; }

/* ── Page top without a title banner ──────────────────────────
   The navigation names the page, so the big heading is only kept for
   screen readers. The auction house pickers sit straight on the page,
   and the filters open in a container of their own beneath them. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
main.wrap { padding-top: 20px; }

.controls { background: none; border: 0; border-radius: 0; padding: 0; }
.filters-clip { min-height: 0; overflow: hidden; }
.filters-inner {
  min-height: auto; overflow: visible;
  margin: 14px 0 0; padding: 16px 18px;
  opacity: 0; transition: opacity .2s ease;
}
.filters.open .filters-inner { padding: 16px 18px; opacity: 1; }
.status { margin-top: 14px; }

/* ── Cheapest Favor: a list down the right of the crate table ── */
.crate-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.crate-main { min-width: 0; }
.cheapest { padding: 14px 16px 6px; position: sticky; top: 66px; }
.cheapest h2 { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cheapest ol { list-style: none; margin: 0; padding: 0; }
.cheapest li { border-top: 1px solid var(--line-soft); }
.cheapest li:first-child { border-top: 0; }
.cheap-item {
  display: block; width: 100%;
  background: none; border: 0; border-radius: 6px;
  color: inherit; cursor: pointer; font: inherit; text-align: left;
  padding: 10px 0;
}
.cheap-item > span { display: block; }
.cheap-item:hover .cheap-name { text-decoration: underline; }
.cheap-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cheap-head { display: flex !important; align-items: baseline; justify-content: space-between; gap: 10px; }
.cheap-label { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.top .cheap-label { color: var(--accent); }
.cheap-price { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cheap-name { font-weight: 600; margin-top: 2px; }
.cheap-name.q-crafted { color: var(--q-uncommon); }
.cheap-sub { color: var(--faint); font-size: 12.5px; }
.cheap-skel { display: grid; gap: 9px; padding: 12px 0; }
.cheap-skel .skel { display: block; }

@media (max-width: 1320px) {
  .crate-layout { grid-template-columns: minmax(0, 1fr); }
  .cheapest { position: static; order: -1; }
}

/* ── Less yellow ──────────────────────────────────────────────
   Gold is kept for what it means: coin amounts, the logo, graph lines and
   the loading bar. Selections are a neutral lighter grey, links are a soft
   blue, and an "on" switch is green. */
:root { --select: #2a313b; --select-line: #414a57; --link: #8ab4f8; --on: #3d9a63; }

a { color: var(--link); }
.link-btn { color: var(--link); }
.tool-card .go { color: var(--link); }
.tool-card:hover { border-color: var(--select-line); }

.seg input:checked + span,
.chips input:checked + span,
.tabs button[aria-pressed="true"] { background: var(--select); border-color: var(--select-line); color: var(--text); }
.nav nav a.active { background: rgba(255, 255, 255, .08); color: var(--text); }
.cat[aria-pressed="true"] { background: var(--select); color: var(--text); }
.filter-btn[aria-expanded="true"] { background: var(--select); border-color: var(--select-line); color: var(--text); }
.filter-btn[aria-expanded="true"] .caret { color: var(--text); }
.btn:hover { border-color: #3f5175; }
.icon-link:hover .icon { border-color: var(--select-line); }

.switch input:checked + .track { background: var(--on); }
.switch input:checked + .track::after { background: #fff; }
.sim-range { accent-color: var(--link); }

.badge { background: var(--text); color: var(--bg); }
.medal { background: var(--select); color: var(--text); box-shadow: inset 0 0 0 1px var(--select-line); }
tbody tr.row.open { background: rgba(255, 255, 255, .035); }
tr.open .chev { color: var(--text); }
thead button[aria-sort]::after { color: var(--muted); }
.bundles tr.best-bundle td:first-child { color: var(--text); }
.top .cheap-label { color: var(--text); }
.src.vendor, .avail.vendor { color: var(--text); }
.banner.note { background: var(--select); border-color: var(--select-line); }

/* Keyboard focus rings use the link blue as well. */
:focus-visible { outline-color: var(--link) !important; }
.seg input:focus-visible + span,
.chips input:focus-visible + span,
.switch input:focus-visible + .track { outline-color: var(--link); }

/* ── Top bar ──────────────────────────────────────────────────
   Pickers on the left; when the data was last updated, Update and
   Filters on the right. */
.top-row { align-items: center; }
.top-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-left: auto; }
.top-actions .snapshot { font-size: 13.5px; margin-right: 2px; }
.house-compact { display: none; }
.nav .short { display: none; }
.row-meta { display: none; }
.row-text { display: block; }
.field select { max-width: 100%; }

/* Cheapest Favor heading. On a wide screen it is just a title. */
.cheapest h2 { margin: 0; }
.cheap-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; padding: 0 0 4px;
  color: var(--muted); cursor: default; pointer-events: none;
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-align: left; text-transform: uppercase;
}
.cheap-toggle .cheap-summary, .cheap-toggle .caret { display: none; }

/* ── Slim screens ─────────────────────────────────────────────
   Below this width the crate table gets the full width, and the cheapest
   list folds down to a single line above it that opens when tapped. */
@media (max-width: 1320px) {
  .crate-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cheapest { position: static; order: -1; padding: 0 14px; }
  .cheap-toggle { cursor: pointer; pointer-events: auto; padding: 11px 0; }
  .cheap-toggle .cheap-summary { display: inline; margin-left: auto; color: var(--text); font-size: 14px; letter-spacing: 0; text-transform: none; }
  .cheap-toggle .caret { display: inline; font-size: 12px; transition: transform .2s ease; }
  .cheapest ol { display: none; }
  .cheapest.expanded ol { display: block; border-top: 1px solid var(--line-soft); }
  .cheapest.expanded .caret { transform: rotate(180deg); }
}

/* ── Phones ───────────────────────────────────────────────────
   Everything fits the width of the screen: the navigation and pickers
   shrink to one line each, and each table keeps only its name and its key
   number. The columns that are dropped are all in the row's dropdown. */
@media (max-width: 760px) {
  .wrap { padding: 0 12px; }
  main.wrap { padding-top: 12px; }

  .nav { min-height: 47px; }
  .nav-inner { flex-wrap: nowrap; gap: 8px; min-height: 46px; }
  .brand { font-size: 16px; white-space: nowrap; }
  .nav nav { gap: 0; margin-left: auto; }
  .nav nav a { font-size: 14px; padding: 6px 8px; white-space: nowrap; }
  .nav .long { display: none; }
  .nav .short { display: inline; }

  .top-row { gap: 10px; }
  .house { width: 100%; }
  .house .seg { display: none; }
  .house-compact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .house-compact select {
    appearance: none;
    width: 100%;
    background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239aa3ae'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font: inherit; font-weight: 600;
    padding: 9px 24px 9px 10px;
    text-overflow: ellipsis;
  }
  .top-actions { width: 100%; margin-left: 0; flex-wrap: nowrap; justify-content: flex-start; }
  .top-actions .snapshot { flex: 1; min-width: 0; }
  #statusText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* 16px text in form controls stops phones zooming in when one is tapped. */
  .house-compact select, .field select, .field input, .range input, .sim-num, .favor-tier input { font-size: 16px; }

  .filters-inner, .filters.open .filters-inner { padding: 14px; }
  .filters .control-row { gap: 12px; }
  .filters .field { flex: 1 1 140px; max-width: none; }
  .filters .field select, .filters .field input[type="search"] { width: 100%; }
  .filters .switch { flex: 1 1 100%; }
  .range input { flex: 1; min-width: 0; width: auto; }

  /* Tables: no sideways scrolling. */
  .table-scroll > table { min-width: 0; }
  .table-scroll th, .table-scroll td { padding: 9px 8px; }
  #crates > thead > tr > th:nth-child(3), #crates > tbody > tr > td:nth-child(3),
  #crates > thead > tr > th:nth-child(4), #crates > tbody > tr > td:nth-child(4),
  #crates > thead > tr > th:nth-child(5), #crates > tbody > tr > td:nth-child(5),
  #recipes > thead > tr > th:nth-child(2), #recipes > tbody > tr > td:nth-child(2),
  #recipes > thead > tr > th:nth-child(3), #recipes > tbody > tr > td:nth-child(3),
  #recipes > thead > tr > th:nth-child(4), #recipes > tbody > tr > td:nth-child(4),
  #recipes > thead > tr > th:nth-child(9), #recipes > tbody > tr > td:nth-child(9),
  #recipes > thead > tr > th:nth-child(8), #recipes > tbody > tr > td:nth-child(8),
  #items > thead > tr > th:nth-child(2), #items > tbody > tr > td:nth-child(2),
  #items > thead > tr > th:nth-child(3), #items > tbody > tr > td:nth-child(3),
  #items > thead > tr > th:nth-child(5), #items > tbody > tr > td:nth-child(5),
  #items > thead > tr > th:nth-child(6), #items > tbody > tr > td:nth-child(6) { display: none; }

  .chev { display: none; }
  .item-cell { gap: 9px; }
  .crate-name, .crate-meta { white-space: normal; }
  .row-meta { display: block; color: var(--faint); font-size: 12px; font-weight: 400; }
  .per { font-size: 15px; }
  .rank { padding-right: 0 !important; }

  /* Dropdowns */
  tr.detail > td { padding: 4px 10px 12px; }
  .detail-wrap { position: static; max-width: none; }
  .sums { width: 100%; max-width: none; }
  .mats { min-width: 0; }
  .mats .c-qty { width: 50px; }
  .mats .c-avail { width: 82px; }
  .mats .c-cost { width: 98px; }
  .mats .c-each, .mats th:nth-child(3), .mats td:nth-child(3) { display: none; }
  #crates .bundles th:nth-child(2), #crates .bundles td:nth-child(2),
  #crates .bundles th:nth-child(3), #crates .bundles td:nth-child(3),
  .listings th:nth-child(3), .listings td:nth-child(3),
  .listings th:nth-child(5), .listings td:nth-child(5) { display: none; }
  .bundles th, .bundles td { padding-right: 12px; }
  .sim-range { flex: 1 1 100%; max-width: none; }

  .rank-panel .best { grid-template-columns: minmax(0, 1fr); }
  .rank-panel, .favor-panel { padding: 12px 14px; }
  .pager { gap: 8px; }
  .pager .btn { padding: 7px 10px; }
  .tool-card { padding: 18px; }
}

/* On a touch screen there is no hover, so an icon is not a separate target:
   a tap on it opens the row like a tap anywhere else on the row. */
@media (hover: none) {
  .icon-link { pointer-events: none; }
}

/* Number columns line up on the right, in the page tables and the ones inside dropdowns. */
.table-scroll th.num, .table-scroll td.num { text-align: right; }

@media (max-width: 760px) {
  /* Column headings may wrap, so a long heading does not squeeze the name column. */
  .table-scroll thead th { white-space: normal; font-size: 11px; letter-spacing: .03em; line-height: 1.25; }
  .meta-extra { display: none; }
}

/* Space between the top bar (and its filters) and the page content. */
.controls { margin-bottom: 14px; }
@media (max-width: 760px) { .controls { margin-bottom: 10px; } }

@media (max-width: 760px) {
  /* Room for the whole "Last update" line beside the two buttons. */
  .top-actions { gap: 8px; }
  .top-actions .btn { padding: 7px 10px; }
  .top-actions .snapshot { font-size: 13px; gap: 7px; }
}

/* The crate table has fewer columns than the others, so it can be narrower beside the cheapest list. */
.table-scroll > #crates { min-width: 700px; }
@media (max-width: 760px) { .table-scroll > #crates { min-width: 0; } }

/* ── Top bar: when the data was last updated sits at the far left ── */
.top-row { align-items: flex-end; }
.top-row > .snapshot { min-height: 36px; margin-right: 4px; font-size: 13.5px; white-space: nowrap; }

/* ── Filter fields ────────────────────────────────────────────
   One even grid: every field is the same height and fills its cell, so the
   panel's width is used fully and nothing sits at an odd size. */
.filters .control-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; align-items: end; }
.filters .field { display: block; flex: none; min-width: 0; max-width: none; }
.filters .field select,
.filters .field input[type="search"],
.filters .range input {
  width: 100%; height: 40px; box-sizing: border-box;
  background-color: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit; font-weight: 500;
  padding: 0 12px;
}
.filters .field select { font-weight: 600; padding-right: 32px; text-overflow: ellipsis; }
.filters .range { display: flex; align-items: center; gap: 8px; }
.filters .range input { flex: 1; min-width: 0; text-align: left; }
.filters .field ::placeholder { color: var(--faint); opacity: 1; }
.filters .field select:hover, .filters .field input:hover { border-color: var(--select-line); }
.filters .field select:focus, .filters .field input:focus {
  outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(138, 180, 248, .18);
}
.filters .switch { align-self: center; min-width: 0; }
.filters .chips { grid-column: span 2; min-width: 0; }
.filters .chips label { margin-bottom: 4px; }
@media (min-width: 620px) { .filters .field.wide { grid-column: span 2; } }

/* The auction house panel: the category tree on the left, the other filters beside it. */
.ah-filters { grid-template-columns: 250px minmax(0, 1fr); gap: 16px 22px; align-items: start; }
.cats-tree {
  list-style: none; margin: 0; padding: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 300px; overflow-y: auto;
}
.cats-tree ul { list-style: none; margin: 2px 0 6px 14px; padding: 0 0 0 4px; border-left: 1px solid var(--line-soft); }
.cat-name { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.twist { color: var(--faint); font-size: 11px; transition: transform .15s ease; }
.cat[aria-expanded="true"] .twist { transform: rotate(90deg); color: var(--text); }

@media (max-width: 760px) {
  .house { order: 1; }
  .top-row > .snapshot { order: 2; flex: 1; min-width: 0; min-height: 0; margin: 0; align-self: center; }
  .top-actions { order: 3; width: auto; margin-left: auto; }

  .filters .control-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
  .filters .field select, .filters .field input[type="search"], .filters .range input { height: 44px; }
  .filters .switch, .filters .chips, .filters .field.wide { grid-column: 1 / -1; }
  .ah-filters { grid-template-columns: minmax(0, 1fr); }
  .cats-tree { max-height: 260px; }
  .cat { padding: 9px 8px; }
  .cat.sub { padding: 8px; }
}

/* ── Top bar fits on one line ─────────────────────────────────
   Status, then the pickers straight after it, with the buttons pushed right. */
.top-row { justify-content: flex-start; gap: 12px 18px; }
.house { gap: 12px 18px; }

/* ── Filter panel space ───────────────────────────────────────
   Fields share each row equally. In the auction house the category tree is
   laid out in columns across the panel rather than one tall list, so the
   panel stays short; a category's subcategories open underneath it. */
.filters .field.wide { grid-column: auto; max-width: none; }
.filters .control-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.ah-filters { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cats-tree {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 10px; align-items: start;
  max-height: none; overflow: visible;
}
@media (max-width: 760px) {
  .cats-tree { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-height: none; }
  .filters .control-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

/* An open category takes a full row of the tree, with its subcategories in
   columns beneath it, so opening one never leaves a tall empty gap beside it. */
.cats-tree > li.open { grid-column: 1 / -1; }
.cats-tree > li.open > .cat { max-width: 320px; }
.cats-tree .subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 10px; margin: 2px 0 8px 14px; }
.top-actions .short { display: none; }

@media (max-width: 760px) {
  .cats-tree .subs { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); margin-left: 8px; }
  .cats-tree > li.open > .cat { max-width: none; }
  /* The update button is just its symbol here, leaving room for the status text. */
  .top-actions .long { display: none; }
  .top-actions .short { display: inline; font-size: 16px; line-height: 1; }
}

/* ── Icons ────────────────────────────────────────────────────── */
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons and links line an icon up with their text. */
.btn, .link-btn, .detail-note a { display: inline-flex; align-items: center; gap: 7px; }
.btn { min-height: 38px; transition: background .12s ease, border-color .12s ease, color .12s ease; }
.link-btn { gap: 4px; }
.link-btn .ico { width: 13px; height: 13px; }
.detail-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.detail-note a .ico { width: 14px; height: 14px; }

/* A button that is only an icon: square, same height as the others. */
.icon-btn { justify-content: center; width: 38px; padding: 0; position: relative; }
.icon-btn .ico { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }

/* Update: the arrow itself spins while a load runs. */
.btn.busy::before { content: none; }
.btn.busy .ico { animation: spin .8s linear infinite; }
#refresh:disabled { opacity: 1; color: var(--muted); }

/* Filters: the count sits on the corner of the icon. */
.filter-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; box-shadow: 0 0 0 2px var(--bg); }
.top-actions { gap: 8px; }

/* ── Navigation ───────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { width: 20px; height: 20px; color: var(--accent); flex: none; }
.brand-text > span { color: var(--accent); }
.nav nav a { display: inline-flex; align-items: center; gap: 7px; transition: background .12s ease, color .12s ease; }
.nav nav a .ico { width: 15px; height: 15px; opacity: .8; }
.nav nav a.active .ico { opacity: 1; }

/* ── Top bar: the pickers speak for themselves ────────────────── */
.house legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
.top-row { align-items: center; }
.top-row > .snapshot { min-height: 0; }
.seg span { transition: background .12s ease, color .12s ease, border-color .12s ease; }

/* A magnifying glass inside the search boxes. */
.filters .field input[type="search"] {
  padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236d7682' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.5' y2='16.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

/* ── Home page cards: icon, name, arrow ───────────────────────── */
.tool-card { flex-direction: row; align-items: center; gap: 14px; padding: 20px 22px; }
.tool-card h2 { margin: 0; flex: 1; font-size: 20px; }
.tool-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--select); color: var(--text); flex: none; }
.tool-ico .ico { width: 22px; height: 22px; }
.tool-card .go { color: var(--muted); display: inline-flex; transition: transform .15s ease, color .15s ease; }
.tool-card:hover .go { color: var(--text); transform: translateX(3px); }

/* Small finishing touches. */
tbody tr.row { transition: background .1s ease; }
.pager .icon-btn { width: 38px; }
.cheap-item { transition: background .12s ease; }

@media (max-width: 760px) {
  .brand-text { display: none; }
  .nav nav { margin-left: auto; }
  .nav nav a { padding: 6px 9px; gap: 6px; }
  .top-actions .btn, .pager .btn { padding: 0; }
  .icon-btn { width: 40px; min-height: 40px; }
}

/* The logo text: "Forever" in the text colour, "Tools" in gold. */
.brand .brand-text { color: var(--text); }
.brand .brand-text > span { color: var(--accent); }

/* ── Filters panel footer ─────────────────────────────────────── */
.filters-foot { display: flex; justify-content: flex-end; }
.ah-filters .filters-foot { grid-column: 1 / -1; }

/* ── Crate page side column: Cheapest Favor and Crates I Have ─── */
.crate-side { display: grid; gap: 12px; position: sticky; top: 66px; min-width: 0; }
.crate-side .cheapest { position: static; }
.owned { padding: 14px 16px; }
.owned h2 { margin: 0; }
.owned-body { display: grid; gap: 10px; padding-top: 6px; }

.combo { position: relative; }
.combo input {
  width: 100%; height: 40px; box-sizing: border-box;
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236d7682' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.5' y2='16.5'/%3E%3C/svg%3E") no-repeat 12px center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 0 12px 0 36px;
}
.combo input::placeholder { color: var(--faint); opacity: 1; }
.combo input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(138, 180, 248, .18); }
.combo-list {
  list-style: none; margin: 6px 0 0; padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 232px; overflow-y: auto;
}
.combo-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 6px; cursor: pointer; padding: 7px 9px; }
.combo-list li:hover, .combo-list li.active { background: var(--select); }
.combo-list .crate-name { white-space: normal; }
.combo-list .n { color: var(--faint); font-size: 12px; }
.combo-list .combo-none { color: var(--muted); cursor: default; }
.combo-list .combo-none:hover { background: none; }

.owned-list { list-style: none; margin: 0; padding: 0; }
.owned-list li { border-top: 1px solid var(--line-soft); padding: 10px 0; }
.owned-list li:first-child { border-top: 0; }
.own-head, .own-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.own-row { margin-top: 6px; }
.own-head .cheap-name { margin: 0; }
.own-remove { display: grid; place-items: center; width: 24px; height: 24px; flex: none; background: none; border: 0; border-radius: 6px; color: var(--faint); cursor: pointer; }
.own-remove:hover { background: var(--select); color: var(--text); }
.own-remove .ico { width: 14px; height: 14px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { width: 30px; height: 30px; background: var(--bg-2); border: 0; color: var(--text); cursor: pointer; font: inherit; font-size: 16px; line-height: 1; }
.stepper button:hover { background: var(--select); }
.own-qty { min-width: 30px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.own-price { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.own-price small { display: block; color: var(--faint); font-size: 11.5px; font-weight: 500; }
.owned-total { margin: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.owned-total div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13.5px; }
.owned-total dt { color: var(--muted); }
.owned-total dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.tag.own { color: var(--muted); font-weight: 600; margin-left: 8px; }

@media (max-width: 1320px) {
  /* Both side panels fold to one line each above the table. */
  .crate-side { position: static; order: -1; gap: 8px; }
  .owned { padding: 0 14px; }
  .owned-body { display: none; }
  .owned.expanded .owned-body { display: grid; border-top: 1px solid var(--line-soft); padding: 12px 0 14px; }
  .owned.expanded .caret { transform: rotate(180deg); }
}
@media (max-width: 760px) {
  .combo input { height: 44px; font-size: 16px; }
  .stepper button { width: 36px; height: 36px; }
  .filters-foot .btn { width: 100%; justify-content: center; }
}

/* ── Shopping list ────────────────────────────────────────────── */
.add-list { margin-left: auto; }
.add-list.added { border-color: var(--on); color: #7fd6a2; }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }
.shop-head h2, .side-title { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.shop-left { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; min-height: 39px; }
.shop-total { color: var(--muted); font-size: 13.5px; min-height: 1.5em; }

.buy-list { list-style: none; margin: 0; padding: 0; }
.buy-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); transition: opacity .15s ease; }
.buy-row:first-child { border-top: 0; }
.buy-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.buy-name a { font-weight: 600; }
.buy-sub { color: var(--faint); font-size: 12.5px; }
.buy-cost { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.buy-src { display: block; color: var(--faint); font-size: 11.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.buy-src.vendor { color: var(--text); }
.buy-row.done { opacity: .45; }
.buy-row.done .buy-name a, .buy-row.done .buy-cost .money { text-decoration: line-through; }

/* The tick box: a large target with a drawn check. */
.tick { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; cursor: pointer; }
.tick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tick span { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--select-line); border-radius: 6px; color: transparent; transition: background .12s ease, border-color .12s ease; }
.tick span .ico { width: 14px; height: 14px; stroke-width: 3; }
.tick input:checked + span { background: var(--on); border-color: var(--on); color: #fff; }
.tick input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }

@media (max-width: 1320px) {
}
@media (max-width: 760px) {
  .shop-left { font-size: 22px; min-height: 33px; }
  .add-list { margin-left: 0; flex: 1 1 100%; justify-content: center; }
  /* Four tools: only the page you are on keeps its name, the rest are icons. */
  .nav nav a:not(.active) .short { display: none; }
  .nav nav a { padding: 8px 10px; position: relative; }
  .nav nav a .ico { width: 18px; height: 18px; }
}

/* ── Names can be highlighted and copied ──────────────────────
   The name in a row is ordinary text. The arrow is the button that opens the
   row, and a small button after the name copies it in one click. */
.row-toggle { display: inline-grid; place-items: center; flex: none; width: 14px; height: 28px; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; }
.row-text { display: block; min-width: 0; }
.item-name, .crate-name, .crate-meta, .row-meta, .cheap-name, .buy-name, .mat, .fill-main, .fill-sub { user-select: text; -webkit-user-select: text; }
tr.row .item-name, tr.row .crate-name { cursor: text; }
.item-link { -webkit-user-drag: none; user-select: text; -webkit-user-select: text; }
::selection { background: rgba(138, 180, 248, .35); }

.copy-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px;
  background: none; border: 0; border-radius: 6px;
  color: var(--faint); cursor: pointer;
  opacity: 0; transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.copy-btn .ico { width: 14px; height: 14px; }
.copy-btn:hover { background: var(--select); color: var(--text); }
.copy-btn.copied { color: #7fd6a2; opacity: 1; }
tr.row:hover .copy-btn, tr.row.open .copy-btn, .buy-row:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.buy-title { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }

@media (hover: none) {
  /* No hover on a touch screen: the copy button shows on an open row, and always on the shopping list. */
  tr.row.open .copy-btn, .buy-row .copy-btn { opacity: 1; }
}
@media (max-width: 760px) {
  .row-toggle { display: none; }
}

/* ── Footer ───────────────────────────────────────────────────
   A bar across the bottom of every page. The page is at least as tall as the
   screen, so on a short page the footer still sits at the bottom. */
body { min-height: 100vh; display: flex; flex-direction: column; }
main.wrap { flex: 1 0 auto; width: 100%; }
.site-footer { margin-top: 36px; border-top: 1px solid var(--line-soft); background: #080b11; color: var(--faint); font-size: 12.5px; padding: 18px 0 22px; }
.site-footer p { margin: 0 0 5px; max-width: 90ch; }
.site-footer p:last-child { margin-bottom: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ── Owned crates: a group of their own above the ranking ─────── */
tr.group th {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 9px 14px;
  text-align: left;
}
tr.group:first-child th { border-top: 0; }
tr.group small { color: var(--faint); font-weight: 500; letter-spacing: 0; margin-left: 10px; text-transform: none; }
tr.group + tr.row { border-top: 0; }
tr.row.mine { background: rgba(138, 180, 248, .045); }
tr.row.mine:hover { background: rgba(138, 180, 248, .08); }
.own-count { color: var(--muted); font-weight: 600; }

/* ── Tables and dropdowns fit the window ──────────────────────
   Tables no longer hold a fixed minimum width: names and fills wrap, so a
   table narrows with its space instead of scrolling sideways. The dropdown
   is sized from the table's visible width, not the window's, so it fits
   when a side column takes part of the page. */
.table-scroll { container-type: inline-size; }
.table-scroll > table, .table-scroll > #crates { min-width: 0; }
.crate-name, .item-name, .fill-main, .fill-sub, .crate-meta { white-space: normal; }
.detail-wrap { max-width: 100%; }
@supports (width: 1cqw) {
  .detail-wrap { max-width: calc(100cqw - 60px); }
}
.detail-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, 290px); gap: 10px 36px; }
.sums { width: auto; }
@container (max-width: 700px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .sums { max-width: 340px; }
}
.bundles .tag { white-space: nowrap; }

/* Between a phone and a full window, the tables drop their least-needed columns. */
@media (min-width: 761px) and (max-width: 1000px) {
  .table-scroll th, .table-scroll td { padding-left: 10px; padding-right: 10px; }
  #items > thead > tr > th:nth-child(2), #items > tbody > tr > td:nth-child(2),
  #items > thead > tr > th:nth-child(5), #items > tbody > tr > td:nth-child(5) { display: none; }
}
@media (max-width: 760px) {
  .detail-wrap { max-width: none; }
  tr.group th { padding: 8px; }
}

/* The crafting breakdown has a wide materials table: it sits beside the
   totals only when the table has room, and above them otherwise. */
@container (max-width: 980px) {
  .detail-grid.needs-room { grid-template-columns: minmax(0, 1fr); }
  .detail-grid.needs-room .sums { max-width: 340px; }
}

/* ── Shopping list: how many to buy, large and first on the line ── */
.buy-qty { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 4px; flex: none; min-width: 58px; color: var(--muted); font-variant-numeric: tabular-nums; }
.buy-qty b { color: var(--text); font-size: 19px; font-weight: 700; }
.buy-row.done .buy-qty b { text-decoration: line-through; }
@media (max-width: 760px) {
  .buy-row { gap: 9px; }
  .buy-qty { min-width: 44px; }
  .buy-qty b { font-size: 17px; }
}

/* The amount in a stepper can be typed as well as stepped. */
input.own-qty {
  width: 56px; height: 30px; box-sizing: border-box;
  background: var(--panel); border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  color: var(--text); font: inherit; font-weight: 600; text-align: center;
  padding: 0 4px;
  appearance: textfield; -moz-appearance: textfield;
}
input.own-qty::-webkit-outer-spin-button, input.own-qty::-webkit-inner-spin-button { appearance: none; margin: 0; }
input.own-qty:focus { outline: none; background: var(--bg-2); box-shadow: inset 0 0 0 2px var(--link); }
@media (max-width: 760px) {
  input.own-qty { height: 36px; width: 64px; font-size: 16px; }
}

/* ── Shopping list: a button at the top right and its dropdown ── */
.nav-inner { position: relative; }
.nav-list {
  position: relative;
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; margin-left: auto; flex: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.nav-list:hover { border-color: #3f5175; }
.nav-list.on { background: var(--select); border-color: var(--select-line); }
.nav-list .ico { width: 18px; height: 18px; }
.nav-list .nav-badge { position: absolute; top: -6px; right: -6px; box-shadow: 0 0 0 2px #080b11; }

.list-panel {
  position: absolute; top: calc(100% + 8px); right: 20px; z-index: 30;
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100vh - 76px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .6);
  padding: 14px 16px 12px;
  animation: rise .18s ease both;
}
.lp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.lp-sum { min-width: 0; }
.list-panel .shop-left { font-size: 22px; min-height: 33px; }
.list-panel .buy-row { gap: 9px; padding: 9px 0; }
.list-panel .buy-qty { min-width: 46px; }
.list-panel .buy-qty b { font-size: 17px; }
.lp-making-title { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.lp-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.lp-empty { display: grid; justify-items: center; gap: 4px; padding: 26px 8px 18px; text-align: center; }
.lp-empty p { margin: 0; color: var(--muted); }
.list-panel .banner { margin: 10px 0 0; }

@media (max-width: 760px) {
  .list-panel { right: 12px; left: 12px; width: auto; max-height: calc(100vh - 64px); padding: 12px 12px 10px; }
  .nav nav { margin-left: auto; }
  .nav-list { margin-left: 4px; width: 40px; height: 40px; }
  .lp-foot .btn { flex: 1; justify-content: center; }
}

/* ── Crafting dropdown: how the recipe is learned ─────────────── */
.recipe-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 28px;
  margin: 12px 0 0; padding: 12px 0 2px;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.recipe-facts > div { min-width: 0; }
.recipe-facts .rf-wide { grid-column: span 2; }
.recipe-facts dt { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 3px; }
.recipe-facts dd { margin: 0; min-height: 20px; overflow-wrap: anywhere; }
.recipe-facts a { color: var(--link); text-decoration: none; }
.recipe-facts a:hover { text-decoration: underline; }
.recipe-facts a.item-link { color: inherit; }
.recipe-facts .rf-line { display: block; }
.recipe-facts .rf-line + .rf-line { margin-top: 3px; }
.recipe-facts .sep { color: var(--faint); margin: 0 6px; }
.recipe-facts .mat { gap: 5px; vertical-align: middle; }
@container (max-width: 520px) {
  .recipe-facts { grid-template-columns: minmax(0, 1fr); }
  .recipe-facts .rf-wide { grid-column: auto; }
}

/* ── Dropdown totals: a few large, plain lines ────────────────── */
.sums.simple div { align-items: baseline; padding: 8px 0; font-size: 15px; }
.sums.simple dt { color: var(--text); }
.sums.simple dt small { display: block; color: var(--faint); font-size: 12px; font-weight: 400; margin-top: 1px; }
.sums.simple dd { font-weight: 600; white-space: nowrap; }
.sums.simple .total { font-size: 18px; margin: 4px 0 0; padding: 11px 0; border-bottom: 0; }
.sums.simple .total + div { border-top: 1px solid var(--line-soft); }
.sim-notes.warn { color: var(--warn); }

/* ── Dropdown controls: amount slider, sale price, add to list ── */
.sim { padding: 10px 0 12px; }
.sim .add-list { margin-left: auto; }
.sim-price { display: inline-flex; align-items: center; gap: 8px; }
.price-reset {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; margin-left: -2px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: 6px;
  color: var(--muted); cursor: pointer;
}
.price-reset .ico { width: 14px; height: 14px; }
.price-reset:hover { color: var(--text); border-color: var(--line); }
.price-reset:disabled { visibility: hidden; }
td.edited .money { text-decoration: underline dotted var(--link); text-underline-offset: 4px; }
@media (max-width: 760px) {
  .sim-price { flex: 1 1 auto; }
}

/* ── Sale price: one box each for gold, silver and copper ─────── */
.sim-label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.coin-boxes { display: inline-flex; gap: 6px; }
.coin-box {
  display: inline-flex; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding-right: 8px;
}
.coin-box:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.coin-in {
  width: 44px; background: none; border: 0; outline: 0;
  color: var(--text); font: inherit; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 5px 4px 5px 8px; text-align: right;
  -moz-appearance: textfield; appearance: textfield;
}
.coin-in::-webkit-outer-spin-button, .coin-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.coin-box.g .coin-in { width: 64px; }
.coin-box i { font-style: normal; font-weight: 700; font-size: 13px; }
.coin-box.g i { color: var(--gold); }
.coin-box.s i { color: var(--silver); }
.coin-box.c i { color: var(--copper); }
.sim-price.edited .coin-box { border-color: var(--link); }

/* ── Merchant's Favor ─────────────────────────────────────────── */
.favor-ico { width: 18px; height: 18px; border-radius: 4px; margin-right: 6px; vertical-align: -3px; }
td.favor { white-space: nowrap; }
.sums.simple .total + .total { margin-top: 0; border-top: 0; }
.sums.simple dd.favor .favor-ico { width: 20px; height: 20px; vertical-align: -3px; }
.sums.simple dt small .money { color: var(--muted); }
@media (max-width: 760px) {
  .coin-in { font-size: 16px; }
  .sim-price { flex: 1 1 100%; flex-wrap: wrap; }
}

/* ── Rows: clicking to open or close never highlights their text.
   Names are copied with the copy button instead. ─────────────── */
tr.row, tr.row * { user-select: none; -webkit-user-select: none; }
tr.row .item-name, tr.row .crate-name { cursor: inherit; }
tr.row.plain { cursor: default; }

/* ── Watchlist star ───────────────────────────────────────────── */
.star-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; padding: 0;
  background: none; border: 0; border-radius: 6px;
  color: var(--faint); cursor: pointer;
  opacity: 0; transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.star-btn .ico { width: 15px; height: 15px; }
.star-btn:hover { background: var(--select); color: var(--text); }
.star-btn.on { color: var(--gold); opacity: 1; }
.star-btn.on .ico { fill: currentColor; }
tr.row:hover .star-btn, tr.row.open .star-btn, .star-btn:focus-visible { opacity: 1; }
/* On a touch screen too: a row's star shows when the row is open (or tapped), or when the item is already starred. */
#watch .item-cell { gap: 10px; }
.watch-empty { padding: 44px 16px 36px; }

/* ── Pinned shopping list: stays on screen on every page ──────── */
.lp-actions { display: flex; gap: 6px; flex: none; }
#lpPin.on { background: var(--select); border-color: var(--select-line); color: var(--link); }
#lpPin.on .ico { fill: currentColor; }
.list-panel.pinned {
  position: fixed; top: 60px; right: 12px;
  width: 340px; max-height: calc(100vh - 72px);
  animation: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.list-panel.pinned .shop-left { font-size: 19px; min-height: 28px; }
@media (max-width: 760px) {
  .list-panel.pinned { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 44vh; }
  body.list-pinned { padding-bottom: 46vh; }
}

/* ── Rows without the arrow; profession and skill under the name ── */
.row-toggle {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  opacity: 0; pointer-events: none;
}
tr.row:has(.row-toggle:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.row-meta { display: block; color: var(--faint); font-size: 12px; font-weight: 400; }
tr.row.open > td { background: rgba(255, 255, 255, .03); }

/* ── Dropdown: each kind of information in a box of its own ───── */
.d-card {
  min-width: 0;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px 14px 12px;
}
.d-card > h4 {
  margin: 0 0 8px;
  color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.detail-wrap > .d-card { margin-top: 12px; }
.detail-grid { gap: 12px; align-items: stretch; }
.d-card .sums, .d-card .sums.simple { width: auto; max-width: none; margin: 0; }
.d-card .sums.simple div:first-child { padding-top: 2px; }
.d-card .bundles { width: 100%; }
.d-card .recipe-facts { margin: 0; padding: 0; border-top: 0; }
.d-card .rf-wide { grid-column: auto; }
.d-card .sim-notes { margin-top: 6px; }
.d-card .trend-slot { margin-top: 12px; }
.d-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.d-links a { display: inline-flex; align-items: center; gap: 5px; }
.d-links .ico { width: 13px; height: 13px; }

/* ── ROI badge: green pays, red loses, grey is about break-even ── */
.roi {
  display: inline-block; min-width: 62px;
  border-radius: 6px; padding: 2px 8px;
  font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap;
}
.roi.up { background: rgba(61, 154, 99, .2); color: #7fd6a2; }
.roi.down { background: rgba(214, 84, 84, .2); color: #f08a8a; }
.roi.flat { background: rgba(154, 163, 174, .16); color: var(--muted); }

/* ── Shopping list button: icon, its name, and how many things are on it ── */
.nav-list {
  display: inline-flex; align-items: center; gap: 8px;
  width: auto; height: 36px; padding: 0 12px;
  font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.nav-list .ico { width: 16px; height: 16px; }
.nav-list .nav-badge { position: static; box-shadow: none; margin-left: -1px; }
@media (max-width: 760px) {
  .nav-list { width: auto; height: 40px; padding: 0 10px; gap: 6px; }
}
@media (max-width: 420px) {
  .nav-list-text { display: none; }
  .nav-list { padding: 0 11px; }
}

/* ── Header spans the window: name and tools at the left edge, shopping list at the right ── */
.nav .wrap { max-width: none; }

/* ── Region, ruleset and faction: three dropdowns showing the current choice ── */
.house .seg { display: none; }
.house-compact { display: flex; flex-wrap: wrap; gap: 8px; }
.house-compact select {
  appearance: none; -webkit-appearance: none;
  min-height: 36px; padding: 0 34px 0 12px;
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%239aa3ae' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: border-color .12s ease;
}
.house-compact select:hover { border-color: #3f5175; }
.house-compact select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.house-compact option { background: var(--panel); color: var(--text); font-weight: 500; }
@media (max-width: 760px) {
  .house-compact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .house-compact select { min-height: 42px; font-size: 16px; width: 100%; min-width: 0; text-overflow: ellipsis; }
}

/* ── Crafting: the best crafts in a column on the right, like the crate page ── */
.craft-layout { grid-template-columns: minmax(0, 1fr) 290px; }
.craft-layout .count { margin-top: 0; }
.craft-side .rank-panel {
  margin: 0; padding: 12px 14px;
  max-height: calc(100vh - 82px); overflow-y: auto; overscroll-behavior: contain;
}
.craft-side .rank-panel summary { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.craft-side .rank-panel .best { display: block; margin: 0; }
.craft-side .prof-card { background: none; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; padding: 10px 0 6px; }
.craft-side .prof-card:first-child { border-top: 0; padding-top: 2px; }
.craft-side .top-crafts { margin: 6px 0 4px; }
.craft-side .top-crafts li { border-top: 0; padding: 5px 0; }
.craft-side .top-crafts li:first-child .tc-day { font-size: inherit; }
.craft-side .tc-day { font-size: 13px; }
@media (max-width: 1320px) {
  .craft-layout { grid-template-columns: minmax(0, 1fr); }
  .craft-side { position: static; order: -1; }
  .craft-side .rank-panel { max-height: none; }
}

/* ── Crate and crafting pages share one frame: the table and the side column
   start at the same place and are the same width on both. ───── */
.crate-layout, .craft-layout { grid-template-columns: minmax(0, 1fr) 290px; }
.table-count { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.table-count:empty { display: none; }
#statusText { cursor: default; }
@media (max-width: 1320px) {
  .crate-layout, .craft-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ── Desktop: one column on the left holds the filters (always open) and the
   side panels; the table takes the rest. ─────────────────────── */
.rank-panel > .side-title { margin: 0 0 6px; }
@media (min-width: 1321px) {
  .crate-layout, .craft-layout { grid-template-columns: 290px minmax(0, 1fr); }
  .crate-side {
    order: -1; position: sticky; top: 64px; align-content: start;
    max-height: calc(100vh - 76px); overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; padding-right: 2px;
  }
  .craft-side .rank-panel { max-height: none; overflow: visible; }
  .crate-side:empty { display: none; }

  body.filters-docked #filterBtn { display: none; }
  body.filters-docked .top-actions:not(:has(> :not(#filterBtn))) { display: none; }
  .crate-side > .filters, .crate-side > .filters.open { display: block; transition: none; }
  .crate-side > .filters .filters-clip { overflow: visible; }
  .crate-side > .filters .filters-inner, .crate-side > .filters.open .filters-inner {
    display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr);
    padding: 14px 14px 12px; opacity: 1; margin: 0;
  }
  .crate-side > .filters .filters-inner::before {
    content: "Filters";
    color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  }
  .crate-side > .filters .control-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .crate-side > .filters .chips, .crate-side > .filters .field.wide, .crate-side > .filters .tree-field { grid-column: auto; }
  .crate-side > .filters .cats-tree { display: block; max-height: none; }
  .crate-side > .filters .cats-tree .subs { display: block; margin-left: 10px; }
  .crate-side > .filters .cats-tree > li.open > .cat { max-width: none; }
  .crate-side > .filters .filters-foot { justify-content: flex-start; }
}
@media (max-width: 1320px) {
  /* Slim screens: the table comes first, the best crafts follow it. */
  .craft-side { order: 2; }
}
@media (min-width: 1321px) {
  .crate-side { grid-template-columns: minmax(0, 1fr); }
  .crate-side > .filters, .crate-side > .filters .filters-clip, .crate-side > .filters .filters-inner { min-width: 0; }
  .crate-side > .filters .field, .crate-side > .filters .range { min-width: 0; max-width: 100%; }
  .crate-side > .filters .field select, .crate-side > .filters .field input { width: 100%; min-width: 0; box-sizing: border-box; }
  .crate-side > .filters .range input { width: auto; flex: 1 1 0; }
}

/* ── The page uses the window's width up to a limit, and is centred beyond it. ── */
main.wrap, .site-footer .wrap { max-width: 1680px; margin-left: auto; margin-right: auto; }

/* ── Compact header (up to 1320px): tools become icons, lined up on the left
   after the logo; only the page you are on keeps its name. ──── */
@media (max-width: 1320px) {
  .nav-inner { flex-wrap: nowrap; gap: 10px; }
  .nav nav, .nav nav:not(#_) { gap: 2px; margin-left: 0; }
  .nav .long { display: none; }
  .nav nav a .short { display: none; }
  .nav nav a.active .short { display: inline; }
  .nav nav a { padding: 8px 10px; white-space: nowrap; }
  .nav nav a .ico { width: 18px; height: 18px; }
  .nav-list { margin-left: auto; }
}

/* ── Watchlist beside the shopping list, at the right of the header ── */
a.nav-list { color: var(--text); text-decoration: none; }
.nav-watch { margin-left: auto; }
.nav-watch + .nav-list { margin-left: 0; }
.nav-inner { column-gap: 10px; }
.nav nav { margin-right: 6px; }
@media (max-width: 760px) {
  .nav-watch .nav-list-text { display: none; }
  .nav-watch { padding: 0 11px; }
}

/* ── The shopping list in a window of its own ─────────────────── */
body.list-window { background: var(--panel); }
.list-window .list-panel {
  position: static; width: auto; max-height: none; overflow: visible;
  border: 0; border-radius: 0; box-shadow: none; animation: none;
  padding: 16px 18px;
}

/* In a full browser tab the list sits in a readable column, not edge to edge. */
.list-window .list-panel { max-width: 560px; margin: 0 auto; padding: 24px 18px; }

/* ── The shopping list as a full page: what to buy takes the width, with the
   total and what you are making in a column beside it. ─────── */
body.list-window { background: var(--bg); }
.list-window .list-panel {
  position: static; width: auto; max-width: none; max-height: none; overflow: visible;
  margin: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; animation: none;
}
.list-window .lp-head, .list-window #lpBuy, .list-window .lp-side, .list-window .lp-empty {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.list-window .lp-head { padding: 16px 18px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.list-window .lp-head .shop-left { font-size: 26px; min-height: 38px; }
.list-window #lpBuy { margin: 0; padding: 4px 18px; }
.list-window .lp-side { padding: 14px 16px 12px; }
.list-window .lp-making-title { margin-top: 0; padding-top: 0; border-top: 0; }
.list-window #lpBody { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.list-window #lpBody[hidden] { display: none; }
.list-window .nav-list:disabled { opacity: 1; cursor: default; background: var(--select); border-color: var(--select-line); }
@media (min-width: 900px) {
  .list-window #lpBody { grid-template-columns: minmax(0, 1fr) 360px; }
  .list-window .lp-side { position: sticky; top: 66px; }
  .list-window .buy-row { padding: 11px 0; }
}

/* ── Watchlist: crafting profit stands out; slim screens keep price, profit and ROI ── */
#watch td.craft-profit { font-weight: 700; font-size: 15px; }
#watch td.craft-profit.gain .money { color: #7fd6a2; }
#watch td.craft-profit.gain .coin i { color: inherit; opacity: .8; }
@media (max-width: 760px) {
  #watch > thead > tr > th:nth-child(2), #watch > tbody > tr > td:nth-child(2),
  #watch > thead > tr > th:nth-child(3), #watch > tbody > tr > td:nth-child(3),
  #watch > thead > tr > th:nth-child(5), #watch > tbody > tr > td:nth-child(5) { display: none; }
}

/* ── Price trend squiggle: green rising, red falling, grey steady ── */
.trend { display: inline-block; width: 22px; height: 11px; margin: 0 7px 0 4px; vertical-align: -1px; cursor: help; }
.trend svg { display: block; width: 100%; height: 100%; overflow: visible; }
.trend path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trend.up { color: #7fd6a2; }
.trend.down { color: #f08a8a; }
.trend.flat { color: var(--faint); }

/* ── Price trend: an arrow (or a line when steady) in a fixed slot after the price ── */
.trend { display: inline-block; width: 11px; height: 11px; margin: 0 0 0 8px; vertical-align: -1px; cursor: help; }
.trend.none { cursor: default; }
.trend svg { display: block; width: 100%; height: 100%; }
.trend path, .trend rect { fill: currentColor; stroke: none; }

.trend-text { white-space: normal; }
.trend-text .trend { margin: 0 6px 0 0; cursor: default; }
.trend-text.up { color: #7fd6a2; }
.trend-text.down { color: #f08a8a; }

/* ── Dropdown: the same gap on the left as on the right. (The left used to be
   indented to line up under the row arrow, which is gone.) ──── */
tr.detail > td { padding-left: 14px; padding-right: 14px; }
.detail-wrap { left: 14px; }
@supports (width: 1cqw) {
  .detail-wrap { max-width: calc(100cqw - 28px); }
}
@media (max-width: 760px) {
  tr.detail > td { padding-left: 10px; padding-right: 10px; }
  .detail-wrap { max-width: none; }
}

.list-window main.wrap { padding-top: 16px; }

/* The shopping list page is a narrower block in the middle of the window, so a
   row's name and its price are not a whole screen apart. */
.list-window main.wrap { max-width: 1120px; }

/* ── Auction House: crafting info for an item a recipe makes ──── */
.ah-detail > #craft { margin-top: 10px; overflow: visible; }
.ah-mats { table-layout: auto; width: 100%; max-width: 640px; margin-bottom: 12px; }
.craft-facts { margin-top: 4px; }
.craft-facts .craft-profit { font-weight: 700; }
.craft-facts .craft-profit.gain .money { color: #7fd6a2; }
.craft-facts .craft-profit.gain .coin i { color: inherit; opacity: .8; }

/* ── Pager under every table: range, previous and next, rows per page at the right ── */
.pager {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px 16px;
  padding: 10px 14px; border-top: 1px solid var(--line-soft);
  color: var(--muted); font-size: 13px;
}
.pager[hidden] { display: none; }
.pager-nav { display: inline-flex; align-items: center; gap: 10px; }
.pager-page { min-width: 96px; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pager-range { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pager-size { justify-self: end; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pager-size select {
  appearance: none; -webkit-appearance: none;
  height: 34px; padding: 0 30px 0 11px;
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%239aa3ae' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.pager-size option { background: var(--panel); color: var(--text); }
.pager .icon-btn { width: 34px; height: 34px; min-height: 0; padding: 0; }
@media (max-width: 760px) {
  .pager { grid-template-columns: auto 1fr; padding: 10px; }
  .pager-range { display: none; }
  .pager-size select { font-size: 16px; }
}

/* ── Small additions: arrows inside a line of text, links under the crafting box ── */
.fill-sub .trend { margin: 0 2px 0 5px; }
.detail-note.d-links { gap: 4px 16px; align-items: center; }
.detail-note.d-links span { color: var(--faint); }
.lp-foot { flex-wrap: wrap; }

/* ── Item page ────────────────────────────────────────────────── */
.item-page { max-width: 1400px; }
/* The header (.item-head) is laid out near the end of this file. */

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 14px 0; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.tile dt { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.tile dd { margin: 5px 0 0; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile dd .trend-text { font-size: 15px; font-weight: 600; }
.tile small { display: block; margin-top: 3px; color: var(--faint); font-size: 12px; }
.tile small .money { color: var(--muted); }
.chg-up { color: #7fd6a2; }
.chg-down { color: #f08a8a; }

.item-graphs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.graph-card { padding: 14px 16px 12px; min-width: 0; }
.graph-card.wide { grid-column: 1 / -1; }
.item-lower { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.item-card { padding: 14px 16px; min-width: 0; overflow-x: auto; }
.item-card > h2, .item-card h5 {
  margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.item-card h5 { margin-top: 14px; color: var(--faint); font-size: 11.5px; }
.item-card h5:first-child { margin-top: 0; }
.use-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2px 24px; }
.use-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.use-list .mat { min-width: 0; }
.use-meta { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.use-meta .sep { margin: 0 6px; }
@media (max-width: 900px) {
  .item-graphs { grid-template-columns: minmax(0, 1fr); }
  .item-title h1 { font-size: 22px; }
}
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 10px 12px; }
  .tile dd { font-size: 16px; }
}

/* ── Item page figures: one panel, listed as label and value lines ── */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 0 36px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px 18px; margin: 14px 0;
}
.tile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0 16px;
  background: none; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0;
  padding: 9px 0; min-width: 0;
}
.tile dt { color: var(--muted); font-size: 13.5px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.tile dd { margin: 0; font-size: 15px; font-weight: 700; text-align: right; white-space: nowrap; }
.tile dd .trend-text { font-size: 14px; white-space: nowrap; }
.tile small { grid-column: 1 / -1; margin-top: 1px; font-size: 12px; }
@media (max-width: 760px) {
  .tiles { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 14px; }
  .tile { padding: 8px 0; }
  .tile dd { font-size: 15px; white-space: normal; }
}

/* ── Item page: back arrow at the top left ────────────────────── */
.back-btn { flex: none; width: 36px; height: 36px; min-height: 0; padding: 0; text-decoration: none; color: var(--text); }
.back-btn .ico { width: 18px; height: 18px; }
@media (max-width: 760px) { .top-row > .back-btn { order: 0; width: 40px; height: 40px; } }

/* ── Item page: figures in a column on the left, graphs to the right of it ── */
.item-main { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; margin: 14px 0; }
.item-main .tiles { grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 4px 16px; }
.item-main .tile:last-child { border-bottom: 0; }
.item-main .tile dd { white-space: normal; }
.item-main .tile dd .trend-text { white-space: normal; }
@media (max-width: 1320px) {
  .item-main .item-graphs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .item-main { grid-template-columns: minmax(0, 1fr); }
}

/* ── Item page: the figures stay in view on the left while everything else
   (graphs, auctions, crafting, uses) scrolls in the column on the right ── */
.item-right { min-width: 0; }
.item-main .item-graphs { margin: 0; }
@media (min-width: 901px) {
  .item-main > .tiles {
    position: sticky; top: 64px; align-self: start;
    max-height: calc(100vh - 76px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  }
}

/* ── Same outline as every other panel (the softer line, the shared corner radius) ── */
.tiles, .item-main .tiles { border-color: var(--line-soft); border-radius: var(--radius); }
.list-window .lp-head, .list-window #lpBuy, .list-window .lp-side, .list-window .lp-empty {
  border-color: var(--line-soft); border-radius: var(--radius);
}

/* ── Footer: the version line ─────────────────────────────────── */
.site-version { color: var(--faint); font-variant-numeric: tabular-nums; }
.site-version code { font: inherit; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .95em; }

/* ── "The site has been updated" bar, for a tab left open across an update ── */
.update-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 14px;
  max-width: calc(100vw - 24px);
  background: var(--panel-2); border: 1px solid var(--select-line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
  padding: 9px 10px 9px 16px; font-size: 13.5px;
  animation: rise .2s ease both;
}
.update-bar .btn { padding: 6px 12px; }

/* A price and its trend arrow stay on one line. */
#recipes td.num, #watch td.num, #items td.num, .bundles td.num { white-space: nowrap; }

/* ── Faction picker: the faction's emblem at the left of the dropdown ── */
.house-compact select[data-setting="faction"] {
  padding-left: 40px;
  background-repeat: no-repeat, no-repeat;
  background-position: left 9px center, right 12px center;
  background-size: 22px 22px, 12px 8px;
}
.house-compact select[data-setting="faction"][data-value="alliance"] {
  background-image: url("https://wow.zamimg.com/images/wow/icons/medium/pvpcurrency-honor-alliance.jpg"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%239aa3ae' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.house-compact select[data-setting="faction"][data-value="horde"] {
  background-image: url("https://wow.zamimg.com/images/wow/icons/medium/pvpcurrency-honor-horde.jpg"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%239aa3ae' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.house-compact select[data-setting="faction"][data-value="blackwater"] {
  background-image: url("https://wow.zamimg.com/images/wow/icons/medium/inv_misc_coin_01.jpg"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%239aa3ae' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (max-width: 760px) {
  .house-compact select[data-setting="faction"] { padding-left: 36px; background-position: left 8px center, right 10px center; background-size: 20px 20px, 12px 8px; }
}

/* Favor column: the number sits in a fixed-width slot, so the icons line up
   in a column whether the number has one digit or two. */
.favor-n { display: inline-block; min-width: 2.2ch; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Home page ────────────────────────────────────────────────── */
.home-wrap { max-width: 1080px; padding-bottom: 28px; }
.hero {
  position: relative; text-align: center;
  padding: 56px 16px 30px; margin-bottom: 8px;
  display: grid; justify-items: center; gap: 0;
}
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 300px; z-index: -1; pointer-events: none;
  background: radial-gradient(520px 220px at 50% 0, rgba(79, 156, 255, .13), transparent 70%);
}
.hero-mark { width: 52px; height: 52px; color: var(--accent); filter: drop-shadow(0 6px 18px rgba(79, 156, 255, .28)); }
.hero h1 { margin: 16px 0 0; font: 600 clamp(34px, 5.4vw, 52px)/1.05 var(--display); letter-spacing: .01em; }
.hero h1 span { color: var(--accent); }
.hero-line { margin: 12px 0 0; color: var(--muted); font-size: 16px; max-width: 46ch; }

.hero-search {
  display: flex; align-items: center; gap: 8px;
  width: min(560px, 100%); margin-top: 26px; padding: 6px 6px 6px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.hero-search:focus-within { border-color: var(--select-line); box-shadow: 0 0 0 3px rgba(138, 180, 248, .14); }
.hero-search-ico { display: inline-flex; color: var(--faint); }
.hero-search-ico .ico { width: 17px; height: 17px; }
.hero-search input {
  flex: 1; min-width: 0; height: 36px; padding: 0 4px;
  background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 15px;
}
.hero-search input::placeholder { color: var(--faint); }
.hero-search .btn { height: 36px; padding: 0 16px; }

.hero-house { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 18px; }
.hero-house .snapshot { font-size: 13.5px; }
.hero-house .house { width: auto; }

.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.home-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ico text go" "stat stat stat";
  align-items: center; gap: 14px 16px;
  padding: 20px 20px 16px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px;
  color: var(--text); text-decoration: none;
  transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.home-card:hover { border-color: var(--select-line); background: #182031; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0, 0, 0, .35); }
.home-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.home-ico {
  grid-area: ico; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(160deg, rgba(79, 156, 255, .2), rgba(79, 156, 255, .06));
  border: 1px solid rgba(79, 156, 255, .22); color: var(--accent);
}
.home-ico .ico { width: 22px; height: 22px; }
.home-text { grid-area: text; display: grid; gap: 3px; min-width: 0; }
.home-name { font: 600 21px/1.2 var(--display); }
.home-desc { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.home-go { grid-area: go; display: inline-flex; color: var(--faint); transition: transform .14s ease, color .14s ease; }
.home-go .ico { width: 18px; height: 18px; }
.home-card:hover .home-go { color: var(--text); transform: translateX(3px); }
.home-stat {
  grid-area: stat; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  min-height: 24px; padding-top: 13px; border-top: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}
.home-stat small { color: var(--faint); font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.home-stat b { display: inline-flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.home-stat b > i { font-style: normal; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.home-grid .home-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .hero { padding: 34px 4px 22px; }
  .hero-line { font-size: 15px; }
  .hero-search input { font-size: 16px; }
  .hero-house { flex-direction: column; }
  .hero-house .house { width: 100%; }
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .home-card { padding: 16px 14px 13px; gap: 12px; }
  .home-name { font-size: 19px; }
  .home-stat b > i { display: none; }
}

/* ── Region, ruleset and faction dropdowns (built by the site, so the list can
   show the faction emblems) ───────────────────────────────────── */
.house { display: flex; flex-wrap: wrap; gap: 8px; }
.dd { position: relative; }
.dd-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 10px 0 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  cursor: pointer; transition: border-color .12s ease, background .12s ease;
}
.dd-btn:hover { border-color: #3f5175; }
.dd-btn[aria-expanded="true"] { background: var(--select); border-color: var(--select-line); }
.dd-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dd-btn > .ico { width: 14px; height: 14px; color: var(--muted); transition: transform .15s ease; }
.dd-btn[aria-expanded="true"] > .ico { transform: rotate(180deg); }
.dd-cur { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.dd-cur span { overflow: hidden; text-overflow: ellipsis; }
.dd-ico { width: 22px; height: 22px; border-radius: 5px; flex: none; display: block; }

.dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: max(100%, 170px); margin: 0; padding: 5px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .55);
  animation: rise .14s ease both;
}
.dd-menu[hidden] { display: none; }
.dd-menu li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; outline: 0;
}
.dd-menu li span { flex: 1; }
.dd-menu li .ico { width: 15px; height: 15px; color: var(--link); visibility: hidden; }
.dd-menu li[aria-selected="true"] { font-weight: 700; }
.dd-menu li[aria-selected="true"] .ico { visibility: visible; }
.dd-menu li:hover, .dd-menu li:focus { background: var(--select); }
@media (max-width: 760px) {
  .house { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .dd-btn { width: 100%; min-height: 42px; justify-content: space-between; font-size: 15px; padding: 0 8px 0 10px; }
  .dd-menu { min-width: 100%; }
  .dd:last-child .dd-menu { left: auto; right: 0; min-width: 170px; }
  .dd-menu li { padding: 11px 10px; font-size: 15px; }
}

/* ── Every dropdown: the site's own button and rounded list ───── */
.dd-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.dd-select { display: block; position: relative; }
.dd-select .dd-btn { width: 100%; justify-content: space-between; }
.dd-select .dd-cur { flex: 1; min-width: 0; }
.dd-select .dd-cur span { overflow: hidden; text-overflow: ellipsis; text-align: left; }
.dd-select .dd-menu { position: fixed; top: 0; left: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; z-index: 80; }
.dd-menu { border-radius: 12px; padding: 6px; }
.dd-menu li { border-radius: 8px; }
.dd-menu li[aria-selected="true"] { background: rgba(138, 180, 248, .1); }
.dd-menu li:hover, .dd-menu li:focus { background: var(--select); }
.filters .dd-select .dd-btn { min-height: 40px; font-size: 14px; }
.pager-size .dd-select { display: inline-block; }
.pager-size .dd-select .dd-btn { width: auto; min-height: 34px; gap: 6px; }
@media (max-width: 760px) {
  .dd-select .dd-btn { min-height: 44px; font-size: 16px; }
  .pager-size .dd-select .dd-btn { min-height: 40px; }
}

/* ── Info marks: a small "i" in a circle, with its explanation on hover ── */
.info {
  display: inline-grid; place-items: center; vertical-align: -3px;
  width: 16px; height: 16px; margin-left: 6px; border-radius: 50%;
  color: var(--faint); cursor: help; outline: 0;
  transition: color .12s ease;
}
.info .ico { width: 15px; height: 15px; }
.info:hover, .info:focus-visible { color: var(--link); }
.info:focus-visible { box-shadow: 0 0 0 2px rgba(138, 180, 248, .45); }
.info-tip {
  position: fixed; z-index: 120; max-width: min(280px, calc(100vw - 16px));
  background: #0a0e15; border: 1px solid var(--select-line); border-radius: 9px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .55);
  color: var(--text); font-size: 13px; font-weight: 400; line-height: 1.45; letter-spacing: 0; text-transform: none;
  padding: 8px 11px; pointer-events: none;
  animation: rise .12s ease both;
}
.info-tip[hidden] { display: none; }
.switch-text { display: inline-flex; align-items: center; }
.tile dt, .sums dt, .recipe-facts dt { display: flex; align-items: center; flex-wrap: wrap; }
.sums.simple dt small { flex-basis: 100%; }

/* ── Graphs: filled price line, latest-value tag, legend, and the amount for
   sale as a second line in its own pane underneath ───────────── */
.chart { --c-price: var(--accent); --c-qty: #6ea8fe; min-height: 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend .key { width: 14px; height: 3px; border-radius: 2px; background: var(--c-price); }
.chart-legend .key.qty { background: var(--c-qty); }
.chart .tick { stroke: var(--line-soft); stroke-width: 1; stroke-dasharray: 2 5; opacity: .7; }
.chart .grid.base { stroke: var(--line); }
.chart .line { stroke: var(--c-price); stroke-width: 2; }
.chart .line.qty { stroke: var(--c-qty); stroke-width: 1.6; }
.chart .area { stroke: none; }
.chart .stop-price { stop-color: var(--c-price); }
.chart .stop-qty { stop-color: var(--c-qty); }
.chart .dot { fill: var(--c-price); }
.chart .dot.qty { fill: var(--c-qty); }
.chart .dot.end { stroke: var(--panel); stroke-width: 2; }
.chart .tag rect { fill: var(--c-price); }
.chart .tag text { fill: #14161a; font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart .tag.qty rect { fill: var(--c-qty); }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { cursor: crosshair; }
.chart svg { animation: fade .25s ease both; }
.chart-skel { min-height: 240px; }

/* ── Left panels do not trap the mouse wheel. When a panel has nothing more to
   scroll in that direction (or nothing to scroll at all), the wheel moves the
   page, so you can always scroll up and down with the pointer over them. ── */
.crate-side, .craft-side .rank-panel, .item-main > .tiles { overscroll-behavior: auto; }

/* ── Stars in the Cheapest Favor and Best craft lists: always shown, since
   there is no row to hover; faint until the item is on the watchlist ── */
.cheapest li { display: flex; align-items: center; gap: 2px; }
.cheapest li .cheap-item { flex: 1; min-width: 0; }
.cheapest li .star-btn, .top-crafts li .star-btn { opacity: 1; width: 24px; height: 24px; margin-left: -4px; }
.top-crafts li { gap: 6px; }
.top-crafts li .star-btn { margin-right: -2px; }
/* With the star taking room, a long craft name wraps onto a second line instead of being cut off. */
.craft-side .tc-main .item-name { white-space: normal; overflow: visible; line-height: 1.25; }

/* ── Watchlist: a watched "cheapest Favor" slot ───────────────── */
tr.slot-row > td { background: rgba(79, 156, 255, .045); }
tr.slot-row .crate-meta { white-space: normal; }
tr.slot-row .crate-meta b { color: var(--muted); font-weight: 600; }
tr.slot-row .crate-meta .money { color: var(--text); font-weight: 600; }

/* ── Top crafts: the short list above Best crafts ─────────────── */
#topPanel .prof-card, #topPanel .top-crafts { margin: 0; }
#topPanel .top-crafts li { border-top: 0; padding: 6px 0; gap: 6px; }
#topPanel .tc-day { font-size: 13px; }
#topPanel .top-crafts li:first-child .tc-day { font-size: 14.5px; }

/* ── Watchlist sections ───────────────────────────────────────── */
#watch tr.group th { background: var(--bg-2); padding: 10px 14px; }
#watch tr.group th span { color: var(--text); }

/* ── Pinned shopping list: drag it by its top part ────────────── */
@media (min-width: 761px) {
  .list-panel.pinned { max-height: calc(100vh - var(--lp-top, 60px) - 12px); }
  .list-panel.pinned .lp-head { cursor: grab; user-select: none; touch-action: none; }
  .list-panel.pinned .lp-head button, .list-panel.pinned .lp-head a { cursor: pointer; }
  body.list-dragging, body.list-dragging .list-panel.pinned .lp-head { cursor: grabbing; }
  body.list-dragging { user-select: none; }
}

/* The grip: a strip of dots across the top that says "drag me". */
.lp-grip { display: none; }
@media (min-width: 761px) {
  .list-panel.pinned .lp-grip {
    display: grid; place-items: center; height: 18px; margin: -8px 0 6px;
    border-radius: 7px; color: var(--muted); cursor: grab; touch-action: none;
    transition: background .12s ease, color .12s ease;
  }
  .list-panel.pinned .lp-grip:hover, body.list-dragging .list-panel.pinned .lp-grip { background: var(--select); color: var(--text); }
  body.list-dragging .list-panel.pinned .lp-grip { cursor: grabbing; }
}

/* ── Watchlist: price alerts ──────────────────────────────────── */
.alert-btn {
  display: inline-flex; align-items: center; gap: 7px; vertical-align: middle;
  min-height: 30px; padding: 3px 8px; margin: -3px 0 -3px 2px; flex: none; white-space: nowrap;
  background: none; border: 1px solid transparent; border-radius: 8px;
  color: var(--faint); font: inherit; font-size: 12.5px; cursor: pointer; text-align: right;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.alert-btn .ico { width: 15px; height: 15px; flex: none; }
.alert-btn:hover { background: var(--select); color: var(--text); }
.alert-btn.set { border-color: var(--line); color: var(--muted); }
.alert-btn.set .ico { color: var(--link); }
.alert-btn .al-lines { display: grid; gap: 1px; }
.alert-btn .al-line { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; }
.alert-btn .al-line > i { font-style: normal; color: var(--faint); }
.alert-btn.hit { background: rgba(240, 193, 75, .14); border-color: rgba(240, 193, 75, .55); }
.alert-btn.hit .ico { color: var(--gold); fill: currentColor; }
.alert-btn .al-line.reached { color: var(--text); font-weight: 700; }
.alert-btn .al-line b { font-weight: 700; margin-left: 1px; }
.alert-btn .al-line b.g { color: var(--gold); }
.alert-btn .al-line b.s { color: var(--silver); }
.alert-btn .al-line b.c { color: var(--copper); }
tr.alert-hit > td { background: rgba(240, 193, 75, .07); }
tr.alert-hit > td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.alert-badge { background: var(--gold); color: #17130a; }
.alert-pop {
  position: fixed; z-index: 110; width: 268px; max-width: calc(100vw - 16px);
  background: var(--panel); border: 1px solid var(--select-line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6); padding: 12px 14px;
  animation: rise .12s ease both;
}
.ap-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ap-now { font-size: 12.5px; color: var(--muted); }
.ap-row { display: grid; gap: 5px; margin-bottom: 10px; }
.ap-label { font-size: 12.5px; color: var(--muted); }
.alert-pop .coin-box.g .coin-in { width: 58px; }
.ap-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.ap-foot .btn { min-height: 32px; padding: 0 14px; }

/* ── Deals ────────────────────────────────────────────────────── */
.unit-in input { width: 84px; }
#deals .crate-meta .money { color: var(--muted); }
.filters .tabs { display: inline-flex; }

/* ── A material that is cheaper to craft than to buy ──────────── */
.avail.craft { color: var(--link); }
.avail.craft a { color: inherit; }

/* ── Filters on a phone: one tight two-column grid ────────────── */
.range .g { color: var(--gold); font-weight: 700; }
.unit-in > span { flex: none; }
@media (max-width: 760px) {
  /* Every control is a cell of the same grid, whatever row it was written in. */
  .filters-inner:not(.ah-filters) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
  .filters-inner:not(.ah-filters) .control-row { display: contents; }
  .filters-inner:not(.ah-filters) .field { min-width: 0; max-width: none; }
  .filters-inner:not(.ah-filters) .control-row > .field:only-child,
  .filters-inner:not(.ah-filters) .chips { grid-column: 1 / -1; }
  /* Reset sits in the cell after the last field, not on a row of its own. */
  .filters-inner:not(.ah-filters) .filters-foot { order: 1; align-self: end; margin: 0; }
  .filters-inner:not(.ah-filters) .filters-foot .btn { height: 44px; min-height: 0; }
  .filters-inner:not(.ah-filters) .chips { order: 2; }
  .filters-inner:not(.ah-filters) .switch { order: 3; grid-column: 1 / -1; align-self: center; gap: 10px; }
  .filters-inner:not(.ah-filters) .switch + .switch { margin-top: -2px; }
  /* Tiers: the four on one line. */
  .filters .chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .filters .chips legend { float: left; width: 100%; margin-bottom: 6px; }
  .filters .chips label { margin: 0; flex: 1 1 auto; }
  .filters .chips span { display: block; padding-left: 6px; padding-right: 6px; text-align: center; font-size: 13px; }
  /* Number boxes the same height as the dropdowns beside them. */
  .filters .unit-in input { height: 44px; width: auto; flex: 1; min-width: 0; }
  .filters .tabs { display: flex; }
  .filters .tabs button { flex: 1; height: 44px; padding: 0 6px; white-space: nowrap; }
  .tab-more { display: none; }
  .filters .field > span:first-child { white-space: nowrap; }
}

/* ── Filters under the button on a mid-width window: everything flows in
   lines from the left, switches after the fields, Reset at the end of the
   last line instead of on a line of its own. ── */
@media (min-width: 761px) and (max-width: 1320px) {
  .filters-inner:not(.ah-filters) { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; }
  .filters-inner:not(.ah-filters) .control-row { display: contents; }
  .filters-inner:not(.ah-filters) .field { flex: 1 1 150px; max-width: 240px; min-width: 0; }
  .filters-inner:not(.ah-filters) .field.grow { flex: 2 1 160px; max-width: 340px; }
  .filters-inner:not(.ah-filters) .field:has(.tabs) { flex: 0 0 auto; max-width: none; }
  .filters-inner:not(.ah-filters) .field:has(.unit-in) { flex: 0 1 132px; }
  .filters-inner:not(.ah-filters) .field:has(#maxPrice) { flex: 0 1 230px; }
  .filters-inner:not(.ah-filters) .chips { flex: 0 0 auto; min-width: 0; margin: 0; }
  .filters-inner:not(.ah-filters) .chips label { margin-bottom: 0; }
  .filters-inner:not(.ah-filters) .switch { order: 2; flex: 0 0 auto; align-self: flex-end; min-height: 40px; gap: 10px; }
  .filters-inner:not(.ah-filters) .switch + .switch { margin-left: 8px; }
  .filters-inner:not(.ah-filters) .chips span { padding: 6px 10px; }
  .filters-inner:not(.ah-filters) .chips label { margin-right: 2px; }
  .filters-inner:not(.ah-filters) .filters-foot { order: 3; margin: 0 0 0 auto; align-self: flex-end; }
  .filters .tabs button { height: 40px; padding: 0 12px; white-space: nowrap; }
  .filters .unit-in input { width: auto; flex: 1; min-width: 0; }
  .filters .field > span:first-child { white-space: nowrap; }
}

/* ── Skinny screens: logo and a menu button; the rest slides in ── */
.nav-menu { display: contents; }
.nav-burger, .nav-menu-head, .nav-shade { display: none; }
@media (max-width: 760px) {
  html.menu-lock { overflow: hidden; }
  .nav .brand-text { display: inline; }
  .nav-burger { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; margin-left: auto; }
  .nav-burger .ico { width: 20px; height: 20px; }
  .nav-shade { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); animation: fade .18s ease both; }
  .nav-shade[hidden] { display: none; }
  .nav-menu {
    display: flex; flex-direction: column; gap: 8px;
    position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(300px, 86vw);
    padding: 12px 14px 18px; overflow-y: auto; overscroll-behavior: contain;
    background: #0c1018; border-left: 1px solid var(--line);
    box-shadow: -18px 0 48px rgba(0, 0, 0, .55);
    transform: translateX(105%); visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
  }
  .nav.menu-open .nav-menu { transform: none; visibility: visible; transition: transform .22s ease; }
  .nav-menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
  .nav-menu-head .nav-list { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; margin: 0; gap: 0; }

  /* The tools as a list with their full names. */
  .nav-menu nav { order: 2; flex-direction: column; gap: 2px; margin: 0; }
  .nav-menu nav a, .nav-menu nav a:not(.active) { display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 46px; font-size: 15.5px; border-radius: 9px; }
  .nav-menu nav a .long { display: inline; }
  .nav .nav-menu nav a .short, .nav .nav-menu nav a.active .short { display: none; }
  .nav-menu nav a .ico { width: 18px; height: 18px; }
  .nav-menu .nav-watch, .nav-menu #listBtn {
    order: 3; display: flex; justify-content: flex-start; gap: 12px; width: 100%; height: 46px; margin: 0; padding: 0 12px; font-size: 15.5px;
  }
  .nav-menu .nav-watch { margin-top: 8px; }
  .nav-menu .nav-list-text { display: inline; }
  .nav-menu .nav-list .nav-badge { margin-left: auto; }
  .nav-menu .nav-list .ico { width: 18px; height: 18px; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Crates on a slim screen: Cheapest Favor and Crates I Have are buttons
   beside the Filters button, and open below it. ── */
.side-btn { display: none; }
@media (max-width: 1320px) {
  .top-actions { display: flex; align-items: center; gap: 8px; }
  .side-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; min-height: 0; padding: 0 12px;
    font-size: 13.5px; font-weight: 600; white-space: nowrap;
  }
  .side-btn .sb-label { color: var(--muted); }
  .side-btn .sb-value { font-weight: 700; color: var(--text); }
  .side-btn .sb-value:empty { display: none; }
  .side-btn .sb-count { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 12px; text-align: center; }
  .side-btn .caret { font-size: 11px; color: var(--faint); transition: transform .2s ease; }
  .side-btn[aria-expanded="true"] { background: var(--select); border-color: var(--select-line); }
  .side-btn[aria-expanded="true"] .sb-label { color: var(--text); }
  .side-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }

  /* The panels themselves: hidden until their button is pressed. */
  .crate-side:not(:has(> .expanded)) { display: none; }
  .crate-side > .cheapest:not(.expanded), .crate-side > .owned:not(.expanded) { display: none; }
  .crate-side > .cheapest.expanded, .crate-side > .owned.expanded { padding: 4px 14px 6px; animation: rise .16s ease both; }
  .crate-side > .cheapest > h2, .crate-side > .owned > h2 { display: none; }
  .crate-side > .cheapest.expanded ol, .crate-side > .owned.expanded .owned-body { border-top: 0; }
}
@media (max-width: 760px) {
  /* The buttons take a line of their own, sharing it evenly; Filters stays at the end. */
  .top-row > .top-actions:has(.side-btn) { flex: 1 1 100%; order: 4; margin: 0; }
  .side-btn { flex: 1 1 0; min-width: 0; justify-content: center; height: 44px; padding: 0 8px; gap: 6px; }
  .side-btn .sb-label { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 420px) { .sb-more { display: none; } }

/* ── Crafting on a phone: ROI sits under the profit instead of in a column
   of its own, so nothing runs off the side. ── */
.roi-under { display: none; }
@media (max-width: 560px) {
  #recipes > thead > tr > th:nth-child(6), #recipes > tbody > tr > td:nth-child(6) { display: none; }
  #recipes .roi-under { display: block; margin-top: 3px; }
  #recipes .roi-under .roi { display: inline-block; min-width: 0; width: auto; font-size: 11.5px; padding: 1px 6px; }
}

/* A hidden star cannot be pressed by accident on a touch screen. */
@media (hover: none) {
  tr.row .star-btn:not(.on) { pointer-events: none; }
  tr.row:hover .star-btn, tr.row.open .star-btn { pointer-events: auto; }
}

/* ── Crafting dropdown: the Market box, first and compact ─────── */
.market-card { margin-top: 12px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; }
.mc-head > h4 { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.mc-head .d-links { font-size: 13px; }
.mc-head .d-links a { color: var(--link); text-decoration: none; }
.mc-head .d-links a:hover { text-decoration: underline; }
.mc-stats { display: grid; grid-template-columns: minmax(120px, 1fr) 96px 96px minmax(0, 2.2fr); gap: 8px 20px; margin: 0; }
.mc-stats > div { min-width: 0; }
.mc-stats dt { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; white-space: nowrap; }
.mc-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.mc-stats .mc-trend dd { font-weight: 400; }
.detail-wrap > .trend-slot { margin-top: 12px; }
.detail-wrap > .market-card + .detail-body { margin-top: 12px; }
@media (max-width: 760px) {
  .mc-stats { grid-template-columns: 1.5fr 1fr 1fr; gap: 8px 12px; }
  .mc-stats .mc-trend { grid-column: 1 / -1; }
  /* The note under Totals keeps no empty room when it has nothing to say. */
  .sim-notes { min-height: 0; }
  .sim-notes:empty { display: none; }
  /* Filter switches two by two. */
  .filters-inner:not(.ah-filters) .switch { grid-column: auto; gap: 8px; min-width: 0; font-size: 13.5px; }
  .filters-inner:not(.ah-filters) .switch + .switch { margin-top: 0; }
  .filters-inner:not(.ah-filters) .switch .track { flex: none; }
  .filters-inner:not(.ah-filters) .switch .info { margin-left: 4px; }
  .filters-inner:not(.ah-filters) .switch-text strong { white-space: nowrap; }
}

/* ── Slider and price controls: compact on slim screens, so the numbers
   they change stay in view. One line for the amount, one for the price. ── */
.detail-wrap > .market-card { margin-top: 10px; }
.detail-wrap > .market-card + .sim { padding-top: 12px; }
@media (max-width: 760px) {
  .sim { gap: 8px 10px; padding: 8px 0 10px; }
  .sim > label { order: 0; }
  .sim .sim-num { order: 1; width: 64px; height: 38px; flex: none; }
  .sim .sim-range { order: 2; flex: 1 1 90px; max-width: none; min-width: 0; }
  .sim .sim-day { order: 3; flex: none; white-space: nowrap; }
  .sim .sim-price { order: 4; flex: 0 1 auto; flex-wrap: nowrap; gap: 6px; min-width: 0; }
  .sim .add-list { order: 5; flex: 1 1 auto; margin-left: auto; min-height: 38px; height: 38px; justify-content: center; }
  .sim .coin-boxes { gap: 4px; }
  .sim .coin-box.g .coin-in { width: 50px; }
  .sim .coin-box .coin-in { width: 30px; }
  /* A break after the amount line, so the price and the button share the next one. */
  .sim:not(:has(.sim-price)) .add-list { flex: 0 0 auto; }
  .sim:has(.sim-price)::after { content: ""; order: 3; flex-basis: 100%; height: 0; margin: -4px 0; }
}

/* Market box without the trend line: three figures in a row, everywhere. */
.mc-stats { grid-template-columns: minmax(120px, auto) auto auto; justify-content: start; gap: 8px 36px; }
@media (max-width: 760px) { .mc-stats { grid-template-columns: 1.5fr 1fr 1fr; justify-content: stretch; gap: 8px 12px; } }

/* Number boxes in the filters: room for three digits at any width. */
.filters .range input { padding-left: 9px; padding-right: 6px; min-width: 50px; }
.filters .range { gap: 6px; }
@media (min-width: 761px) and (max-width: 1320px) {
  .filters-inner:not(.ah-filters) .field:has(#skillMin) { flex: 1 1 170px; min-width: 150px; }
}
/* No up/down arrows inside them: they take the room the digits need. */
.filters .range input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.filters .range input[type="number"]::-webkit-outer-spin-button, .filters .range input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Deals filters: each number in one box with its unit inside ── */
.row-break { display: none; }
.num-pair { display: flex; align-items: center; gap: 8px; }
.num-to { color: var(--muted); flex: none; }
.num-box {
  display: flex; align-items: center; flex: 1; min-width: 0; height: 40px; box-sizing: border-box;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding-right: 10px;
}
.num-box:focus-within { outline: 2px solid var(--link); outline-offset: 1px; }
.filters .field .num-box input {
  flex: 1; min-width: 0; width: 100%; height: 100%; padding: 0 6px 0 11px;
  background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-weight: 500; text-align: left;
  -moz-appearance: textfield; appearance: textfield;
}
.num-box input::-webkit-outer-spin-button, .num-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-box > i { flex: none; font-style: normal; font-weight: 700; font-size: 13px; color: var(--faint); text-transform: none; letter-spacing: 0; }
.num-box > i.g { color: var(--gold); }
@media (min-width: 761px) and (max-width: 1320px) {
  /* Second line: the four "only show" limits, then Reset. */
  .filters-inner:not(.ah-filters) .row-break { display: block; flex-basis: 100%; height: 0; margin: -6px 0; }
  .filters-inner:not(.ah-filters) .field.num-field { flex: 0 1 170px; }
  .filters-inner:not(.ah-filters) .field.num-range { flex: 0 1 250px; max-width: 280px; }
}
@media (max-width: 760px) {
  .num-box { height: 44px; }
  .filters .field .num-box input { font-size: 16px; }
  .num-pair { gap: 6px; }
}
/* A number box directly inside a label is not label text. */
.filters .field > .num-box {
  display: flex; margin: 0; color: var(--text);
  font-size: inherit; font-weight: inherit; letter-spacing: 0; text-transform: none;
}
@media (max-width: 760px) {
  /* The buyout range gets the full width, so both boxes have room. */
  .filters-inner:not(.ah-filters) .field.num-range { grid-column: 1 / -1; }
}

/* ══ Makeover: blue accent, cooler surfaces, new logo ══════════════
   Gold stays for what is gold: coins, starred items, price alerts. */
:root {
  --bg: #0a0d13; --bg-2: #0f131b; --panel: #131822; --panel-2: #19202c;
  --line: #273041; --line-soft: #1c2331;
  --accent: #4f9cff; --accent-ink: #04101f;
  --select: #1f2a3d; --select-line: #35507a; --link: #7db5ff; --on: #3b82f6;
  --radius: 12px;
  --display: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
body { background: radial-gradient(1100px 460px at 50% -180px, rgba(79, 156, 255, .09), transparent 70%) no-repeat, var(--bg); }

/* Logo and name */
.brand { font: 700 18px/1 var(--display); letter-spacing: -.01em; gap: 10px; }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; box-shadow: 0 4px 14px rgba(37, 99, 235, .4); }
.brand .brand-text > span, .brand-text > span { color: var(--accent); }
.nav { border-bottom-color: #18202e; }
.nav nav a.active { background: rgba(79, 156, 255, .14); color: #d6e7ff; }
.nav nav a.active .ico { color: var(--accent); opacity: 1; }

/* Headings in the same clean face as the logo */
h1, .tool-card h2, .home-name { font-family: var(--display); letter-spacing: -.01em; }
.home-name { font-weight: 700; font-size: 19px; }

/* Controls pick up the blue */
.star-btn.on { color: var(--gold); }
.tabs button[aria-pressed="true"], .chips input:checked + span { border-color: var(--select-line); color: #e3eeff; }
.side-btn[aria-expanded="true"], .filter-btn[aria-expanded="true"] { border-color: var(--select-line); }
thead button[aria-sort]::after { color: var(--accent); }
.badge { background: var(--accent); color: var(--accent-ink); }
.side-btn .sb-count { background: var(--accent); color: var(--accent-ink); }
.medal { background: rgba(79, 156, 255, .16); color: #d6e7ff; box-shadow: inset 0 0 0 1px rgba(79, 156, 255, .4); }
tbody tr.row.open { background: rgba(79, 156, 255, .06); }
.load-bar i { background: var(--accent); }

/* Home */
.hero { padding-top: 60px; }
.hero::before { background: radial-gradient(560px 240px at 50% 0, rgba(79, 156, 255, .2), transparent 70%); }
.hero-mark { width: 62px; height: 62px; border-radius: 17px; filter: drop-shadow(0 12px 28px rgba(37, 99, 235, .5)); }
.hero h1 { font-weight: 800; letter-spacing: -.025em; }
.hero h1 span { background: linear-gradient(120deg, #7db5ff, #3b82f6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-search { border-radius: 14px; }
.hero-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 156, 255, .18); }
.hero-search .btn { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 700; }
.hero-search .btn:hover { background: #6aaeff; border-color: transparent; }
.home-card { border-radius: 16px; background: linear-gradient(180deg, #151b27, var(--panel)); }
.home-card:hover { border-color: rgba(79, 156, 255, .55); background: linear-gradient(180deg, #18202f, #141a25); box-shadow: 0 16px 34px rgba(0, 0, 0, .4), 0 0 0 1px rgba(79, 156, 255, .12); }
.home-ico { border-radius: 13px; }

/* Home: the glow behind the logo belongs to the whole page, so it has no edges. */
.hero::before { display: none; }
body.home { background: radial-gradient(min(900px, 140vw) 420px at 50% 40px, rgba(79, 156, 255, .2), transparent 70%) no-repeat, var(--bg); }

/* Logo: a slanted F and T, drawn straight onto the dark header (no tile behind it). */
.brand-mark { width: 32px; height: 24px; border-radius: 0; box-shadow: none; filter: drop-shadow(0 3px 8px rgba(47, 107, 240, .45)); }
.hero-mark { width: 96px; height: 73px; border-radius: 0; filter: drop-shadow(0 12px 26px rgba(47, 107, 240, .55)); }
.brand-mark { width: 33px; height: 24px; }
.hero-mark { width: 104px; height: 76px; }
/* Header: the logo alone, a little larger now that the name is not beside it. */
.brand-mark { width: 42px; height: 30px; }
.hero-mark { width: 118px; height: 84px; }
.hero h1 { margin-top: 20px; }
.hero-search { margin-top: 28px; }
.brand-mark { width: 54px; height: 29px; filter: drop-shadow(0 3px 8px rgba(31, 95, 224, .5)); }
.hero-mark { width: 168px; height: 90px; }
.brand-mark { width: 64px; height: 29px; }
.hero-mark { width: 206px; height: 94px; }
.brand-mark { width: 54px; height: 29px; }
.hero-mark { width: 170px; height: 92px; }
.brand-mark { width: 38px; height: 30px; }
.hero-mark { width: 120px; height: 96px; }
.brand-mark { width: 35px; height: 30px; filter: none; }
.hero-mark { width: 116px; height: 100px; filter: drop-shadow(0 12px 26px rgba(47, 107, 240, .4)); }
.brand-mark { width: 40px; height: 30px; }
.hero-mark { width: 132px; height: 100px; }
.brand-mark { width: 44px; height: 30px; }
.hero-mark { width: 148px; height: 100px; }
.brand-mark { width: 43px; height: 30px; }
.hero-mark { width: 143px; height: 100px; }

/* The home title's blue word moves with the same slow gradient as the logo. */
.hero h1 span { background: linear-gradient(110deg, #2f7cf6, #7cc0ff, #2f7cf6, #7cc0ff, #2f7cf6); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ft-sheen 4s linear infinite; }
@keyframes ft-sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .hero h1 span { animation: none; } }
a.btn { text-decoration: none; }

/* ── Crafting: profit per day, score and sale rate ────────────── */
.rate, .score { font-variant-numeric: tabular-nums; font-weight: 600; }
.rate.hi { color: #7fd6a2; }
.rate.mid { color: var(--text); }
.rate.lo, .score.neg { color: var(--muted); }
#recipes thead th .info { margin-left: 4px; }
.mc-stats { grid-template-columns: repeat(auto-fit, minmax(104px, auto)); justify-content: start; }
.mc-stats dt { display: flex; align-items: center; }
/* Twelve columns, Vendor the 7th. They drop off as the table gets narrower,
   least needed first: Sale rate (12), Profit score (11), Score (10),
   Profit / day (9), Sold / day (8), then Materials (3), Skill (2) and
   Sells for (4). The widths are what the largest numbers need (the page of
   most profitable crafts), so the table does not scroll sideways.
   Under 1321px the table has the whole window. */
@media (max-width: 1320px) {
  #recipes > thead > tr > th:nth-child(11), #recipes > tbody > tr > td:nth-child(11),
  #recipes > thead > tr > th:nth-child(12), #recipes > tbody > tr > td:nth-child(12),
  #recipes > thead > tr > th:nth-child(13), #recipes > tbody > tr > td:nth-child(13) { display: none; }
}
@media (max-width: 1279px) {
  #recipes > thead > tr > th:nth-child(10), #recipes > tbody > tr > td:nth-child(10) { display: none; }
}
@media (max-width: 1149px) {
  #recipes > thead > tr > th:nth-child(9), #recipes > tbody > tr > td:nth-child(9),
  #recipes > thead > tr > th:nth-child(8), #recipes > tbody > tr > td:nth-child(8) { display: none; }
}
@media (min-width: 761px) and (max-width: 1048px) {
  #recipes > thead > tr > th:nth-child(3), #recipes > tbody > tr > td:nth-child(3) { display: none; }
}
@media (min-width: 761px) and (max-width: 924px) {
  #recipes > thead > tr > th:nth-child(2), #recipes > tbody > tr > td:nth-child(2) { display: none; }
}
@media (min-width: 761px) and (max-width: 859px) {
  #recipes > thead > tr > th:nth-child(4), #recipes > tbody > tr > td:nth-child(4) { display: none; }
}
/* From 1321px the column on the left takes 350px of it, and past 1680px the
   page stops growing unless it is stretched (body.stretch). */
@media (min-width: 1321px) and (max-width: 1360px) {
  #recipes > thead > tr > th:nth-child(2), #recipes > tbody > tr > td:nth-child(2) { display: none; }
}
@media (min-width: 1321px) and (max-width: 1459px) {
  #recipes > thead > tr > th:nth-child(9), #recipes > tbody > tr > td:nth-child(9),
  #recipes > thead > tr > th:nth-child(8), #recipes > tbody > tr > td:nth-child(8) { display: none; }
}
@media (min-width: 1321px) and (max-width: 1589px) {
  #recipes > thead > tr > th:nth-child(10), #recipes > tbody > tr > td:nth-child(10) { display: none; }
}
@media (min-width: 1321px) and (max-width: 1649px) {
  #recipes > thead > tr > th:nth-child(11), #recipes > tbody > tr > td:nth-child(11) { display: none; }
}
@media (min-width: 1321px) and (max-width: 1689px) {
  #recipes > thead > tr > th:nth-child(12), #recipes > tbody > tr > td:nth-child(12) { display: none; }
}
@media (min-width: 1321px) and (max-width: 1789px) {
  #recipes > thead > tr > th:nth-child(13), #recipes > tbody > tr > td:nth-child(13) { display: none; }
}
@media (min-width: 1790px) {
  body:not(.stretch) #recipes > thead > tr > th:nth-child(13), body:not(.stretch) #recipes > tbody > tr > td:nth-child(13) { display: none; }
}
@media (max-width: 760px) { .mc-stats { grid-template-columns: 1.3fr 1fr 1fr; } }
#recipes thead th { white-space: nowrap; }
/* With ten or more columns showing, less side padding keeps names on one line. */
@media (min-width: 1650px) {
  #recipes > thead > tr > th, #recipes > tbody > tr.row > td { padding-left: 9px; padding-right: 9px; }
}
@media (min-width: 1690px) {
  #recipes > thead > tr > th, #recipes > tbody > tr.row > td { padding-left: 8px; padding-right: 8px; }
}

/* ── Item page left panel: sections under small headings ──────── */
.tile-head {
  grid-column: 1 / -1; margin: 0; padding: 14px 0 5px;
  color: var(--link); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.tile-head:first-child { padding-top: 8px; }
.item-main .tile { padding: 8px 0; }
.item-main .tile:has(+ .tile-head) { border-bottom: 0; }
.item-main .tiles { padding-bottom: 8px; }
.tile dd.craft-profit.gain { color: #7fd6a2; }
.tile dd.craft-profit.loss { color: #f08a8a; }
.item-main .tile dt { white-space: nowrap; flex-wrap: nowrap; }
/* The label takes the room it needs; the value gets the rest and wraps inside it. */
.item-main .tile { grid-template-columns: auto minmax(0, 1fr); }
.item-main .tile dd { min-width: 0; }
.item-main .tile dd .trend-text { display: inline; }

/* ── Column chooser: a button beside Filters and its tick list ── */
.top-actions { display: flex; align-items: center; gap: 8px; }
.cols-btn[aria-expanded="true"] { background: var(--select); border-color: var(--select-line); color: var(--text); }
.cols-pop {
  position: fixed; z-index: 110; min-width: 190px; max-width: calc(100vw - 16px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--select-line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6); padding: 10px 6px 6px;
  animation: rise .12s ease both;
}
.cp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 0 8px 6px; }
.cp-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.cp-row:hover { background: var(--select); }
.cp-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.cp-row.fixed { color: var(--faint); cursor: default; }
.cp-row.fixed:hover { background: none; }
.cp-row.fixed input { cursor: default; }
@media (max-width: 760px) { .cp-row { padding: 9px 8px; font-size: 15px; } }
/* The column list is a set of controls, not text to select. */
.cols-pop, .cols-pop * { user-select: none; -webkit-user-select: none; }

/* ── Writ calculator ──────────────────────────────────────────── */
.writ-rep { font-weight: 700; font-variant-numeric: tabular-nums; }
.writ-rep.t1 { color: #8fd0ff; }
.writ-rep.t2 { color: #c9a6ff; }
.writ-need { font-weight: 600; white-space: nowrap; }
.writ-npc { font-weight: 600; }
#writs td .avail a { color: inherit; }
#writs .crate-meta { white-space: nowrap; }
@media (max-width: 900px) {
  #writs > thead > tr > th:nth-child(4), #writs > tbody > tr.row > td:nth-child(4),
  #writs > thead > tr > th:nth-child(5), #writs > tbody > tr.row > td:nth-child(5) { display: none; }
}
@media (max-width: 760px) {
  #writs > thead > tr > th:nth-child(1), #writs > tbody > tr.row > td:nth-child(1),
  #writs > thead > tr > th:nth-child(3), #writs > tbody > tr.row > td:nth-child(3),
  #writs > thead > tr > th:nth-child(7), #writs > tbody > tr.row > td:nth-child(7) { display: none; }
  #writs .crate-meta { white-space: normal; }
}

/* ── Writ calculator: the opened order ────────────────────────── */
.writ-detail { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.writ-req { display: grid; gap: 6px; margin: 0 0 10px; }
.writ-req .mat b { font-weight: 700; margin-right: 2px; }
#writs tr.row { cursor: pointer; }
@media (max-width: 760px) {
  .nav:not(.menu-ready) .nav-menu { transition: none; }
}

/* ── Writ calculator: reputation goal ─────────────────────────── */
.goal-row { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; color: var(--muted); font-size: 13px; }
.goal-row input {
  flex: 1; min-width: 0; height: 38px; padding: 0 10px; box-sizing: border-box;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font: inherit; font-weight: 600; -moz-appearance: textfield; appearance: textfield;
}
.goal-row input::-webkit-outer-spin-button, .goal-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.goal-row input:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.goal-sums { margin: 0 0 6px; }
.goal-sums div { padding: 5px 0; font-size: 14px; }
.goal-sums .total { font-size: 16px; padding: 6px 0; margin: 0; border-top: 0; }
.goal-list { margin-top: 8px; max-height: 320px; overflow-y: auto; scrollbar-width: thin; }
.goal-list li { padding: 6px 0; }
.goal-list .tc-day { font-size: 13px; }
tr.in-plan > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.plan-tag { color: var(--link); font-weight: 600; }
@media (max-width: 760px) { .goal-row input { font-size: 16px; height: 44px; } }

/* ── Writ calculator: turn-in location chips ──────────────────── */
.zone-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.zone-chips legend { float: left; width: 100%; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.zone-chips label { margin: 0; }
.zone-chips span i { font-style: normal; font-weight: 500; color: var(--faint); margin-left: 3px; }
.zone-picks { display: inline-flex; gap: 10px; text-transform: none; letter-spacing: 0; }
.zone-picks .link-btn { font-size: 12.5px; }
@media (min-width: 761px) and (max-width: 1320px) {
  .filters-inner:not(.ah-filters) .zone-chips { flex: 1 1 100%; }
}
/* All / Known / None are plain links, not chips. */
.chips .zone-picks { display: inline-flex; gap: 12px; padding: 0; border: 0; border-radius: 0; background: none; cursor: default; }
/* Twenty-odd locations: smaller chips so the list stays short. */
.zone-chips { gap: 5px; }
.zone-chips label > span { padding: 4px 9px; font-size: 12.5px; }

/* ── Writ calculator: the location dropdown ───────────────────── */
.zone-dd { display: block; }
.zone-dd .dd-btn { width: 100%; justify-content: space-between; min-height: 40px; font-size: 14px; }
.zone-dd .dd-cur { flex: 1; min-width: 0; }
.zone-dd .dd-cur span { overflow: hidden; text-overflow: ellipsis; text-align: left; white-space: nowrap; }
.zone-dd .dd-btn > span:last-child { display: inline-flex; }
.zone-dd .dd-btn > span:last-child .ico { width: 14px; height: 14px; color: var(--muted); transition: transform .15s ease; }
.zone-dd .dd-btn[aria-expanded="true"] > span:last-child .ico { transform: rotate(180deg); }
.zone-pop { display: flex; flex-direction: column; padding: 8px 6px 6px; overflow: hidden; }
.zp-top { flex: none; padding: 0 4px 6px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.zp-search {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; color: var(--faint);
}
.zp-search:focus-within { border-color: var(--select-line); color: var(--text); }
.zp-search .ico { width: 14px; height: 14px; flex: none; }
.zp-search input { flex: 1; min-width: 0; height: 100%; padding: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 14px; user-select: text; -webkit-user-select: text; }
.zp-search input::-webkit-search-cancel-button { display: none; }
.zp-picks { display: flex; gap: 14px; padding: 7px 4px 0; }
.zp-picks .link-btn { font-size: 12.5px; }
.zp-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.zp-list .cp-row[hidden] { display: none; }
.zp-list .cp-row span { flex: 1; min-width: 0; }
.zp-list .cp-row i { font-style: normal; color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.zp-none { margin: 0; padding: 10px 8px; color: var(--muted); font-size: 13.5px; }
@media (max-width: 760px) { .zp-search { height: 42px; } .zp-search input { font-size: 16px; } .zone-dd .dd-btn { min-height: 44px; } }
/* Reputation goal: title on the left, reset on the right. */
.goal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.goal-head .side-title { margin: 0; }
.goal-reset { flex: none; }
.goal-reset:disabled { visibility: visible; opacity: .35; cursor: default; }
.goal-reset:disabled:hover { color: var(--muted); border-color: transparent; }

/* ── Auction House: search first in the filters, like the other tools ── */
.ah-filters > .ah-search { grid-column: 1 / -1; max-width: none; min-width: 0; }
.ah-filters > .ah-search input { width: 100%; }

/* ══ Phones and touch screens ══════════════════════════════════ */

/* Copy and star belong to an opened row. On a closed one they are neither
   shown nor pressable, so a tap meant to open the row cannot land on them.
   Rows that do not open (Deals, Watchlist) keep them. */
@media (hover: none) {
  tr.row:not(.plain):not(.open) .copy-btn,
  tr.row:not(.plain):not(.open) .star-btn { opacity: 0 !important; pointer-events: none !important; }
  tr.row.open .copy-btn, tr.row.open .star-btn,
  tr.row.plain .copy-btn, tr.row.plain .star-btn { opacity: 1; pointer-events: auto; }
  /* A tap on the icon opens the row too, rather than leaving the page. */
  tr.row:not(.plain):not(.open) .icon-link { pointer-events: none; }
}

/* A table with more columns than fit: say so, and fade the edge it runs past. */
.swipe-hint {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0; padding: 7px 10px; border-bottom: 1px solid var(--line-soft);
  color: var(--link); font-size: 12.5px; font-weight: 600; background: rgba(79, 156, 255, .07);
}
.swipe-hint[hidden] { display: none; }
.swipe-hint .ico { width: 14px; height: 14px; opacity: .45; }
.table-panel { position: relative; }
.table-panel.more-right .swipe-hint .ico:last-child,
.table-panel.more-left .swipe-hint .ico:first-child { opacity: 1; }
.table-panel::after, .table-panel::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 26px; z-index: 3; pointer-events: none;
  opacity: 0; transition: opacity .15s ease;
}
.table-panel::after { right: 0; background: linear-gradient(to left, rgba(8, 11, 17, .85), transparent); }
.table-panel::before { left: 0; background: linear-gradient(to right, rgba(8, 11, 17, .85), transparent); }
.table-panel.more-right::after, .table-panel.more-left::before { opacity: 1; }

@media (max-width: 760px) {
  /* An opened row keeps the width of the screen and stays put while the
     table underneath is swiped. */
  .table-scroll tr.detail > td { padding-left: 10px; padding-right: 10px; }
  .table-scroll .detail-wrap {
    position: sticky; left: 10px; box-sizing: border-box;
    width: calc(var(--scroll-w, 100vw) - 20px); max-width: calc(var(--scroll-w, 100vw) - 20px);
    overflow-x: hidden;
  }
  /* With columns chosen by hand the table may be wider than the screen. */
  .table-scroll > table.cols-custom th, .table-scroll > table.cols-custom td { white-space: nowrap; }
  .table-scroll > table.cols-custom td .row-text, .table-scroll > table.cols-custom td .crate-meta { white-space: normal; }
  #recipes.cols-custom .roi-under { display: none; }
}

/* ── Writ calculator: show the customer on the zone map ───────── */
.turn-in { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.map-btn {
  flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: 8px; color: var(--muted); cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.map-btn .ico { width: 16px; height: 16px; }
.map-btn:hover { background: var(--select); border-color: var(--select-line); color: var(--link); }
.map-line { margin: 10px 0 0; }
.map-line .btn .ico { width: 15px; height: 15px; }
.map-shade {
  position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 12px;
  background: rgba(0, 0, 0, .66); animation: fade .15s ease both;
}
.map-card {
  width: min(900px, 100%); max-height: 100%; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--select-line); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .7); overflow: hidden;
}
.map-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.map-title { display: grid; gap: 1px; min-width: 0; }
.map-title b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-title > span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.map-view { position: relative; background: #05070a; min-height: 120px; overflow: hidden; line-height: 0; }
.map-view img { display: block; width: 100%; height: auto; user-select: none; }
.map-none { margin: 0; padding: 44px 16px; text-align: center; color: var(--muted); line-height: 1.5; }
.map-dot { position: absolute; width: 0; height: 0; line-height: 1; }
.map-dot i {
  position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); border: 2px solid #10131a; box-shadow: 0 0 0 2px rgba(245, 197, 66, .55), 0 2px 8px rgba(0, 0, 0, .7);
  animation: map-pulse 1.8s ease-out infinite;
}
.map-dot b {
  position: absolute; left: 14px; top: -11px; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
  background: rgba(10, 13, 19, .9); border: 1px solid var(--select-line); color: var(--text); font-size: 12.5px; font-weight: 700;
}
.map-dot[style*="left:6"] b, .map-dot[style*="left:7"] b, .map-dot[style*="left:8"] b, .map-dot[style*="left:9"] b { left: auto; right: 14px; }
@keyframes map-pulse {
  0% { box-shadow: 0 0 0 2px rgba(245, 197, 66, .6), 0 2px 8px rgba(0, 0, 0, .7); }
  100% { box-shadow: 0 0 0 16px rgba(245, 197, 66, 0), 0 2px 8px rgba(0, 0, 0, .7); }
}
.map-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; font-size: 13px; }
.map-note { color: var(--muted); }
.map-foot .d-links a, .map-foot .d-links .link-btn { display: inline-flex; align-items: center; gap: 5px; color: var(--link); text-decoration: none; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .map-dot i { animation: none; } }
@media (hover: none) { tr.row:not(.open) .map-btn { opacity: 0; pointer-events: none; } }

/* ── Menu button: three slanted bars, no box; they fold into a cross when open ── */
@media (max-width: 760px) {
  .nav-burger, .nav-burger:hover {
    background: none; border: 0; border-radius: 10px; box-shadow: none;
    width: 44px; height: 44px; padding: 0; margin-left: auto;
  }
  .nav-burger:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
  .burger { position: relative; display: block; width: 26px; height: 18px; transform: skewX(-14deg); }
  .burger i {
    position: absolute; right: 0; height: 3px; border-radius: 1px; background: var(--text);
    transition: transform .22s ease, width .22s ease, top .22s ease, opacity .15s ease, background .15s ease;
  }
  .burger i:nth-child(1) { top: 0; width: 26px; background: var(--accent); }
  .burger i:nth-child(2) { top: 7.5px; width: 19px; }
  .burger i:nth-child(3) { top: 15px; width: 12px; }
  .nav-burger:hover .burger i, .nav-burger:active .burger i { width: 26px; }
  .nav.menu-open .burger { transform: none; }
  .nav.menu-open .burger i { width: 26px; top: 7.5px; background: var(--text); }
  .nav.menu-open .burger i:nth-child(1) { transform: rotate(45deg); }
  .nav.menu-open .burger i:nth-child(2) { opacity: 0; }
  .nav.menu-open .burger i:nth-child(3) { transform: rotate(-45deg); }
}
@media (prefers-reduced-motion: reduce) { .burger i { transition: none; } }

/* ══ Your own material prices (Crafting Profit) ════════════════ */
.mats-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mats-head h4 { margin-bottom: 0; }
.mats-head .mat-reset[hidden] { display: inline-flex; visibility: hidden; }
.mat-edit {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 22px; height: 22px; margin: -4px -4px -4px 3px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--muted); cursor: pointer; transition: color .12s ease, background .12s ease;
}
.mat-edit .ico { width: 12px; height: 12px; }
.mat-edit:hover { color: var(--link); background: rgba(79, 156, 255, .12); }
.mat-edit.on { color: var(--link); background: rgba(79, 156, 255, .18); }
.mats td.mat-cell { padding-top: 2px; padding-bottom: 2px; }
.mat-in {
  width: 100%; box-sizing: border-box; height: 26px; padding: 0 7px; text-align: right;
  font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text);
  background: var(--field, rgba(255, 255, 255, .04)); border: 1px solid var(--line); border-radius: 7px; outline: none;
}
.mat-in::placeholder { color: var(--muted); opacity: .75; }
.mat-in:focus { border-color: var(--link); }
.mat-in.own { border-color: var(--link); }

/* ══ Item page: one graph with a switch for which price it shows ═ */
.graph-card .chart-head { padding-top: 0; }
.graph-card .graph-kinds { margin-left: auto; }

/* ══ Rows worked out from prices typed in by hand ══════════════ */
.tag.yours {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  color: var(--link); background: rgba(79, 156, 255, .14); font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: middle;
}
.tag.yours[hidden] { display: none; }
.tag.yours .ico { width: 10px; height: 10px; }
tr.row.yours > td:first-child { box-shadow: inset 3px 0 0 var(--link); }
td.edited .money { text-decoration: none; }
td.edited { background: rgba(79, 156, 255, .08); }

/* The tag is a button that always reads "Reset", on a phone too. */
button.tag.yours { border: 0; font-family: inherit; line-height: inherit; cursor: pointer; transition: background .12s ease, color .12s ease; }
button.tag.yours[hidden] { display: none; }
@media (hover: hover) {
  button.tag.yours:hover, button.tag.yours:focus-visible { background: rgba(79, 156, 255, .28); color: #fff; }
}

/* ══ Writ Calculator on a slim window: Reputation goal and Cheapest
   reputation are buttons beside Filters, and open above the table. ══ */
@media (max-width: 1320px) {
  .writ-side { order: -1; }
  .writ-side:not(:has(> .expanded)) { display: none; }
  .writ-side > .rank-panel:not(.expanded) { display: none; }
  .writ-side > .rank-panel.expanded { animation: rise .16s ease both; }
}

/* ══ Coins: the g / s / c letters are drawn as small gold, silver and copper
   coins. The letter stays in the page (copying a price still gives "1g 5s"),
   it is only hidden behind the coin. ══════════════════════════════ */
.coin i, .coin-box i, .num-box > i.g {
  display: inline-block; flex: none; width: .74em; height: .74em; margin-left: 2px; border-radius: 50%;
  font-size: 1em; color: transparent !important; opacity: 1 !important; overflow: hidden; white-space: nowrap; text-indent: -9em;
  vertical-align: -.04em; user-select: text;
  background: radial-gradient(circle at 34% 30%, var(--coin-hi) 0 18%, var(--coin) 52%, var(--coin-lo) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28), inset 0 -1px 1px rgba(0, 0, 0, .2);
}
.coin.g i, .coin-box.g i, .num-box > i.g { --coin-hi: #fff1b0; --coin: #f5c542; --coin-lo: #a8780c; }
.coin.s i, .coin-box.s i { --coin-hi: #ffffff; --coin: #c9ced4; --coin-lo: #7a828c; }
.coin.c i, .coin-box.c i { --coin-hi: #f6c4a0; --coin: #d58c58; --coin-lo: #8a4a20; }
.coin-box i, .num-box > i.g { width: 12px; height: 12px; font-size: 13px; vertical-align: middle; }

/* ══ Items that are not listed right now: the price they last had ══ */
.last-seen { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.last-seen .money { color: var(--text); }
tr.row.unlisted .item-name { opacity: .8; }
.tile small .last-seen, .tile small .money { white-space: nowrap; }

/* ══ Alerts: the bell in the header, its notifications, and "Alert when…" ══ */
.nav-bell { margin-left: 0; }
.nav-watch + .nav-bell, .nav-bell + .nav-list { margin-left: 0; }
.nav-bell .nav-list-text { display: none; }
.nav-bell { padding: 0 11px; }
.nav-bell .nav-badge { position: absolute; top: -6px; right: -6px; margin: 0; box-shadow: 0 0 0 2px #080b11; }
.nav-bell { position: relative; }
.note-panel {
  position: absolute; top: calc(100% + 8px); right: 20px; z-index: 30;
  width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 76px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .6); padding: 12px 14px 10px; animation: rise .18s ease both;
}
.note-panel[hidden] { display: none; }
.np-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.np-list { list-style: none; margin: 0; padding: 0; }
.np-list li { border-bottom: 1px solid var(--line-soft); }
.np-list li:last-child { border-bottom: 0; }
.np-list a { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px; margin: 0 -8px; border-radius: 9px; color: var(--text); text-decoration: none; }
.np-list a:hover { background: var(--select); }
.np-list li.new a { box-shadow: inset 3px 0 0 var(--gold); background: rgba(240, 193, 75, .06); }
.np-main { display: grid; gap: 2px; min-width: 0; }
.np-main .item-name { font-weight: 600; }
.np-text { font-size: 13px; color: var(--text); }
.np-when { font-size: 11.5px; color: var(--muted); }
.np-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 9px; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.np-foot .link-btn { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.np-foot .link-btn .ico { width: 13px; height: 13px; }
.np-pop { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; user-select: none; }
.np-pop input { accent-color: var(--link); margin: 0; }
.note-panel .lp-empty .ico { width: 26px; height: 26px; color: var(--faint); margin-bottom: 4px; }
@media (max-width: 760px) {
  .note-panel { right: 12px; left: 12px; width: auto; max-height: calc(100vh - 64px); }
  .nav-menu .nav-bell {
    order: 3; display: flex; justify-content: flex-start; gap: 12px; width: 100%; height: 46px; margin: 0; padding: 0 12px; font-size: 15.5px;
  }
  .nav-menu .nav-bell .nav-list-text { display: inline; }
  .nav-menu .nav-bell .nav-badge { position: static; margin-left: auto; box-shadow: none; }
}

/* The button on an item. */
.alert-btn .al-when { font-weight: 600; }
.alert-btn:not(.set) { border-color: var(--line); color: var(--muted); }
.alert-btn .al-line > i { margin-right: 1px; }
@media (max-width: 760px) { #watch .alert-btn .al-when { display: none; } }

/* The rules panel. */
.rules-pop { width: 316px; }
.ar-list { display: grid; gap: 10px; margin-bottom: 8px; }
.ar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 6px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.ar-type {
  width: 100%; height: 34px; padding: 0 8px; font: inherit; font-size: 13.5px; color: var(--text);
  background: var(--bg, #0d1118); border: 1px solid var(--line); border-radius: 8px;
}
.ar-type:focus { outline: 2px solid var(--link); outline-offset: 1px; }
.ar-del { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; background: none; border: 0; border-radius: 7px; color: var(--faint); cursor: pointer; }
.ar-del:hover { background: var(--select); color: var(--text); }
.ar-del .ico { width: 14px; height: 14px; }
.ar-value { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 0; }
.ar-value:empty { display: none; }
.ar-num { display: inline-flex; align-items: center; height: 34px; width: 96px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg, #0d1118); }
.ar-num input { width: 100%; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: right; outline: none; -moz-appearance: textfield; }
.ar-hint { font-size: 12px; color: var(--muted); }
.ar-add { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.ar-add .ico { width: 13px; height: 13px; }
.ar-note { margin: 8px 0 10px; font-size: 12px; color: var(--muted); }
/* "Email me too", and how many of the few are left. */
.ar-mail { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; margin: 0 0 12px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 9px; }
.ar-mail label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; user-select: none; }
.ar-mail label span { display: inline-flex; align-items: center; gap: 6px; }
.ar-mail label .ico { width: 14px; height: 14px; color: var(--muted); }
.ar-mail input { accent-color: var(--link); margin: 0; width: 15px; height: 15px; }
.ar-mail-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ar-mail p { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ar-mail.full label { color: var(--muted); cursor: default; }
.ar-mail.full p { color: var(--gold); }
.alert-btn .al-mail { display: inline-flex; }
.alert-btn .al-mail .ico { width: 13px; height: 13px; color: var(--muted); }
.np-icon { flex: none; width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: #0b0f16; object-fit: cover; }

/* Watchlist: "Alert when…" in a column of its own at the far right, so the
   buttons line up whatever the item is called. */
#watch th.alert-col, #watch td.alert-col { width: 1%; white-space: nowrap; text-align: right; padding-left: 8px; }
#watch td.alert-col .alert-btn { margin: -3px 0; }
/* Where the table is tight the button is just its bell: lit when a rule is
   true, blue when rules are set. Its rules are in the panel it opens. */
@media (max-width: 1240px) {
  #watch .alert-btn .al-when, #watch .alert-btn .al-lines { display: none; }
  #watch th.alert-col { font-size: 0; }
  #watch th.alert-col .info { font-size: 12px; }
  #watch th.alert-col, #watch td.alert-col { padding-left: 0; padding-right: 8px; }
  #watch td.alert-col .alert-btn { padding: 3px 5px; margin: -3px 0; }
  #watch > thead > tr > th, #watch > tbody > tr > td { padding-left: 10px; }
}

/* ══ Alerts: a button with rules set is plain to see, also as a bare bell ══ */
.alert-btn.set { background: rgba(79, 156, 255, .16); border-color: rgba(79, 156, 255, .6); color: var(--text); }
.alert-btn.set .ico { color: #6fb1ff; fill: currentColor; }
.alert-btn.set:hover { background: rgba(79, 156, 255, .26); }
.alert-btn.hit, .alert-btn.set.hit { background: rgba(240, 193, 75, .2); border-color: rgba(240, 193, 75, .7); }
.alert-btn.hit .ico, .alert-btn.set.hit .ico { color: var(--gold); }
.alert-btn .al-count {
  display: none; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; box-sizing: border-box;
  background: #4f9cff; color: #06101f; font-size: 10.5px; font-weight: 800; line-height: 16px; text-align: center;
}
.alert-btn.hit .al-count { background: var(--gold); color: #17130a; }
.alert-btn .al-line > i { font-style: normal; color: var(--muted); margin-right: 3px; }
@media (max-width: 1240px) { #watch .alert-btn.set { gap: 4px; } #watch .alert-btn.set .al-count { display: inline-block; } }

/* AND / OR between rules, NOT on a rule. */
.ar-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.ar-not, .ar-join button {
  height: 26px; padding: 0 8px; font: inherit; font-size: 11px; font-weight: 800; letter-spacing: .05em;
  background: none; border: 1px solid var(--line); color: var(--faint); cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.ar-not { border-radius: 7px; height: 34px; }
.ar-not:hover, .ar-join button:hover { color: var(--text); border-color: #3f5175; }
.ar-not[aria-pressed="true"] { background: rgba(214, 84, 84, .2); border-color: rgba(214, 84, 84, .65); color: #f39a9a; }
.ar-join { display: flex; justify-content: center; margin: -4px 0 -2px; }
.ar-join button:first-child { border-radius: 7px 0 0 7px; }
.ar-join button:last-child { border-radius: 0 7px 7px 0; margin-left: -1px; }
.ar-join button[aria-pressed="true"] { background: rgba(79, 156, 255, .2); border-color: rgba(79, 156, 255, .65); color: #9cc8ff; position: relative; }
.ar-list { gap: 8px; }
.ar-row { border-bottom: 0; padding-bottom: 0; }
.rules-pop .ar-num { flex: 0 0 96px; width: 96px; }

/* No NOT on a rule any more: the row is the kind of rule and its remove button. */
.ar-row { grid-template-columns: minmax(0, 1fr) auto; }
/* Each rule is a card: what it is about and what has to happen on one line,
   its number under them. Rules joined by AND are one alert, so their cards
   are fused and share a blue edge; OR leaves a gap between alerts. */
.rules-pop { width: 344px; max-width: calc(100vw - 16px); }
.ar-list { gap: 0; }
.ar-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) auto; gap: 8px 6px; padding: 9px 4px 9px 9px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); border-radius: 10px;
}
.ar-row .ar-type { height: 32px; padding: 0 6px; font-size: 13px; }
.ar-row .ar-del { width: 26px; }
.ar-join { margin: 7px 0; position: relative; z-index: 1; }
.ar-join.and { height: 0; margin: 0; align-items: center; }
.ar-join.and button { background-color: var(--panel, #131316); }
.ar-row:has(+ .ar-join.and) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; padding-bottom: 15px; border-left-color: rgba(79, 156, 255, .65); }
.ar-join.and + .ar-row { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: -1px; padding-top: 15px; border-left-color: rgba(79, 156, 255, .65); }

/* Notifications: every one the same height, two short lines, with an X to remove it. */
.np-list li { display: flex; align-items: center; gap: 2px; height: 46px; box-sizing: border-box; }
.np-list a { flex: 1 1 auto; min-width: 0; align-items: center; gap: 9px; height: 40px; padding: 0 6px; margin: 0 0 0 -6px; box-sizing: border-box; }
.np-icon { width: 28px; height: 28px; border-radius: 6px; }
.np-main { flex: 1 1 auto; min-width: 0; gap: 1px; }
.np-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.np-top .item-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; line-height: 1.25; }
.np-when { flex: none; margin-left: auto; font-size: 11px; white-space: nowrap; }
.np-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.25; color: var(--muted); }
.np-del { flex: none; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; background: none; border: 0; border-radius: 7px; color: var(--faint); cursor: pointer; }
.np-del:hover { background: var(--select); color: var(--text); }
.np-del .ico { width: 13px; height: 13px; }

/* ══ Skinny screens: the menu folds down from the header, and the menu button
   itself turns into the X that closes it. The button never moves: the page
   keeps its scrollbar while the menu is open, and nothing covers the header. ══ */
@media (max-width: 760px) {
  html.menu-lock { overflow: visible; }
  .nav-menu-head { display: none; }
  .nav-burger { position: relative; z-index: 62; }
  .nav-shade { inset: 47px 0 0 0; }
  .nav-menu {
    position: fixed; top: 47px; right: 0; bottom: auto; left: 0; width: auto;
    max-height: calc(100vh - 64px); padding: 10px 12px 14px; gap: 6px;
    border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px;
    box-shadow: 0 22px 44px rgba(0, 0, 0, .6);
    transform: translateY(-10px); clip-path: inset(0 0 100% 0); opacity: 0; visibility: hidden;
    transition: clip-path .26s cubic-bezier(.2, .8, .2, 1), transform .26s cubic-bezier(.2, .8, .2, 1), opacity .18s ease, visibility 0s linear .26s;
  }
  .nav.menu-open .nav-menu {
    transform: none; clip-path: inset(0 0 -60px 0); opacity: 1; visibility: visible;
    transition: clip-path .26s cubic-bezier(.2, .8, .2, 1), transform .26s cubic-bezier(.2, .8, .2, 1), opacity .18s ease;
  }
  .nav-menu .nav-watch { margin-top: 4px; }
  .burger { transition: transform .22s ease; }
  .burger i { transform-origin: 50% 50%; }
}
@media (prefers-reduced-motion: reduce) { .nav-menu, .nav.menu-open .nav-menu, .burger { transition: none; } }


/* ══════════════════════════════════════════════════════════════════
   2.0 · Modern dark with blue
   Near-black neutral surfaces; behind the page a faint dot grid that
   fades away below the header, with a soft blue glow at the top; blue
   for what is chosen, what matters most and the main action. Gold stays
   for what is gold: coins, starred items, medals and alerts that fire.
   Everything below overrides what comes above.
   ══════════════════════════════════════════════════════════════════ */
:root {
  --bg: #09090b; --bg-2: #111113; --panel: #131316; --panel-2: #1a1a1e;
  --line: #2a2a30; --line-soft: #1f1f24;
  --text: #f4f4f5; --muted: #a1a1aa; --faint: #71717a;
  --accent: #4f9cff; --accent-ink: #04101f;
  --select: #172235; --select-line: #35507a; --link: #8fc0ff; --on: #3b82f6;
  --good: #4ade80; --warn: #fbbf24; --bad: #f87171;
  --q-common: #ececef; --q-uncommon: #5fdc4f;
  --label: #8e8e98;                               /* small capital labels */
  --edge: rgba(255, 255, 255, .075);              /* the edge of a panel */
  --accent-soft: #cfe2ff;                         /* light blue text on a blue tint */
  --custom: #7cb8ff;                              /* numbers and rules you typed in yourself */
  --blue-metal: linear-gradient(180deg, #5c9cfa 0%, #3b82f6 52%, #2563eb 100%);
  --gold-metal: linear-gradient(180deg, #f8e3a3 0%, #e7c063 42%, #cf9f3c 58%, #b8862a 100%);
}
html { scrollbar-color: #3a3a42 #0c0c0e; }
body, body.home { background: var(--bg); }
/* The backdrop: soft glows of blue, indigo and violet, like an aurora, fixed
   behind the page, with a fine grain over them so they never band. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27200%27%20height%3D%27200%27%3E%3Cfilter%20id%3D%27g%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27100%25%27%20height%3D%27100%25%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%27.9%27%20numOctaves%3D%273%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20values%3D%270%200%200%200%201%200%200%200%200%201%200%200%200%200%201%20.1%200%200%200%20-.035%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20filter%3D%27url%28%23g%29%27%2F%3E%3C%2Fsvg%3E"),
    radial-gradient(38% 34% at 16% 6%, rgba(59, 130, 246, .26), transparent 70%),
    radial-gradient(34% 30% at 84% 2%, rgba(99, 102, 241, .22), transparent 70%),
    radial-gradient(42% 36% at 50% -4%, rgba(56, 189, 248, .1), transparent 70%),
    radial-gradient(36% 34% at 90% 80%, rgba(37, 99, 235, .08), transparent 70%),
    radial-gradient(32% 30% at 6% 72%, rgba(139, 92, 246, .07), transparent 70%);
}
body.home::before {
  background:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27200%27%20height%3D%27200%27%3E%3Cfilter%20id%3D%27g%27%20x%3D%270%27%20y%3D%270%27%20width%3D%27100%25%27%20height%3D%27100%25%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%27.9%27%20numOctaves%3D%273%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20values%3D%270%200%200%200%201%200%200%200%200%201%200%200%200%200%201%20.1%200%200%200%20-.035%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20filter%3D%27url%28%23g%29%27%2F%3E%3C%2Fsvg%3E"),
    radial-gradient(40% 36% at 16% 4%, rgba(59, 130, 246, .3), transparent 70%),
    radial-gradient(36% 32% at 84% 0%, rgba(99, 102, 241, .26), transparent 70%),
    radial-gradient(44% 38% at 50% -6%, rgba(56, 189, 248, .13), transparent 70%),
    radial-gradient(36% 34% at 90% 80%, rgba(37, 99, 235, .08), transparent 70%),
    radial-gradient(32% 30% at 6% 72%, rgba(139, 92, 246, .07), transparent 70%);
}
::selection { background: rgba(79, 156, 255, .35); color: #fff; }

/* ── Labels: small capitals in quiet grey ── */
.side-title, .shop-head h2, legend, .field > span, .chart-title, .chart-stats dt, .best-card .label, .sim label,
.d-card > h4, .tile-head, .home-stat small, .mc-stats dt, thead th {
  color: var(--label);
}
.filters .field > .num-box { color: var(--text); }
.tile-head { border-bottom-color: var(--line); }
/* A short blue mark before the title of each side panel. */
.side-title::before {
  content: ""; display: inline-block; width: 3px; height: 11px; margin-right: 8px; border-radius: 2px;
  background: var(--blue-metal); vertical-align: -1px;
}

/* ── Panels: near-black, a fine light edge, lit along the top ── */
.panel {
  background-color: var(--panel);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, 0) 160px);
  border-color: var(--edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 0 rgba(0, 0, 0, .4), 0 20px 40px -24px rgba(0, 0, 0, .8);
}
.d-card { background: rgba(255, 255, 255, .022); border-color: rgba(255, 255, 255, .07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03); }
.tile, .tiles, .item-main .tiles, .best-card { border-color: var(--edge); }
.best-card.top { border-color: rgba(79, 156, 255, .5); background: linear-gradient(160deg, rgba(79, 156, 255, .1), var(--panel) 60%); }

/* Menus, pop-ups and tooltips: frosted glass. */
.dd-menu, .cols-pop, .list-panel, .note-panel, .alert-pop, .map-card {
  background: rgba(22, 22, 25, .94);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 60px -16px rgba(0, 0, 0, .8);
}
.dd-menu li:hover, .dd-menu li:focus { background: rgba(255, 255, 255, .06); }
.dd-menu li[aria-selected="true"] { background: rgba(79, 156, 255, .14); color: var(--accent-soft); }
.dd-menu li .ico { color: var(--accent); }
.info-tip, .chart-tip {
  background: rgba(24, 24, 27, .95);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 14px 34px -10px rgba(0, 0, 0, .8);
}
.chart-tip .tip-when { color: var(--link); }
.wowhead-tooltip::before { background: #0e0e10; border-color: rgba(255, 255, 255, .1); }
.info:hover, .info:focus-visible { color: var(--link); }
.info:focus-visible { box-shadow: 0 0 0 2px rgba(79, 156, 255, .45); }

/* ── Header: frosted glass ── */
.nav { background: transparent; border-bottom-color: rgba(255, 255, 255, .07); }
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(9, 9, 11, .72);
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
}
.load-bar { z-index: 1; }
.load-bar i { background: linear-gradient(90deg, rgba(79, 156, 255, 0), #a9d0ff, rgba(79, 156, 255, 0)); }
.brand-mark { filter: drop-shadow(0 2px 10px rgba(47, 107, 240, .35)); }
.nav nav a { color: var(--muted); }
.nav nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav nav a.active, .nav nav a.active:hover { color: var(--accent-soft); background: rgba(79, 156, 255, .14); box-shadow: inset 0 0 0 1px rgba(79, 156, 255, .3); }
.nav nav a.active .ico { color: var(--accent); }
.nav-list .nav-badge, .nav-bell .nav-badge { box-shadow: 0 0 0 2px #0c0c0e; }
@media (max-width: 760px) {
  .nav-menu { background: rgba(14, 14, 16, .97); border-color: rgba(255, 255, 255, .1); }
}

/* ── Buttons: neutral glass; blue when on ── */
.btn, .nav-list, a.nav-list {
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)), var(--panel-2);
  border-color: rgba(255, 255, 255, .1);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .4);
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, color .14s ease;
}
.btn:hover, .nav-list:hover, a.nav-list:hover {
  border-color: rgba(255, 255, 255, .2);
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)), var(--panel-2);
}
.btn .ico, .nav-list .ico { color: #c4c4cc; }
.btn:disabled, .btn:disabled:hover { border-color: rgba(255, 255, 255, .07); background: var(--panel-2); box-shadow: none; }
.side-btn[aria-expanded="true"], .filter-btn[aria-expanded="true"], .cols-btn[aria-expanded="true"], .nav-list.on, .nav-list[aria-expanded="true"], #lpPin.on {
  background: rgba(79, 156, 255, .14); border-color: rgba(79, 156, 255, .55); color: var(--accent-soft);
}
.side-btn[aria-expanded="true"] .ico, .filter-btn[aria-expanded="true"] .ico, .cols-btn[aria-expanded="true"] .ico, .nav-list.on .ico, .nav-list[aria-expanded="true"] .ico { color: var(--accent); }
.side-btn .sb-label { color: var(--muted); }
.side-btn[aria-expanded="true"] .sb-label { color: var(--accent-soft); }
/* The phone menu button keeps its bare bars. */
.nav-list.nav-burger, .nav-list.nav-burger:hover, .nav-list.nav-burger[aria-expanded="true"] { background: none; border: 0; box-shadow: none; }

/* The main actions (Search, Add to list, Done): a blue outline with a faint
   blue tint, rather than solid blue, so they do not shout. */
.hero-search .btn, .btn.add-list, .ap-foot .btn {
  background: rgba(79, 156, 255, .1); border: 1px solid rgba(79, 156, 255, .4);
  color: var(--accent-soft); font-weight: 600; text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.hero-search .btn:hover, .btn.add-list:hover, .ap-foot .btn:hover {
  background: rgba(79, 156, 255, .17); border-color: rgba(79, 156, 255, .6); filter: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.btn.add-list .ico { color: var(--accent); }
.btn.add-list.added { background: rgba(74, 222, 128, .14); border-color: rgba(74, 222, 128, .5); color: #86efac; }
.btn.add-list.added .ico { color: #86efac; }

/* ── Boxes to type in ── */
.field input[type="search"], .filters .field input[type="search"], .range input, .filters .range input, .field select, .filters .field select,
.dd-btn, .sim-num, .num-box, .coin-box, .goal-row input, .favor-tier input, .mat-in, .ar-type, .ar-num, .combo input, .house-compact select {
  background-color: rgba(0, 0, 0, .35);
  border-color: rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
}
.field select, .filters .field select { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2710%27%20height%3D%276%27%3E%3Cpath%20d%3D%27M0%200l5%206%205-6z%27%20fill%3D%27%23a1a1aa%27%2F%3E%3C%2Fsvg%3E"); }
.dd-btn > .ico { color: var(--muted); }
.dd-btn:hover, .house-compact select:hover, .filters .field select:hover, .filters .field input:hover { border-color: rgba(255, 255, 255, .2); }
.dd-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .05); border-color: rgba(79, 156, 255, .55); }
.dd-btn[aria-expanded="true"] > .ico { color: var(--accent); }
.field input:focus, .filters .field input:focus, .range input:focus, .field select:focus, .filters .field select:focus, .sim-num:focus,
.num-box:focus-within, .coin-box:focus-within, .goal-row input:focus, .favor-tier input:focus, .ar-type:focus, .combo input:focus, .dd-btn:focus-visible {
  outline: none; border-color: rgba(79, 156, 255, .7);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 3px rgba(79, 156, 255, .18);
}
.hero-search {
  background: rgba(19, 19, 22, .85);
  border-color: rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 20px 40px -24px rgba(0, 0, 0, .9);
}
.hero-search:focus-within { border-color: rgba(79, 156, 255, .65); box-shadow: 0 0 0 3px rgba(79, 156, 255, .16), 0 20px 40px -24px rgba(0, 0, 0, .9); }
.hero-search-ico { color: var(--faint); }
input[type="range"], .sim-range { accent-color: var(--accent); }

/* ── Choices: chips, tabs and switches turn blue when on ── */
.chips span, .tabs button, .seg span, .ar-join button { border-color: rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .02); color: var(--muted); }
.chips span:hover, .tabs button:hover, .seg span:hover, .ar-join button:hover { color: var(--text); border-color: rgba(255, 255, 255, .2); }
.chips input:checked + span, .tabs button[aria-pressed="true"], .seg input:checked + span, .ar-join button[aria-pressed="true"] {
  background: rgba(79, 156, 255, .15); border-color: rgba(79, 156, 255, .6); color: var(--accent-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.track { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.track::after { background: #e4e4e7; box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.switch input:checked + .track { background: rgba(79, 156, 255, .3); box-shadow: inset 0 0 0 1px rgba(79, 156, 255, .5); }
.switch input:checked + .track::after { background: #dbe9ff; }

/* ── Tables ── */
thead th {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)), #141417;
  border-bottom-color: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
thead button:hover { color: var(--text); }
thead button[aria-sort] { color: var(--accent-soft); }
thead button[aria-sort]::after { color: var(--accent); }
tbody tr.row { border-top-color: rgba(255, 255, 255, .05); }
tbody tr.row:hover { background: rgba(255, 255, 255, .03); }
tbody tr.row.open { background: rgba(79, 156, 255, .06); }
#watch tr.group th { background: #111114; }
tr.slot-row > td { background: rgba(79, 156, 255, .035); }
tr.row.mine { background: rgba(124, 184, 255, .045); }
tr.row.mine:hover { background: rgba(124, 184, 255, .08); }
.table-panel::after { background: linear-gradient(to left, rgba(15, 15, 18, .94), transparent); }
.table-panel::before { background: linear-gradient(to right, rgba(15, 15, 18, .94), transparent); }
.swipe-hint { color: var(--link); background: rgba(79, 156, 255, .07); border-bottom-color: var(--line-soft); }
.cat:hover { background: rgba(255, 255, 255, .04); }
.cat[aria-pressed="true"] { background: rgba(79, 156, 255, .14); color: var(--accent-soft); }

/* ── Item icons sit in a dark slot edged in the item's quality colour ── */
.icon { background: #0e0e10; border-color: rgba(255, 255, 255, .08); }
.icon-link { background: #0e0e10; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.icon-link:hover .icon { border-color: var(--accent); }
:is(.item-cell, .mat, .top-crafts li):has(.q2) .icon { border-color: rgba(95, 220, 79, .5); }
:is(.item-cell, .mat, .top-crafts li):has(.q3) .icon { border-color: rgba(77, 157, 255, .55); }
:is(.item-cell, .mat, .top-crafts li):has(.q4) .icon { border-color: rgba(185, 114, 255, .58); }
:is(.item-cell, .mat, .top-crafts li):has(.q5) .icon { border-color: rgba(255, 143, 46, .6); }

/* ── Gains, losses and medals ── */
.roi.up { background: rgba(74, 222, 128, .12); color: #6ee7a0; }
.roi.down { background: rgba(248, 113, 113, .12); color: #fca5a5; }
.roi.flat { background: rgba(161, 161, 170, .12); color: var(--muted); }
#watch td.craft-profit.gain .money, .craft-facts .craft-profit.gain .money, .tile dd.craft-profit.gain,
.trend.up, .trend-text.up, .chg-up, .rate.hi, .copy-btn.copied { color: #6ee7a0; }
.trend.down, .trend-text.down, .chg-down, .tile dd.craft-profit.loss { color: #fca5a5; }
.dot.ok { box-shadow: 0 0 0 3px rgba(74, 222, 128, .15), 0 0 10px rgba(74, 222, 128, .4); }
/* The first three places: gold, silver and bronze. */
.medal { background: var(--gold-metal); color: #241906; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 0 1px rgba(0, 0, 0, .4); }
.medal[data-r="2"] { background: linear-gradient(180deg, #f4f5f7, #c9cdd3 50%, #9aa0a8); color: #1f2226; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 1px rgba(0, 0, 0, .4); }
.medal[data-r="3"] { background: linear-gradient(180deg, #f2c49b, #d08b52 50%, #a5612c); color: #2a1406; box-shadow: inset 0 1px 0 rgba(255, 230, 210, .45), 0 0 0 1px rgba(0, 0, 0, .4); }
.badge, .side-btn .sb-count { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.alert-badge { background: linear-gradient(180deg, #fb7185, #e11d48); color: #fff; }

/* ── Messages, loading and graphs ── */
.banner { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .38); color: #fecaca; }
.banner.note { background: rgba(79, 156, 255, .08); border-color: rgba(79, 156, 255, .35); color: #dbe9ff; }
.skel { background-image: linear-gradient(90deg, #18181b 30%, #232327 50%, #18181b 70%); }
.chart { --c-price: #5ea2ff; --c-qty: #2dd4bf; }
.chart .grid { stroke: rgba(255, 255, 255, .06); }
.chart .tag text { fill: #04101f; }

/* ── Your own numbers and alert rules: light blue; an alert that has fired is gold ── */
td.edited { background: rgba(124, 184, 255, .08); }
td.edited .money { text-decoration-color: var(--custom); }
.sim-price.edited .coin-box, .mat-in.own { border-color: var(--custom); }
.mat-in:focus { border-color: var(--custom); }
.tag.yours { color: var(--custom); background: rgba(124, 184, 255, .12); }
@media (hover: hover) { button.tag.yours:hover, button.tag.yours:focus-visible { background: rgba(124, 184, 255, .26); color: #fff; } }
tr.row.yours > td:first-child { box-shadow: inset 3px 0 0 var(--custom); }
.mat-edit:hover { color: var(--custom); background: rgba(124, 184, 255, .12); }
.mat-edit.on { color: var(--custom); background: rgba(124, 184, 255, .18); }
.alert-btn.set { background: rgba(124, 184, 255, .12); border-color: rgba(124, 184, 255, .55); }
.alert-btn.set .ico { color: var(--custom); }
.alert-btn.set:hover { background: rgba(124, 184, 255, .22); }
.alert-btn .al-count { background: var(--custom); color: #07121d; }
.alert-btn.hit, .alert-btn.set.hit { background: rgba(240, 193, 75, .16); border-color: rgba(240, 193, 75, .65); }
.alert-btn.hit .ico, .alert-btn.set.hit .ico { color: var(--gold); }
.alert-btn.hit .al-count { background: var(--gold); color: #17130a; }
tr.alert-hit > td { background: rgba(240, 193, 75, .05); }
tr.alert-hit > td:first-child { box-shadow: inset 3px 0 0 var(--gold); }

/* ── Footer: the house motto over a faint blue line ── */
.site-footer { position: relative; background: rgba(9, 9, 11, .85); border-top-color: rgba(255, 255, 255, .07); }
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(79, 156, 255, .3) 30%, rgba(160, 200, 255, .45) 50%, rgba(79, 156, 255, .3) 70%, transparent);
}
.site-footer a:hover { color: var(--link); }
.site-footer .site-motto {
  display: inline-block; margin: 0 0 10px; font-size: 14px; font-style: italic; font-weight: 600; letter-spacing: .01em;
  background: linear-gradient(90deg, #a9d0ff, #4f9cff); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── Home ── */
.hero h1 { color: var(--text); }
.hero h1::after {
  content: ""; display: block; width: min(220px, 60vw); height: 1px; margin: 18px auto 0;
  background: linear-gradient(90deg, transparent, rgba(79, 156, 255, .6), transparent);
}
.hero-mark { filter: drop-shadow(0 14px 30px rgba(47, 107, 240, .4)); }
.home-card {
  background-color: var(--panel);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0) 140px);
  border-color: var(--edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 0 rgba(0, 0, 0, .4), 0 20px 40px -26px rgba(0, 0, 0, .9);
}
.home-card:hover {
  background-color: #17171a;
  border-color: rgba(79, 156, 255, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 0 0 1px rgba(79, 156, 255, .1), 0 22px 50px -24px rgba(0, 0, 0, .95), 0 0 40px -14px rgba(59, 130, 246, .3);
}
.home-ico {
  background: linear-gradient(160deg, rgba(79, 156, 255, .22), rgba(79, 156, 255, .05));
  border: 1px solid rgba(79, 156, 255, .35); color: #9cc8ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.home-go { color: var(--faint); }
.home-card:hover .home-go { color: var(--accent); }
.home-stat { border-top-color: rgba(255, 255, 255, .07); }

/* "Scroll sideways for more columns": a small label laid over the empty end of
   the table's heading row (placed by the script), so it takes no room and
   nothing moves when it fades away after the table is first moved. */
.swipe-hint, .swipe-hint:not([hidden]) {
  position: absolute; z-index: 4; top: 0; right: 0;
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 4px;
  height: 22px; margin: 0; padding: 0 7px 0 10px; box-sizing: border-box;
  border: 1px solid rgba(79, 156, 255, .35); border-radius: 999px;
  background: rgba(20, 30, 48, .94); color: var(--link);
  font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, .6);
  pointer-events: none; transition: opacity .3s ease;
}
.swipe-hint[hidden] { display: none; }
.swipe-hint .sh-short { display: none; }
.swipe-hint.short .sh-long { display: none; }
.swipe-hint.short .sh-short { display: inline; }
.swipe-hint .ico, .table-panel.more-right .swipe-hint .ico:last-child { width: 13px; height: 13px; opacity: 1; animation: hint-nudge 1.6s ease-in-out infinite; }
@keyframes hint-nudge { 50% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) { .swipe-hint .ico { animation: none; } }
.swipe-hint.nofit { visibility: hidden; }
.swipe-hint.gone { opacity: 0; }

/* A number box directly inside a label lost its right padding to the label
   rule, so its unit (coin or %) sat on the box's edge. Give it back. */
.filters .field > .num-box { padding: 0 10px 0 0; }

/* ══ Item page header: the item, then your own buttons and the places to see it ══
   A wide screen puts the buttons at the right of the name, on one line. A
   narrower one puts them under it, across the card: yours on the left, the
   places on the right. A phone (up to 680px) stacks the two groups, each as
   wide as the card. */
.item-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 18px 20px; }
.item-art { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.item-art img { display: block; width: 100%; height: 100%; }
.item-title { min-width: 0; }
.item-title h1 { margin: 0; font-size: 26px; line-height: 1.2; overflow-wrap: anywhere; }
/* Facts break between each other, never inside one. Each starts with its dot;
   the one that would start a line sits outside the box and is cut off. */
.item-facts { margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 13.5px; }
.item-facts .facts-in { display: flex; flex-wrap: wrap; margin-left: -17px; }
.item-facts .fact { white-space: nowrap; }
.item-facts .fact::before { content: "·"; display: inline-block; width: 17px; text-align: center; color: var(--faint); }

.item-actions {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding-top: 16px; border-top: 1px solid var(--line-soft);
}
.item-own, .item-links { display: flex; align-items: center; gap: 8px; min-width: 0; }
#alertSlot { display: contents; }
.item-links .btn { justify-content: center; white-space: nowrap; }
.lbl-short { display: none; }

/* Star, copy and the alert button wear the same frame as the buttons beside them. */
.item-own .star-btn, .item-own .copy-btn, .item-own .alert-btn {
  height: 38px; margin: 0; border: 1px solid rgba(255, 255, 255, .1); border-radius: 8px; opacity: 1;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)), var(--panel-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .4);
  color: var(--muted);
}
.item-own .star-btn, .item-own .copy-btn { width: 38px; }
.item-own .star-btn .ico, .item-own .copy-btn .ico { width: 16px; height: 16px; }
.item-own .star-btn:hover, .item-own .copy-btn:hover, .item-own .alert-btn:hover {
  border-color: rgba(255, 255, 255, .2); color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)), var(--panel-2);
}
.item-own .star-btn.on { color: var(--gold); border-color: rgba(240, 193, 75, .4); }
.item-own .copy-btn.copied { color: #6ee7a0; }
.item-own .alert-btn { padding: 0 12px; font-size: 13.5px; color: var(--text); }
.item-own .alert-btn .ico { color: #c4c4cc; }
.item-own .alert-btn.set { background: rgba(124, 184, 255, .12); border-color: rgba(124, 184, 255, .55); }
.item-own .alert-btn.set:hover { background: rgba(124, 184, 255, .2); }
.item-own .alert-btn.set .ico { color: var(--custom); }
.item-own .alert-btn.hit, .item-own .alert-btn.hit:hover { background: rgba(240, 193, 75, .16); border-color: rgba(240, 193, 75, .65); }
.item-own .alert-btn.hit .ico { color: var(--gold); }
/* Beside the bell, its first rule and how many more, so the button stays one
   line at every width. All of them are in the panel it opens. */
.alert-btn .al-brief { display: none; }
.item-own .alert-btn .al-lines { display: none; }
.item-own .alert-btn .al-brief { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.alert-btn .al-more { color: var(--muted); font-weight: 600; }

@media (min-width: 1180px) {
  .item-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .item-actions { grid-column: auto; flex-wrap: nowrap; padding-top: 0; border-top: 0; }
  .item-links { padding-left: 16px; border-left: 1px solid var(--line-soft); }
}
@media (max-width: 900px) {
  .item-title h1 { font-size: 22px; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
}
@media (max-width: 680px) {
  .item-head { gap: 14px 12px; padding: 14px; }
  .item-art { width: 52px; height: 52px; border-radius: 10px; }
  .item-title h1 { font-size: 20px; }
  .item-facts { font-size: 12.5px; }
  .item-actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 8px; padding-top: 14px; }
  .item-own .alert-btn { flex: 1 1 auto; justify-content: center; min-width: 0; }
  .item-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item-links[data-n="2"], .item-links[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-links .btn { padding: 0 8px; }
}

/* ══ Selling to a vendor: Crafting Profit's Vendor column, and what a vendor pays ══ */
#recipes td.vend { font-weight: 600; }
#recipes td.vend .vend-pays { display: block; margin-top: 2px; color: var(--faint); font-size: 11.5px; font-weight: 500; }
#recipes td.vend .vend-pays .money { color: var(--muted); }
#recipes td.vend-best { background: rgba(74, 222, 128, .07); }
#recipes td.vend-best > .money { color: #86efac; }
.vend-win { color: #86efac; font-weight: 600; }
/* On a phone the Vendor column folds into the Profit cell, under the ROI. */
.vend-under { display: none; }
@media (max-width: 560px) {
  #recipes > thead > tr > th:nth-child(7), #recipes > tbody > tr > td:nth-child(7) { display: none; }
  #recipes .vend-under { display: block; margin-top: 3px; color: var(--faint); font-size: 11.5px; font-weight: 500; }
  #recipes .vend-under .money { color: var(--muted); }
  #recipes .vend-under.loss .money { color: var(--bad); }
  #recipes .vend-under.best, #recipes .vend-under.best .money { color: #86efac; font-weight: 600; }
  #recipes.cols-custom .vend-under { display: none; }
}

/* ══ Steady, Unsteady, Spike, Dip: how much of the last seven days a craft was in profit ══ */
.mood {
  display: inline-block; margin-left: 7px; padding: 0 7px; border-radius: 999px; vertical-align: 1px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em; line-height: 16px; white-space: nowrap; cursor: help;
}
.mood.steady { color: #86efac; background: rgba(74, 222, 128, .13); }
.mood b { font-weight: 700; opacity: .75; margin-left: 2px; }
.mood.mixed { color: #fcd34d; background: rgba(251, 191, 36, .14); }
.mood.spike { color: #fdba74; background: rgba(249, 115, 22, .16); }
.mood.dip { color: #fca5a5; background: rgba(248, 113, 113, .12); }

/* ══ Hiding items: the eye on a row, and the Hidden items list in the top row ══ */
.hide-btn {
  display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0;
  background: none; border: 0; border-radius: 6px; color: var(--faint); cursor: pointer;
  opacity: 0; transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.hide-btn .ico { width: 14px; height: 14px; }
.hide-btn:hover { background: rgba(248, 113, 113, .12); color: #fca5a5; }
tr.row:hover .hide-btn, tr.row.open .hide-btn, .hide-btn:focus-visible { opacity: 1; }
/* On a touch screen it follows copy and star: on an opened row, or one that does not open. */
@media (hover: none) {
  tr.row:not(.plain):not(.open) .hide-btn { opacity: 0 !important; pointer-events: none !important; }
  tr.row.open .hide-btn, tr.row.plain .hide-btn { opacity: 1; pointer-events: auto; }
}
/* In a row's opened details it is a link with a word, beside Item page and Wowhead. */
.hide-btn.hide-link, .hide-btn.hide-link:hover {
  display: inline-flex; align-items: center; gap: 5px; width: auto; height: auto; padding: 0; opacity: 1; pointer-events: auto;
  background: none; border-radius: 0; color: var(--muted); font: inherit;
}
.hide-btn.hide-link:hover { color: #fca5a5; text-decoration: underline; }
.hide-btn.hide-link .ico { width: 13px; height: 13px; }
.hidden-btn { position: relative; }
.hidden-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; box-shadow: 0 0 0 2px var(--bg); }
.hidden-btn[aria-expanded="true"], .stretch-btn[aria-pressed="true"] { background: rgba(79, 156, 255, .14); border-color: rgba(79, 156, 255, .55); color: var(--accent-soft); }
.hidden-btn[aria-expanded="true"] .ico, .stretch-btn[aria-pressed="true"] .ico { color: var(--accent); }
.hidden-pop { width: 290px; }
.hidden-pop, .hidden-pop * { user-select: none; -webkit-user-select: none; }
.hp-row { display: flex; align-items: center; gap: 9px; padding: 5px 4px 5px 8px; border-radius: 7px; font-size: 14px; }
.hp-row:hover { background: var(--select); }
.hp-row .item-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.hp-show { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; background: none; border: 0; border-radius: 7px; color: var(--faint); cursor: pointer; }
.hp-show:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.hp-show .ico { width: 14px; height: 14px; }
.hp-none { margin: 2px 8px 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.hp-none .ico { width: 13px; height: 13px; vertical-align: -2px; }

/* ══ Stretch: on a window wider than the page, run from edge to edge ══
   The button only shows where the page would otherwise stop short of the
   window (it is capped at 1680px), and the choice only applies there. */
.stretch-btn { display: none; }
@media (min-width: 1721px) {
  .stretch-btn { display: inline-flex; }
  body.stretch main.wrap { max-width: none; }
}

/* ══ Moving columns: drag a heading; a line shows where it will land ══ */
.col-drop { position: fixed; z-index: 60; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px rgba(79, 156, 255, .55); pointer-events: none; }
th.col-moving { opacity: .4; }
body.col-dragging, body.col-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.cp-note { margin: 6px 8px 2px; padding-top: 7px; border-top: 1px solid var(--line-soft); color: var(--faint); font-size: 12px; line-height: 1.4; }
@media (hover: none) { .cp-note { display: none; } }

/* ══ Headings sit exactly over their numbers ══
   Numbers are right-aligned so their digits line up, and so is the heading.
   Whatever comes with either one (the sort arrow, an info mark, a price's
   trend arrow) goes on the left, so the right edges match. */
.table-scroll th.num { direction: rtl; }
.table-scroll th.num > * { direction: ltr; }
.table-scroll thead th.num .info { margin: 0 4px 0 0; }
thead th.num button[aria-sort]::after, thead th.num button[aria-sort="descending"]::after { content: none; }
thead th.num button[aria-sort]::before { content: "▲ "; color: var(--accent); font-size: 9px; }
thead th.num button[aria-sort="descending"]::before { content: "▼ "; }
.table-scroll td.num > .trend, .bundles td.num > .trend { margin: 0 8px 0 0; }

/* ══ Crafting Profit: the Steady tag stays on the profession's line, and the
   short figures (skill, ROI, sold, scores, sale rate) are centred under their
   headings. Money stays right-aligned so the coins line up. ══ */
#recipes .row-meta { display: grid; grid-template-columns: minmax(0, max-content) max-content; justify-content: start; align-items: center; white-space: nowrap; }
/* When the column is tight the profession is cut short (Leatherwor…), not the tag. */
#recipes .row-meta .rm-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#recipes .row-meta .mood { flex: none; }
/* The skill is in its own column, so the line under the name only repeats it
   where that column is hidden. */
#recipes .rm-skill { display: none; }
@media (max-width: 924px), (min-width: 1321px) and (max-width: 1360px) { #recipes .rm-skill { display: inline; } }
#recipes > thead > tr > th:nth-child(2), #recipes > tbody > tr.row > td:nth-child(2),
#recipes > thead > tr > th:nth-child(6), #recipes > tbody > tr.row > td:nth-child(6),
#recipes > thead > tr > th:nth-child(8), #recipes > tbody > tr.row > td:nth-child(8),
#recipes > thead > tr > th:nth-child(11), #recipes > tbody > tr.row > td:nth-child(11),
#recipes > thead > tr > th:nth-child(12), #recipes > tbody > tr.row > td:nth-child(12),
#recipes > thead > tr > th:nth-child(13), #recipes > tbody > tr.row > td:nth-child(13) { text-align: center; }
/* Copy and star float over the end of the name instead of holding a strip of
   the column for themselves, which leaves the profession and its tag room to
   sit on one line. The star is always in the same spot, on or off, so it does
   not move when it is pressed; a row whose star is on keeps that spot clear. */
#recipes .item-cell { position: relative; }
#recipes .item-cell > .copy-btn, #recipes .item-cell > .star-btn {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%);
  background: #1d1d22; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}
#recipes .item-cell > .copy-btn { right: 32px; }
#recipes .item-cell:has(> .star-btn.on) { padding-right: 30px; }

/* Holding a heading to drag its column on a touch screen must not select its text or open a menu. */
.table-scroll thead th, .table-scroll thead th * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (hover: none) { .cp-note { display: block; } }

/* ══ Row highlight without seams ══
   A see-through background on a table row is painted cell by cell, and where
   two cells meet on a fraction of a pixel it leaves a faint vertical line.
   The highlight (hover, opened, your own listing) is drawn instead as one
   strip across the whole row, behind the cells. */
.table-scroll tbody tr.row { position: relative; z-index: 0; background: none !important; }
.table-scroll tbody tr.row.open > td { background: none; }
.table-scroll tbody tr.row > td:first-child::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: transparent; transition: background .1s ease;
}
.table-scroll tbody tr.row:hover > td:first-child::before { background: rgba(255, 255, 255, .03); }
.table-scroll tbody tr.row.mine > td:first-child::before { background: rgba(124, 184, 255, .045); }
.table-scroll tbody tr.row.mine:hover > td:first-child::before { background: rgba(124, 184, 255, .08); }
.table-scroll tbody tr.row.open > td:first-child::before { background: rgba(79, 156, 255, .06); }

/* ── Accounts ─────────────────────────────────────────────────
   Signed out, the things that belong to an account are not on the page:
   stars, alert buttons and "Add to list". The header has Sign in instead. */
html.signed-out .star-btn, html.signed-out .alert-btn, html.signed-out .add-list, html.signed-out #alertSlot { display: none !important; }
.nav-signin { margin-left: auto; }
.nav-acct { margin-left: 0; padding: 0 7px; }
.nav-acct .nav-list-text { display: none; }
.acct-face { display: inline-grid; place-items: center; width: 22px; height: 22px; }
.acct-pic { width: 22px; height: 22px; border-radius: 50%; display: block; }
.acct-panel { width: min(320px, calc(100vw - 24px)); display: grid; gap: 10px; padding: 12px 14px; }
.acct-panel[hidden] { display: none; }
.acct-panel .np-head, .acct-panel .np-foot { padding: 0; border: 0; }
.acct-panel .g-btn { justify-content: center; gap: 10px; width: 100%; min-height: 42px; font-weight: 600; text-decoration: none; color: var(--text); }
.g-mark { width: 18px; height: 18px; flex: none; }
.acct-note { margin: 0; color: var(--muted); font-size: 12.5px; text-align: center; }
.acct-note.warn { color: #f08a8a; }
.acct-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acct-who .acct-face, .acct-who .acct-pic { width: 34px; height: 34px; flex: none; }
.acct-who .ico { width: 20px; height: 20px; color: var(--muted); }
.acct-id { display: grid; min-width: 0; }
.acct-id b, .acct-id span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-id span { color: var(--muted); font-size: 12.5px; }
.btn.danger { border-color: rgba(214, 84, 84, .6); color: #f08a8a; }
.lp-empty [data-signin] { margin-top: 8px; }
@media (max-width: 760px) {
  .nav-menu #acctBtn {
    order: 4; display: flex; justify-content: flex-start; gap: 12px; width: 100%; height: 46px; margin: 0; padding: 0 12px; font-size: 15.5px;
  }
  .nav-menu .nav-signin { order: 3; margin-top: 8px; }
  .nav-menu .nav-acct .nav-list-text { display: inline; }
  .acct-panel { right: 12px; left: 12px; width: auto; }
}

/* ── Footer, bottom right: the support address and the suggestion box ── */
.foot-wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; }
.foot-text { min-width: 0; flex: 1 1 420px; }
.foot-contact { position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.foot-mail { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; }
.foot-mail .ico { width: 15px; height: 15px; }
.foot-suggest { min-height: 34px; height: 34px; padding: 0 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.foot-suggest .ico { width: 15px; height: 15px; }
.foot-suggest[aria-expanded="true"] { background: var(--select); border-color: var(--select-line); }
.suggest-pop {
  position: absolute; bottom: calc(100% + 10px); right: 0; z-index: 40;
  width: min(360px, calc(100vw - 24px)); padding: 12px 14px;
  background: rgba(22, 22, 25, .96); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px;
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 60px -16px rgba(0, 0, 0, .8);
  color: var(--text); animation: rise .16s ease both;
}
.suggest-pop[hidden] { display: none; }
.suggest-pop form { display: grid; gap: 10px; }
.suggest-pop .np-head, .suggest-pop .np-foot { padding: 0; border: 0; }
.suggest-pop .np-foot .acct-note { text-align: left; }
.suggest-pop textarea, .suggest-pop input[type="email"] {
  width: 100%; box-sizing: border-box; padding: 9px 11px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 14px;
}
.suggest-pop textarea { min-height: 110px; max-height: 40vh; resize: vertical; line-height: 1.4; }
.suggest-pop textarea:focus-visible, .suggest-pop input[type="email"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.suggest-pop ::placeholder { color: var(--faint); }
.suggest-pop .lp-empty { padding: 18px 8px; }
.suggest-pop .lp-empty .ico { width: 26px; height: 26px; color: var(--on); }
/* A box no person sees or reaches; only a script that fills in every field. */
.suggest-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 760px) {
  .foot-contact { margin-left: 0; width: 100%; }
  .suggest-pop { right: auto; left: 0; }
  .suggest-pop textarea, .suggest-pop input[type="email"] { font-size: 16px; }   /* no zoom on focus on a phone */
}

/* One plain sentence at the foot of a tool page saying what it is, for search engines and newcomers. */
.about { margin: 22px 0 0; max-width: 90ch; color: var(--faint); font-size: 12.5px; line-height: 1.5; }

/* ── Footer: who we are, the tools, your account, help; then the small print ── */
.site-footer { padding: 30px 0 22px; }
.foot-grid { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(130px, 1fr)); gap: 26px 32px; align-items: start; }
.foot-brand p { margin: 0 0 5px; max-width: 38ch; }
.foot-logo { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--text) !important; font-family: var(--display); font-size: 17px; font-weight: 600; text-decoration: none; }
.foot-logo .brand-mark { width: 30px; height: 21px; }
.foot-col { display: grid; gap: 7px; justify-items: start; align-content: start; }
.foot-col h2 { margin: 0 0 3px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.foot-col a, .foot-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: inherit; font-size: 13px; text-decoration: none; }
.foot-link { padding: 0; background: none; border: 0; cursor: pointer; }
.foot-col a:hover, .foot-link:hover, .foot-link[aria-expanded="true"] { color: var(--link); }
.foot-col .ico { width: 14px; height: 14px; }
.foot-contact { position: relative; display: grid; gap: 7px; margin-left: 0; flex-wrap: nowrap; }
.foot-base { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.foot-line { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px !important; }
@media (max-width: 900px) {
  .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
  .foot-contact { grid-column: 1 / -1; width: auto; }
  .foot-col a, .foot-link { min-height: 28px; font-size: 14px; }
}

/* ── Privacy and Terms: a page of plain reading ── */
.legal { max-width: 820px; margin: 18px auto 0; padding: 26px 30px 30px; line-height: 1.6; }
.legal-head { padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.legal h1 { margin: 0; font-size: clamp(26px, 5vw, 34px); line-height: 1.15; }
.legal-date { margin: 6px 0 0; color: var(--faint); font-size: 12.5px; }
.legal-lead { margin: 12px 0 0; color: var(--muted); font-size: 15.5px; }
.legal h2 { margin: 26px 0 8px; font-size: 17px; font-weight: 600; color: var(--text); }
.legal h3 { margin: 16px 0 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.legal p, .legal li { color: var(--muted); font-size: 14.5px; }
.legal p { margin: 0 0 10px; }
.legal ul { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.legal b { color: var(--text); font-weight: 600; }
.legal a { color: var(--link); }
.legal code { padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--text); font-size: 13px; }
.legal-table { overflow-x: auto; margin: 0 0 10px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal th, .legal td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; color: var(--muted); }
.legal th { color: var(--faint); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.legal td:last-child { white-space: nowrap; }
@media (max-width: 560px) { .legal { padding: 20px 16px 22px; } }
@media (min-width: 561px) and (max-width: 760px) { .suggest-pop { left: auto; right: 0; } }
.foot-brand .foot-logo { display: flex; width: fit-content; }
.foot-brand .site-motto { display: block; width: fit-content; margin-bottom: 8px; }
.acct-note a { color: var(--link); }

/* ── Admin page ── */
.acct-admin { justify-content: center; min-height: 36px; text-decoration: none; }
.adm { display: block; }
#admin { display: grid; gap: 14px; margin-top: 16px; }
.adm-none { padding: 40px 16px; }
.adm-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.adm-tile { padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.adm-tile dt { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.adm-tile dd { margin: 4px 0 2px; font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.1; color: var(--text); }
.adm-tile span { color: var(--faint); font-size: 12.5px; }
.adm-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.adm-chart, .adm-rank, .adm-block { padding: 14px 16px; }
.adm-chart header, .adm-block > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.adm-chart h2, .adm-rank h2, .adm-block h2 { margin: 0; }
.adm-sum { color: var(--faint); font-size: 12.5px; }
.adm-chart svg { display: block; width: 100%; height: 120px; }
.adm-bar { fill: var(--accent); }
.adm-hit { fill: transparent; }
.adm-chart g:hover .adm-hit { fill: rgba(255, 255, 255, .06); }
.adm-chart g:hover .adm-bar { fill: var(--link); }
.adm-chart footer { display: flex; justify-content: space-between; margin-top: 6px; color: var(--faint); font-size: 11.5px; }
.adm-rank ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.adm-rank li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.adm-rank li:last-child { border-bottom: 0; }
.adm-rank li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.adm-rank li b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.adm-empty { margin: 10px 0 0; color: var(--faint); font-size: 13px; }
.adm-search { width: min(260px, 100%); height: 36px; padding: 0 11px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font: inherit; font-size: 14px; }
.adm-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.adm-scroll { overflow-x: auto; }
.adm-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13.5px; }
.adm-table th, .adm-table td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; white-space: nowrap; color: var(--muted); }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-table th button { padding: 0; background: none; border: 0; color: var(--faint); font: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.adm-table th button:hover, .adm-table th button[aria-sort] { color: var(--text); }
.adm-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-who > span { display: grid; min-width: 0; }
.adm-who b { color: var(--text); font-weight: 600; }
.adm-who span span { font-size: 12.5px; color: var(--faint); }
.adm-face { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none; background: var(--panel-2); }
.adm-face .ico { width: 15px; height: 15px; color: var(--faint); }
.adm-tag { padding: 1px 6px; border-radius: 999px; background: rgba(79, 156, 255, .16); color: var(--link); font-size: 11px; font-style: normal; font-weight: 600; }
.adm-tag.warn { background: rgba(214, 84, 84, .18); color: #f08a8a; }
.adm-acts { text-align: right; }
.adm-acts .link-btn { margin-left: 12px; }
.adm-acts .link-btn:disabled { opacity: .4; cursor: default; }
.adm-danger { color: #f08a8a; }
.adm-foot { margin: 10px 0 0; color: var(--faint); font-size: 12.5px; min-height: 1em; }
.adm-foot.warn { color: #f08a8a; }
.adm-sugs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.adm-sugs li { padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 10px; }
.adm-sug-head { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; font-size: 13px; }
.adm-sug-head b { color: var(--text); }
.adm-sug-head a { color: var(--link); text-decoration: none; }
.adm-sug-head > span { color: var(--faint); font-size: 12px; margin-left: auto; }
.adm-sugs p { margin: 6px 0 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-sys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 20px; margin: 0; }
.adm-sys dt { color: var(--faint); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.adm-sys dd { margin: 2px 0 0; color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.adm-sys dd.ok { color: #7fd6a2; }
.adm-sys dd.bad { color: #f08a8a; }
@media (max-width: 900px) {
  .adm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-two { grid-template-columns: minmax(0, 1fr); }
  .adm-sys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Admin: the test email button, and the Backups panel. */
.adm-test { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.adm-ok { color: #6ee7a0 !important; }
.adm-bad { color: #fca5a5 !important; }
.adm-pick { height: 30px; padding: 0 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--bg, #0d1118); border: 1px solid var(--line); border-radius: 8px; }
.adm-block > header .btn { min-height: 32px; padding: 0 14px; }
.adm-backups code { font-size: 12.5px; color: var(--text); }
.adm-foot code { color: var(--text); background: rgba(255, 255, 255, .06); border-radius: 5px; padding: 1px 5px; font-size: 12px; }
/* Something you pay for: going up is the bad direction. */
.trend.cost.up { color: #fca5a5; }
.trend.cost.down { color: #6ee7a0; }
/* Crafting Profit: Quantity (9) sits beside Sold / day (8), centred like it,
   and is hidden wherever that column is. */
#recipes > thead > tr > th:nth-child(9), #recipes > tbody > tr.row > td:nth-child(9) { text-align: center; }
/* Between these widths Sold / day fits and Quantity does not. */
@media (min-width: 1150px) and (max-width: 1539px) {
  #recipes > thead > tr > th:nth-child(9), #recipes > tbody > tr > td:nth-child(9) { display: none; }
}
