/* Hagler brand (Hagler-style.md v2): warm ink, Hagler Gold, Marcellus for titles
   over Barlow Semi Condensed for figures. Shared token for token with the addon. */
:root {
  --bg: #0C0D0F; --panel: #131417; --raised: #1B1D21; --hover: #24272C; --border: #2F3238; --iron-light: #4A4D54; --bronze: #5E4824;
  --text: #EDE6D6; --muted: #9A9384; --faint: #6A6558;
  --accent: #E2B654; --gold-100: #FBE7AE; --gold-600: #B88A3A; --gold-800: #6E4C1A; --gold: #F2C94C;
  --good: #4CC38A; --bad: #E5534B; --warn: #E8A33D; --info: #5B9BD5;
  --silver: #C7CDD4; --copper: #C98A5B;
  /* item rarity: the game's hues, tuned for dark ink */
  --q0: #9D9D9D; --q1: #EDE6D6; --q2: #3FD82B; --q3: #2F8AF0; --q4: #A66CF2; --q5: #FF8A1F; --q6: #E6CC80;
  --radius: 4px; --radius-sm: 3px;
  --head: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --display: Marcellus, "Friz Quadrata", Georgia, serif;
  --body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gilt: linear-gradient(90deg, transparent, rgba(226, 182, 84, .85), transparent);
  --glow: linear-gradient(0deg, rgba(226, 182, 84, .14), rgba(226, 182, 84, 0) 10px);
  --ease: 140ms ease-out;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--body); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.num, td.r, .money { font-variant-numeric: tabular-nums; }

/* header */
.top { background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.brand:hover { text-decoration: none; }
.coin { width: 24px; height: 24px; }
.wordmark { font: 600 20px var(--head); letter-spacing: 3px; }
input, select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; height: 34px; padding: 0 10px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

/* layout */
main { min-height: 60vh; padding-bottom: 32px; }
.page { padding-top: 24px; }
h1 { font: 600 28px/1.15 var(--head); margin: 0 0 4px; }
h2 { font: 600 18px var(--head); margin: 0 0 12px; letter-spacing: .3px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.tile .value { font: 600 24px var(--head); margin-top: 4px; }
.tile .value.small { font-size: 18px; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 500; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
td { padding: 6px 8px; border-bottom: 1px solid rgba(42, 48, 58, .6); white-space: nowrap; }
td.name { white-space: normal; }
tbody tr:nth-child(even) { background: rgba(232, 230, 225, .03); }
tbody tr:hover { background: rgba(224, 177, 74, .08); }
th.r, td.r { text-align: right; }
.empty { color: var(--muted); padding: 12px 8px; }
.up { color: var(--good); } .down { color: var(--bad); }

/* money */
.money .g { color: var(--gold); } .money .s { color: var(--silver); } .money .c { color: var(--copper); }
.money i { font-style: normal; font-size: .8em; margin-left: 1px; margin-right: 4px; opacity: .85; }
.money i:last-child { margin-right: 0; }

/* item rarity (game-inspired, see --q0..--q6) */
.q0 { color: var(--q0); } .q1 { color: var(--q1); } .q2 { color: var(--q2); }
.q3 { color: var(--q3); } .q4 { color: var(--q4); } .q5 { color: var(--q5); } .q6 { color: var(--q6); }

/* tabs and buttons */
.tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tabs button { background: none; border: 0; color: var(--muted); font: 500 13px var(--body); padding: 6px 0; border-bottom: 2px solid transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.btn { background: var(--raised); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px; font: inherit; cursor: pointer; }
.btn.primary { background: var(--accent); color: #0F1216; border-color: var(--accent); font-weight: 600; }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .axis text { fill: var(--muted); font: 11px var(--body); }
.chart .grid line { stroke: var(--border); }
.chart .tip {
  position: absolute; pointer-events: none; background: var(--raised); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -100%);
}
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 12px; margin-top: 8px; flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: middle; background: currentColor; }
.legend .med { color: var(--accent); } .legend .low { color: var(--info); } .legend .qty { color: var(--muted); }

.notice { background: var(--panel); border: 1px solid var(--border); border-left: 2px solid var(--warn); border-radius: var(--radius); padding: 12px 16px; color: var(--muted); }
.foot { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 24px; border-top: 1px solid var(--border); }
.scroll { overflow-x: auto; }


.est { font: 500 10px var(--body); letter-spacing: 1px; text-transform: uppercase; color: var(--warn); margin-left: 4px; vertical-align: middle; }
.sub.small { font-size: 12px; margin: -6px 0 8px; }

/* ---------------------------------------------------------------- 0.4.0 */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted, .none { color: var(--muted); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:hover { border-color: var(--muted); }

/* header */
.mainnav { display: flex; gap: 16px; }
.mainnav a { color: var(--muted); font-weight: 500; padding: 17px 0 15px; border-bottom: 2px solid transparent; }
.mainnav a:hover { color: var(--text); text-decoration: none; }
.mainnav a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.top-row { padding-top: 0; padding-bottom: 0; }
.status { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.status b { color: var(--text); font-weight: 600; }
.status .sep { margin: 0 6px; opacity: .6; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status.fresh .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(76, 195, 138, .18); }
.status.late .dot { background: var(--warn); }
.status.stale .dot { background: var(--bad); }
.game { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); font-size: 13px; font-weight: 500; }
.game svg { width: 16px; height: 16px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.seg button { background: none; border: 0; color: var(--muted); font: 500 13px var(--body); padding: 0 12px; height: 30px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover:not(:disabled) { color: var(--text); background: var(--raised); }
.seg button[aria-pressed="true"] { color: #0F1216; background: var(--accent); font-weight: 600; }
.seg button:disabled { opacity: .4; cursor: not-allowed; }

/* banner */
.hero {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 120% at 85% 0%, rgba(224, 177, 74, .16), transparent 70%),
    repeating-linear-gradient(60deg, rgba(224, 177, 74, .035) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-60deg, rgba(224, 177, 74, .035) 0 1px, transparent 1px 22px),
    linear-gradient(180deg, #151A21, var(--bg));
}
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 24px; }
.hero h1 { font-size: 34px; margin: 2px 0 4px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
.hero-sub { color: var(--muted); margin: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: rgba(23, 27, 33, .85); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; min-width: 120px; }
.chip .label { display: block; font-size: 10px; }
.chip .v { font: 600 20px var(--head); }
em { font-style: normal; color: var(--warn); font-size: .85em; }
.label em { font-size: 1em; }

/* browse layout */
.browse { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding-top: 24px; align-items: start; }
.side { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 0; }
.side-group { padding: 12px 14px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.side-group:last-child { border-bottom: 0; }
.side select { width: 100%; }
.seg.faction { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg.faction button { padding: 0 4px; font-size: 12px; }
.seg.faction .f-alliance[aria-pressed="true"] { background: #4F7BC0; color: #fff; }
.seg.faction .f-horde[aria-pressed="true"] { background: #C0504A; color: #fff; }
.seg.faction .f-blackwater[aria-pressed="true"] { background: var(--accent); }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin: 2px 0 4px 10px; padding-left: 8px; border-left: 1px solid var(--border); }
.tree button { width: 100%; display: flex; justify-content: space-between; gap: 8px; background: none; border: 0; color: var(--text); font: 13px var(--body); padding: 5px 8px; border-radius: var(--radius-sm); cursor: pointer; text-align: left; }
.tree button:hover { background: var(--raised); }
.tree button.on { background: rgba(224, 177, 74, .12); color: var(--accent); }
.tree button.has-sub span:first-child::after { content: " ›"; color: var(--muted); }
.tree button[aria-expanded="true"].has-sub span:first-child::after { content: " ⌄"; }
.n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.range { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.range input { width: 100%; min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { height: auto; accent-color: var(--accent); }

.searchbar { position: relative; }
.searchbar svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.searchbar input { width: 100%; height: 48px; font-size: 16px; padding-left: 44px; border-radius: var(--radius); background: var(--panel); }
.toolbar { display: flex; align-items: center; gap: 12px; margin: 12px 0 8px; font-size: 13px; }
#filters-btn { display: none; }
.results-pane .scroll { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }

/* browse table */
.browse-table th { padding: 0; position: sticky; top: 0; background: var(--raised); z-index: 1; }
.browse-table th button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 9px 8px; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.browse-table th.r button { text-align: right; }
.browse-table th:hover { color: var(--text); }
.browse-table th[aria-sort="ascending"], .browse-table th[aria-sort="descending"] { color: var(--accent); }
.browse-table th[aria-sort="ascending"] button::after { content: " ▲"; font-size: 9px; }
.browse-table th[aria-sort="descending"] button::after { content: " ▼"; font-size: 9px; }
.browse-table td { padding: 4px 8px; height: 40px; }
.browse-table td.name { min-width: 220px; }
.browse-table td.name a { color: inherit; }
.browse-table td.name a:hover { text-decoration: none; }
.browse-table td.name a:hover span:last-child { text-decoration: underline; }
.browse-table tbody tr { cursor: pointer; }
th.star, td.star { width: 34px; text-align: center; padding-left: 4px; padding-right: 0; }
.fav { background: none; border: 0; color: var(--border); font-size: 16px; cursor: pointer; padding: 4px; line-height: 1; }
.fav:hover { color: var(--muted); }
.fav.on { color: var(--gold); }
.pc { font-variant-numeric: tabular-nums; }
.pc.good { color: var(--good); font-weight: 600; } .pc.fair { color: var(--good); } .pc.bad { color: var(--bad); }
.btn.more { display: block; margin: 12px auto 0; }
.foot-note { margin-top: 12px; }

/* item icons, with a border in the item's quality colour */
.it { display: inline-flex; align-items: center; gap: 10px; }
.icon { position: relative; display: inline-block; width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid; flex: none; overflow: hidden;
  background: linear-gradient(135deg, var(--raised), var(--bg)); }
.icon::before { content: attr(data-l); position: absolute; inset: 0; display: grid; place-items: center; font: 600 13px var(--head); color: var(--muted); }
.qb2::before { color: var(--q2); } .qb3::before { color: var(--q3); } .qb4::before { color: var(--q4); } .qb5::before { color: var(--q5); } .qb0::before { color: var(--q0); }
.icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.icon.big::before { font-size: 18px; } .icon.huge::before { font-size: 28px; }
.icon.big { width: 40px; height: 40px; }
.icon.huge { width: 64px; height: 64px; border-width: 2px; border-radius: var(--radius); }
.qb0 { border-color: var(--q0); } .qb1 { border-color: #555D69; } .qb2 { border-color: var(--q2); }
.qbx { border-color: var(--border); }
.qb3 { border-color: var(--q3); } .qb4 { border-color: var(--q4); } .qb5 { border-color: var(--q5); }
.unknown { color: var(--muted); font-style: italic; }

/* hover tooltip */
.tooltip { position: fixed; z-index: 50; pointer-events: none; width: 300px; background: rgba(23, 27, 33, .97); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); padding: 12px; font-size: 13px; }
.tip-head { display: flex; gap: 10px; align-items: center; }
.tip-name { font: 600 17px/1.2 var(--head); }
.tip-sub { color: var(--muted); font-size: 12px; }
.tip-lines { margin-top: 8px; display: grid; gap: 2px; }
.row2 { display: flex; justify-content: space-between; gap: 12px; }
.tip-market { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); display: grid; gap: 3px; }
.kv { display: flex; justify-content: space-between; gap: 12px; }
.kv > span:first-child { color: var(--muted); }
.tip-foot { margin-top: 8px; color: var(--muted); font-size: 11px; }

/* item page */
.item-head { display: flex; gap: 16px; align-items: center; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.facts > span { background: rgba(23, 27, 33, .85); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 8px; font-size: 12px; color: var(--muted); }
.fav-big.on { color: var(--gold); border-color: rgba(242, 201, 76, .5); }

@media (min-width: 641px) and (max-width: 1100px) {
  .status .scanned, .status .sep { display: none; }
}
@media (max-width: 900px) {
  .browse { grid-template-columns: minmax(0, 1fr); }
  .side { min-width: 0; }
  .side { display: none; position: static; max-height: none; }
  .side.open { display: block; }
  #filters-btn { display: inline-block; }
  .game { display: none; }
}
@media (max-width: 640px) {
  .top-row { gap: 10px; min-height: 0; padding-top: 8px; padding-bottom: 8px; }
  .mainnav a { padding: 6px 0; }
  .status { order: 5; width: 100%; margin-left: 0; }
  .seg.region { margin-left: auto; }
  .hero h1 { font-size: 26px; }
  .hero-row { padding-top: 20px; padding-bottom: 16px; }
  .chip { min-width: 0; flex: 1; padding: 6px 10px; }
  .chip .v { font-size: 17px; }
  .opt { display: none; }
  .browse-table td.name { min-width: 150px; }
  .tooltip { display: none; }
  .item-head .icon.huge { width: 48px; height: 48px; }
}
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- 0.5.0 trends */
.gold-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 24px; align-items: center; margin-bottom: 16px; }
.gold-big { font: 600 44px/1.1 var(--head); color: var(--gold); font-variant-numeric: tabular-nums; margin: 4px 0 8px; }
.gold-big span { font-size: .55em; margin-left: 2px; opacity: .85; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.gold-chart svg { display: block; width: 100%; height: auto; margin-top: 4px; }
.gold-chart text { font: 10px var(--body); fill: var(--muted); }
.gold-chart text.hl { fill: var(--good); } .gold-chart text.ll { fill: var(--bad); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill.up { background: rgba(76, 195, 138, .16); color: var(--good); }
.pill.down { background: rgba(229, 83, 75, .16); color: var(--bad); }
.pill.gold { background: rgba(224, 177, 74, .16); color: var(--accent); }
.trend-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.trend-bar label { display: flex; align-items: center; gap: 8px; }
.trend-bar select { height: 30px; }
.movers { list-style: none; margin: 0; padding: 0; counter-reset: m; }
.movers li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px; border-radius: var(--radius-sm); }
.movers li:nth-child(even) { background: rgba(232, 230, 225, .03); }
.movers li:hover { background: rgba(224, 177, 74, .08); }
.movers a { display: flex; flex-direction: column; gap: 1px; color: inherit; min-width: 0; }
.movers a:hover { text-decoration: none; }
.movers a .it { font-weight: 500; }
.fromto { font-size: 12px; color: var(--muted); margin-left: 38px; }
.fromto .arrow { margin: 0 4px; }
.movers .pill { min-width: 64px; text-align: center; }
.dot-up, .dot-down { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot-up { background: var(--good); } .dot-down { background: var(--bad); }
.empty.small { padding: 8px 0; font-size: 12px; }
@media (max-width: 760px) { .gold-card { grid-template-columns: 1fr; } .gold-big { font-size: 36px; } }
@media (max-width: 640px) { .mainnav { gap: 12px; } }

.notice.slim { padding: 8px 12px; font-size: 13px; margin: 12px 0 0; }

/* full tooltips (0.5.0) */
.t-g { color: var(--good); } .t-y { color: var(--gold); } .t-m { color: var(--muted); } .t-h { color: var(--accent); margin-top: 6px; }
.tip-loading { margin-top: 8px; color: var(--muted); font-size: 12px; }
.tip-card { max-width: 380px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.tip-card .tip-lines { margin-top: 6px; }
.tip-sell { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- 0.5.2 dropdowns and pills */
.dd { position: relative; display: inline-block; min-width: 0; }
.side .dd { display: block; }
.dd-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-width: 120px;
  height: 34px; padding: 0 10px 0 12px; background: var(--bg); color: var(--text); font: inherit; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.dd-btn:hover { border-color: var(--muted); background: var(--raised); }
.dd-btn:focus-visible, .dd.open .dd-btn { outline: none; border-color: var(--accent); }
.dd-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn svg { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.dd.open .dd-btn svg { transform: rotate(180deg); stroke: var(--accent); }
.dd-list {
  position: absolute; z-index: 40; left: 0; top: calc(100% + 4px); min-width: 100%; max-height: 280px; overflow: auto;
  margin: 0; padding: 4px; list-style: none; background: var(--raised); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
}
.dd.dd-up .dd-list { top: auto; bottom: calc(100% + 4px); }
.dd-list li { position: relative; padding: 7px 28px 7px 10px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.dd-list li.active { background: rgba(224, 177, 74, .10); }
.dd-list li[aria-selected="true"] { color: var(--accent); font-weight: 600; }
.dd-list li[aria-selected="true"]::after { content: ""; position: absolute; right: 10px; top: 50%; width: 5px; height: 9px; margin-top: -6px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.field { display: flex; align-items: center; gap: 8px; }
.field > span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.seg.pills button { height: 30px; padding: 0 12px; }
.seg.pills button .money i { margin-right: 0; }
.seg.pills button[aria-pressed="true"] { background: rgba(224, 177, 74, .14); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.seg.pills button[aria-pressed="true"] .money .g, .seg.pills button[aria-pressed="true"] .money .s { filter: brightness(1.1); }
@media (max-width: 640px) { .trend-bar { gap: 10px; } .trend-bar .field { flex-wrap: wrap; } }

/* ================================================================ 0.6.0 Hagler brand
   One identity with the addon: Hagler-style.md v2. Later rules override earlier ones. */
::selection { background: rgba(226, 182, 84, .3); color: var(--text); }
a, button, .btn, .dd-btn, input, select, .tree button, .mainnav a, tbody tr { transition: color var(--ease), background-color var(--ease), border-color var(--ease), box-shadow var(--ease); }
input::placeholder { color: var(--faint); }
input:focus, select:focus, .dd-btn:focus-visible, .dd.open .dd-btn { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(226, 182, 84, .15); }

/* Header: the Hagler frame's metal rule under a forged-ink bar */
.top { background: linear-gradient(180deg, var(--raised), var(--panel)); border-bottom: 1px solid var(--bronze); box-shadow: 0 1px 0 #000; }
.top-row { min-height: 60px; }
.brand { gap: 12px; }
.coin { width: 28px; height: 28px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.wordmark { font: 400 21px/1 var(--display); letter-spacing: .15em; color: #F1EADB; padding-top: 2px; }
.mainnav { gap: 22px; margin-left: 12px; }
.mainnav a { font: 400 15px var(--display); letter-spacing: .02em; color: var(--muted); padding: 20px 2px 18px; }
.mainnav a[aria-current] { color: var(--text); border-bottom-color: var(--accent); background: var(--glow); }
.status .dot { width: 9px; height: 10px; border-radius: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.status.fresh .dot { box-shadow: none; }
.game svg { width: 14px; height: 14px; }

/* Toggles: gold label + gold underline (same rule as the addon). Primary is gold metal. */
.seg button[aria-pressed="true"] { color: var(--accent); background: rgba(226, 182, 84, .12); box-shadow: inset 0 -2px 0 var(--accent); font-weight: 600; }
.seg.faction .f-alliance[aria-pressed="true"] { background: rgba(79, 123, 192, .25); color: #9FC0F0; box-shadow: inset 0 -2px 0 #4F7BC0; }
.seg.faction .f-horde[aria-pressed="true"] { background: rgba(192, 80, 74, .25); color: #F0A39E; box-shadow: inset 0 -2px 0 #C0504A; }
.seg.faction .f-blackwater[aria-pressed="true"] { background: rgba(226, 182, 84, .12); }
.btn { border-radius: var(--radius-sm); }
.btn:hover { border-color: var(--iron-light); background: var(--hover); }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--gold-600)); border-color: var(--gold-800); color: var(--bg); box-shadow: inset 0 1px 0 rgba(251, 231, 174, .7); }
.btn.primary:hover { background: linear-gradient(180deg, #EBC46A, #C29444); }

/* Titles: Marcellus, like Friz Quadrata in game. Numbers never use it. */
h1 { font: 400 32px/1.15 var(--display); letter-spacing: .01em; }
.hero h1 { font-size: 36px; }
/* Section heading: display caps in gold with a fading bronze rule (same in the addon) */
h2 { display: flex; align-items: center; gap: 10px; font: 400 13px/1.3 var(--display); color: var(--accent); text-transform: uppercase; letter-spacing: .14em; margin: 0 0 14px; }
h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--bronze), transparent); }
h2 .est { color: var(--warn); }
.eyebrow { color: var(--accent); letter-spacing: .18em; }
.label, th, .field > span { color: var(--muted); }

/* Hero: hex lattice on warm ink */
.hero {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 120% at 85% 0%, rgba(226, 182, 84, .13), transparent 70%),
    repeating-linear-gradient(60deg, rgba(226, 182, 84, .03) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-60deg, rgba(226, 182, 84, .03) 0 1px, transparent 1px 22px),
    linear-gradient(180deg, #131315, var(--bg));
}

/* Gilded edge: the most recognisable Hagler detail. One row per view. */
.chip, .tile, .tooltip, .tip-card, .dd-list, .chart .tip { position: relative; }
.chip::before, .tile::before, .tooltip::before, .chart .tip::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--gilt); pointer-events: none;
}
.chip { background: rgba(27, 29, 33, .88); }
.chip .v, .tile .value { font-variant-numeric: tabular-nums; }
.tile { background: var(--raised); }
.tooltip { background: rgba(27, 29, 33, .98); }
.tip-name { font: 400 17px/1.25 var(--display); }

/* Cards, tables, lists */
.card { border-radius: var(--radius); }
.side, .results-pane .scroll, .searchbar input { border-radius: var(--radius); }
.tree button.on { background: rgba(226, 182, 84, .10); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.tree button.on .n { color: var(--accent); }
td { border-bottom-color: rgba(47, 50, 56, .6); }
tbody tr:nth-child(even), .movers li:nth-child(even) { background: rgba(237, 230, 214, .025); }
tbody tr:hover, .movers li:hover { background: rgba(226, 182, 84, .06); }
.browse-table th { background: var(--raised); }
.browse-table th[aria-sort="ascending"], .browse-table th[aria-sort="descending"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.icon { border-radius: 0; }
.icon.huge { border-radius: 0; }
.qb1 { border-color: #5A564D; } .qb6 { border-color: var(--q6); } .qb6::before { color: var(--q6); }
.facts > span { background: var(--raised); }
.tabs button { font: 400 14px var(--display); padding: 8px 2px; }
.tabs button[aria-selected="true"] { background: var(--glow); }
.pill { border-radius: var(--radius-sm); }
.pill.gold { background: rgba(226, 182, 84, .14); }
.dot-up, .dot-down { width: 9px; height: 10px; border-radius: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.dd-list { border-radius: var(--radius); }
.dd-list li.active { background: rgba(226, 182, 84, .08); }
.fav.on, .fav-big.on { color: var(--accent); }

/* Charts: gold main series, info blue second, iron volume, horizontal grid only */
.chart .grid line { stroke: var(--border); stroke-opacity: .5; }
.chart .axis text, .gold-chart text { font-variant-numeric: tabular-nums; }
.chart .tip { background: var(--raised); }
.chart .tip .label { margin-bottom: 2px; }
.legend .med { color: var(--accent); } .legend .qty { color: var(--iron-light); }

/* States: loading pulses the emblem; empty shows a faint outline hex and the next step */
.loading { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); padding: 16px 0; }
.loading svg { width: 28px; height: 28px; animation: hg-pulse 1.6s ease-in-out infinite; }
td.empty-load { padding: 12px 16px; }
@keyframes hg-pulse { 0%, 100% { opacity: .55; filter: brightness(.85); } 50% { opacity: 1; filter: brightness(1.15); } }
@media (prefers-reduced-motion: reduce) { .loading svg { animation: none; } }
.empty::before {
  content: ""; display: inline-block; width: 13px; height: 15px; margin-right: 10px; vertical-align: -2px; opacity: .8;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 30'%3E%3Cpath d='M13 1.5 24.5 8v14L13 28.5 1.5 22V8Z' fill='none' stroke='%236A6558' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.notice { border-radius: var(--radius); }

/* Footer */
.foot { border-top-color: var(--border); }
.foot-mark { width: 12px; height: 12px; vertical-align: -1px; margin-right: 8px; }
@media (max-width: 640px) {
  .mainnav { margin-left: 0; }
  .mainnav a { padding: 6px 0; }
  .hero h1 { font-size: 28px; }
}

/* ---------------------------------------------------------------- 0.7.0 farms */
.searchbar.small input { height: 34px; font-size: 14px; padding-left: 36px; width: 220px; background: var(--bg); }
.searchbar.small svg { left: 11px; width: 16px; height: 16px; }
.board-wrap { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr auto; gap: 6px; margin-bottom: 24px; }
.axis-y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; color: var(--muted); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.axis-x { grid-column: 2; text-align: right; color: var(--muted); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cell {
  --tint: var(--muted);
  display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tint) 14%, transparent), transparent 70%), var(--panel);
  border: 1px solid var(--border); border-top: 2px solid color-mix(in srgb, var(--tint) 70%, transparent); border-radius: var(--radius); padding: 12px 14px; min-height: 150px;
  transition: border-color var(--ease), transform var(--ease);
}
.cell:hover:not(:disabled) { border-color: color-mix(in srgb, var(--tint) 60%, var(--border)); transform: translateY(-1px); }
.cell.on { border-color: var(--tint); box-shadow: 0 0 0 1px var(--tint) inset; }
.cell:disabled { opacity: .45; cursor: default; }
.c-high-low { --tint: #4CC38A; } .c-high-mid { --tint: #8FCB5A; } .c-high-high { --tint: #E2B654; }
.c-mid-low { --tint: #6FB3A0; } .c-mid-mid { --tint: #B8A46A; } .c-mid-high { --tint: #E8A33D; }
.c-low-low { --tint: #7D8794; } .c-low-mid { --tint: #9A7F6A; } .c-low-high { --tint: #E5534B; }
.cell-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cell-tags span { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; }
.cell-title { font: 400 19px/1.2 var(--display); color: var(--tint); }
.cell-blurb { color: var(--muted); font-size: 12px; }
.cell-top { display: grid; gap: 2px; margin-top: 4px; font-size: 12.5px; }
.cell-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-top em { font-style: normal; color: var(--gold); font-family: var(--head); margin-left: 4px; }
.cell-n { margin-top: auto; padding-top: 6px; color: var(--muted); font-size: 12px; }
.list-head { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 12px; }
.list-head h2 { margin: 0; }
#farm-list { display: grid; gap: 12px; }
.farm { border-left: 3px solid var(--tint, var(--border)); }
.farm-main { display: grid; grid-template-columns: minmax(0, 1fr) 190px 190px; gap: 16px; align-items: center; margin-bottom: 10px; }
.farm h3 { font: 400 20px/1.2 var(--display); margin: 0 0 4px; }
.farm-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text); font-size: 13px; }
.rank { font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; border: 1px solid; }
.rank.r1 { color: var(--warn); } .rank.r2 { color: var(--bad); } .rank.r4 { color: var(--info); }
.farm-gph .big { font: 600 24px var(--head); }
.small { font-size: 12px; }
.dots { display: flex; gap: 4px; margin: 4px 0; }
.dots i { width: 14px; height: 6px; border-radius: 3px; background: var(--border); }
.dots i.on { background: var(--warn); }
.dots.p-low i.on { background: var(--good); } .dots.p-high i.on { background: var(--bad); }
.drops { margin-top: 4px; }
.drops td { height: 34px; padding: 3px 8px; }
.drops .icon { width: 22px; height: 22px; }
.drops td.name a { color: inherit; }
.chance { font-family: var(--head); font-weight: 600; font-size: 15px; color: var(--accent); }
.drops tr.extra td { border-bottom: 0; }
.more-drops { margin-top: 8px; }
.why { margin: 8px 0 0; }
@media (max-width: 900px) {
  .farm-main { grid-template-columns: 1fr 1fr; }
  .farm-name { grid-column: 1 / -1; }
  .cell { min-height: 0; }
  .cell-top, .cell-blurb { display: none; }
}
@media (max-width: 640px) {
  .board { gap: 6px; }
  .cell { padding: 8px; }
  .cell-title { font-size: 14px; }
  .cell-tags { display: none; }
  .searchbar.small input { width: 100%; }
  .searchbar.small { flex: 1 1 100%; }
}

/* 0.8.0 farms by profession */
.prof-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.prof-tabs button { background: var(--bg); border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 0 14px; height: 32px; font: 500 13px var(--body); cursor: pointer; }
.prof-tabs button:hover { color: var(--text); background: var(--raised); }
.prof-tabs button[aria-pressed="true"] { color: #0F1216; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.ptag { display: inline-block; vertical-align: middle; margin-left: 6px; font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; line-height: 18px; white-space: nowrap; }
.ptag.rec { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.recipe-name .ptag { margin-left: 0; }
#rec-list { display: grid; gap: 12px; }
#recipes-view .list-head { flex-wrap: wrap; }
#recipes-view .list-head .seg { margin-left: auto; }
.recipe-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.recipe-name a { color: inherit; font-weight: 600; }
.recipe-name .muted { margin-top: 4px; }
.recipe-price { text-align: right; }
.recipe-price .big { font: 600 20px var(--head); }
.sources { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.sources li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.stag { font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; padding: 0 7px; border-radius: 4px; line-height: 18px; min-width: 56px; text-align: center; }
.stag.drop { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.stag.vendor { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
.fac.fA { color: #6C9BE0; } .fac.fH { color: #E0706A; }
@media (max-width: 640px) { .recipe-head { grid-template-columns: 1fr; } .recipe-price { text-align: left; } #recipes-view .list-head .seg { margin-left: 0; } }
