/*
 * HelmIT WoW dashboard theme. WoW-flavored (gold accents, serif display type, item quality and class colors)
 * but kept quiet so the numbers lead. Dark and light both work; "auto" follows the system.
 * Chart series tokens follow the dataviz reference palette; dark steps are selected, not flipped.
 * The page's CSP allows only this stylesheet: no inline style attributes anywhere (JS sets el.style only).
 */
:root {
  color-scheme: light;
  --page: #f4eedf;
  --page-glow: rgba(196, 138, 20, 0.10);
  --surface-1: #fffcf4;
  --surface-2: #f4ecda;
  --surface-3: #e9dec5;
  --border: rgba(70, 50, 20, 0.13);
  --border-strong: rgba(168, 115, 10, 0.45);
  --shadow: 0 1px 2px rgba(60, 40, 10, 0.06), 0 6px 20px rgba(60, 40, 10, 0.06);
  --text-primary: #231c10;
  --text-secondary: #5f5444;
  --text-muted: #8b7f69;
  --gold: #a8730a;
  --gold-strong: #c48a14;
  --gold-ink: #fff8e6;
  --gold-soft: rgba(168, 115, 10, 0.12);
  --grid: #e6dcc6;
  --axis: #cbbd9e;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --neg: #e34948;
  --up: #1b7f2e;
  --down: #c43535;
  --up-soft: rgba(27, 127, 46, 0.12);
  --down-soft: rgba(196, 53, 53, 0.12);
  --q0: #6f6f6f; --q1: #231c10; --q2: #198c0b; --q3: #0060c0; --q4: #7a26c0; --q5: #b35500; --q6: #8c6d1f; --q7: #007a99;
  --skeleton: #ece2cc;
  --skeleton-hi: #f7f0e0;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0c0e13;
    --page-glow: rgba(232, 180, 76, 0.07);
    --surface-1: #151922;
    --surface-2: #1d2230;
    --surface-3: #262c3c;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(232, 180, 76, 0.40);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --text-primary: #ede6d3;
    --text-secondary: #b3aa94;
    --text-muted: #7f7865;
    --gold: #e8b44c;
    --gold-strong: #f6cf74;
    --gold-ink: #1a1408;
    --gold-soft: rgba(232, 180, 76, 0.12);
    --grid: #262b38;
    --axis: #3a4152;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --neg: #e66767;
    --up: #4cc36e;
    --down: #f06a6a;
    --up-soft: rgba(76, 195, 110, 0.14);
    --down-soft: rgba(240, 106, 106, 0.14);
    --q0: #9d9d9d; --q1: #ede6d3; --q2: #3fdc2a; --q3: #4aa3ff; --q4: #b866ff; --q5: #ff8a1c; --q6: #e6cc80; --q7: #00ccff;
    --skeleton: #1c2130;
    --skeleton-hi: #262c3c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0c0e13;
  --page-glow: rgba(232, 180, 76, 0.07);
  --surface-1: #151922;
  --surface-2: #1d2230;
  --surface-3: #262c3c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(232, 180, 76, 0.40);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --text-primary: #ede6d3;
  --text-secondary: #b3aa94;
  --text-muted: #7f7865;
  --gold: #e8b44c;
  --gold-strong: #f6cf74;
  --gold-ink: #1a1408;
  --gold-soft: rgba(232, 180, 76, 0.12);
  --grid: #262b38;
  --axis: #3a4152;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --neg: #e66767;
  --up: #4cc36e;
  --down: #f06a6a;
  --up-soft: rgba(76, 195, 110, 0.14);
  --down-soft: rgba(240, 106, 106, 0.14);
  --q0: #9d9d9d; --q1: #ede6d3; --q2: #3fdc2a; --q3: #4aa3ff; --q4: #b866ff; --q5: #ff8a1c; --q6: #e6cc80; --q7: #00ccff;
  --skeleton: #1c2130;
  --skeleton-hi: #262c3c;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background-color: var(--page);
  background-image: radial-gradient(1200px 520px at 50% -180px, var(--page-glow), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text-primary);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.app { max-width: 1240px; margin: 0 auto; padding: 0 20px 40px; }
h1, h2, .display {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif;
  letter-spacing: 0.01em;
}
h1 { font-size: 20px; margin: 0; font-weight: 700; }
h2 { font-size: 16px; margin: 0; font-weight: 700; }
h3 { font-size: 13px; margin: 0; font-weight: 600; color: var(--text-secondary); }
p { margin: 0; }
a { color: var(--gold); }
.muted { color: var(--text-secondary); }
.small { font-size: 12px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
svg.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- controls ---------- */
button, .btn {
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  color: var(--gold-ink);
  font-weight: 600;
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: filter 0.15s, background-color 0.15s, border-color 0.15s;
}
button:hover { filter: brightness(1.06); }
button.ghost, .seg button, button.link, button.chip {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
  font-weight: 500;
}
button.ghost:hover, button.chip:hover { background: var(--surface-2); filter: none; }
button.icon-only { padding: 7px; }
button.link { border: 0; padding: 0; color: var(--text-primary); font-weight: 500; text-align: left; }
button.link:hover { text-decoration: underline; filter: none; }
button.textlink { background: none; border: 0; padding: 2px 4px; color: var(--text-secondary); font-size: 12px; font-weight: 500; }
button.textlink:hover { color: var(--gold); filter: none; }
button.chip { border-radius: 999px; padding: 4px 12px; font-size: 13px; background: var(--surface-1); }
button:disabled { opacity: 0.55; cursor: default; filter: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
input, select {
  font: inherit;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
}
input:focus, select:focus { border-color: var(--border-strong); }
input[type="checkbox"] { accent-color: var(--gold); width: 15px; height: 15px; padding: 0; vertical-align: -2px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0 12px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, var(--page) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .tagline { color: var(--text-muted); font-size: 12px; }
svg.emblem { width: 40px; height: 40px; flex: none; }
svg.emblem.big { width: 72px; height: 72px; }
.em-rim { fill: var(--gold); }
.em-face { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.5; }
.em-mark { fill: none; stroke: var(--gold-strong); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.em-gem { fill: var(--gold-strong); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.syncpill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  max-width: 420px;
}
.syncpill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); flex: none; }
.syncpill.ok::before { background: var(--up); }
.syncpill.warn::before { background: var(--down); }
.syncpill.busy::before { background: var(--gold); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 10px 12px 11px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 500;
}
.tabs a:hover { color: var(--text-primary); }
.tabs a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }
.filters { display: flex; gap: 8px; align-items: center; padding: 6px 0; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-1); }
.seg button { border: 0; border-radius: 0; padding: 5px 11px; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-checked="true"] { background: var(--gold-soft); color: var(--gold); font-weight: 600; }

/* ---------- page furniture ---------- */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.pagehead h2 { font-size: 22px; }
.pagehead p { color: var(--text-secondary); margin-top: 2px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  min-width: 0;
  box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.card-head .sub { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.card-head .tools { display: flex; gap: 4px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 { margin-bottom: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-main > .card, .stack > .card { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.note { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.error { color: var(--down); margin: 12px 0; }

/* hero */
.hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.6fr);
  gap: 24px;
  align-items: center;
  border-color: var(--border-strong);
  background-image: linear-gradient(135deg, var(--gold-soft), transparent 55%);
  padding: 20px 22px;
}
.hero .label { color: var(--text-secondary); font-size: 13px; }
.hero .value { font-size: 40px; font-weight: 700; line-height: 1.15; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--text-muted); font-size: 12px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
.tile .top { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 500; }
.tile .badge-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold);
}
.tile .badge-icon svg { width: 15px; height: 15px; }
.tile .value { font-size: 22px; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tfoot { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 2px; color: var(--text-muted); min-height: 18px; }
.tile svg.spark { position: absolute; right: 12px; top: 14px; width: 84px; height: 26px; }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.up { color: var(--up); background: var(--up-soft); }
.delta.down { color: var(--down); background: var(--down-soft); }
.delta.flat { color: var(--text-secondary); background: var(--surface-2); }

/* money with coin marks */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.neg { color: var(--down); }
.coin { display: inline-flex; align-items: center; }
.coin + .coin { margin-left: 0.4em; }
.coin::after {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  margin-left: 0.2em;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.coin.g::after { background: radial-gradient(circle at 35% 30%, #fff1b8, #e8b923 55%, #9c6f00); }
.coin.s::after { background: radial-gradient(circle at 35% 30%, #ffffff, #c4ccd6 55%, #7c8590); }
.coin.c::after { background: radial-gradient(circle at 35% 30%, #ffd2b0, #c56b32 55%, #7a3b14); }

/* item quality and class colors */
.item { font-weight: 600; }
.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); } .q7 { color: var(--q7); }
.sub .item { font-weight: 500; }
.idtag { color: var(--text-muted); font-size: 11px; font-weight: 500; margin-left: 6px; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-weight: 700;
  font-size: 18px;
  color: #17130b;
  background: var(--surface-3);
  border: 1px solid rgba(0, 0, 0, 0.18);
  flex: none;
}
.cls-WARRIOR { background: #c69b6d; } .cls-PALADIN { background: #f48cba; } .cls-HUNTER { background: #aad372; }
.cls-ROGUE { background: #fff468; } .cls-PRIEST { background: #f4f4f4; } .cls-SHAMAN { background: #0070dd; color: #fff; }
.cls-MAGE { background: #3fc7eb; } .cls-WARLOCK { background: #8788ee; } .cls-DRUID { background: #ff7c0a; }
.cls-DEATHKNIGHT { background: #c41e3a; color: #fff; } .cls-MONK { background: #00ff98; } .cls-DEMONHUNTER { background: #a330c9; color: #fff; }
.cls-EVOKER { background: #33937f; color: #fff; }

.charlist { display: flex; flex-direction: column; }
.char { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--grid); }
.char:first-child { border-top: 0; padding-top: 2px; }
.char .name { font-weight: 700; font-size: 15px; }
.char .sub { color: var(--text-secondary); font-size: 12px; }
.char .gold { text-align: right; font-weight: 600; }
.char .gold .sub { font-weight: 400; }
.profs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.prof { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-secondary); min-width: 110px; }
.meter { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--gold); border-radius: 2px; }

/* compact lists (overview) */
.minilist { list-style: none; margin: 0; padding: 0; }
.minilist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--grid); }
.minilist li:first-child { border-top: 0; }
.minilist .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.minihead { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 10px 0 2px; font-weight: 600; }
.minihead:first-child { margin-top: 0; }

/* badges */
.badge { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--surface-2); color: var(--text-secondary); white-space: nowrap; }
.badge.ok { background: var(--up-soft); color: var(--up); }
.badge.bad { background: var(--down-soft); color: var(--down); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }

/* ---------- tables ---------- */
.dt-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.dt-search { position: relative; flex: 1 1 220px; max-width: 320px; }
.dt-search input { width: 100%; padding-left: 30px; }
.dt-search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 15px; height: 15px; }
.dt-count { color: var(--text-muted); font-size: 12px; }
.tablewrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
th { color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
th button.sort { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; gap: 4px; }
th button.sort:hover { color: var(--text-primary); filter: none; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--gold); }
th .arrow { opacity: 0.35; font-size: 10px; }
th[aria-sort="ascending"] .arrow, th[aria-sort="descending"] .arrow { opacity: 1; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.num button.sort { flex-direction: row-reverse; }
td .sub { color: var(--text-secondary); font-size: 12px; font-weight: 400; }
.dt-more { display: flex; justify-content: center; margin-top: 8px; }
.changebar { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.changebar .track { width: 56px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; display: inline-flex; }
.changebar .fill { height: 100%; border-radius: 3px; }
.changebar.up .fill { background: var(--up); }
.changebar.down .fill { background: var(--down); margin-left: auto; }
.changebar.up { color: var(--up); }
.changebar.down { color: var(--down); }

/* ---------- market search ---------- */
.searchbox { position: relative; max-width: 560px; }
.searchbox input { width: 100%; padding: 10px 12px 10px 36px; font-size: 15px; border-radius: 10px; }
.searchbox > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.listbox {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 8;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
}
.listbox li { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.listbox li[aria-selected="true"], .listbox li:hover { background: var(--surface-2); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.itemhead { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; flex-wrap: wrap; }
.itemhead .icon-box {
  width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-2); border: 2px solid currentColor;
}
.itemhead .icon-box svg { width: 22px; height: 22px; }
.itemhead h3 { font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; font-size: 22px; font-weight: 700; }

/* ---------- charts ---------- */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.key.line { height: 3px; width: 14px; border-radius: 2px; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart text { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg.chart text.label { fill: var(--text-secondary); font-size: 12px; font-variant-numeric: normal; }
svg.chart text.value { fill: var(--text-primary); font-size: 12px; font-weight: 600; }
svg.chart text.label.q0 { fill: var(--q0); } svg.chart text.label.q1 { fill: var(--text-secondary); } svg.chart text.label.q2 { fill: var(--q2); }
svg.chart text.label.q3 { fill: var(--q3); } svg.chart text.label.q4 { fill: var(--q4); } svg.chart text.label.q5 { fill: var(--q5); }
svg.chart text.label.q6 { fill: var(--q6); } svg.chart text.label.q7 { fill: var(--q7); }
.gridline { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 2 4; }
.baseline { stroke: var(--axis); stroke-width: 1; }
.crosshair { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 3 3; }
.s1 { fill: var(--series-1); } .s2 { fill: var(--series-2); } .s3 { fill: var(--series-3); } .s4 { fill: var(--series-4); } .sneg { fill: var(--neg); } .sg { fill: var(--gold); }
.k1 { background: var(--series-1); } .k2 { background: var(--series-2); } .k3 { background: var(--series-3); } .k4 { background: var(--series-4); } .kneg { background: var(--neg); } .kg { background: var(--gold); }
.l1 { stroke: var(--series-1); } .l2 { stroke: var(--series-2); } .l3 { stroke: var(--series-3); } .l4 { stroke: var(--series-4); } .lg { stroke: var(--gold); } .lup { stroke: var(--up); } .ldown { stroke: var(--down); }
.gs1 { stop-color: var(--series-1); } .gs2 { stop-color: var(--series-2); } .gs3 { stop-color: var(--series-3); } .gs4 { stop-color: var(--series-4); } .gsg { stop-color: var(--gold); } .gsup { stop-color: var(--up); } .gsdown { stop-color: var(--down); }
.stop-top { stop-opacity: 0.30; }
.stop-bot { stop-opacity: 0; }
path.line { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
svg.spark path.line { stroke-width: 1.75; }
circle.dot { stroke: var(--surface-1); stroke-width: 2; }
rect.vol { fill: var(--axis); opacity: 0.7; }
g.col:hover rect.vol { opacity: 1; }
.hit { fill: transparent; cursor: default; }
g.col:hover .bar, g.col:focus .bar { opacity: 0.8; }
g.col:focus { outline: none; }

/* ---------- empty, loading, sign-in ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 16px; color: var(--text-secondary); }
.empty .empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); margin-bottom: 4px; }
.empty .empty-icon svg { width: 22px; height: 22px; }
.empty strong { color: var(--text-primary); font-size: 14px; }
.empty p { max-width: 420px; font-size: 13px; }
.empty.small { padding: 16px; }

.skel { background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-hi) 50%, var(--skeleton) 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skel.line { height: 12px; margin: 8px 0; }
.skel.line.w40 { width: 40%; } .skel.line.w60 { width: 60%; } .skel.line.w25 { width: 25%; }
.skel.big { height: 30px; width: 55%; margin: 10px 0 6px; }
.skel.chart { height: 200px; margin-top: 12px; }
main.refreshing .card, main.refreshing .tiles { opacity: 0.55; transition: opacity 0.2s; }

.signin {
  max-width: 520px;
  margin: 72px auto 0;
  text-align: center;
  padding: 36px 32px;
  border-color: var(--border-strong);
  background-image: linear-gradient(180deg, var(--gold-soft), transparent 60%);
}
.signin h2 { font-size: 26px; margin: 14px 0 8px; }
.signin p { color: var(--text-secondary); margin: 0 auto 22px; max-width: 380px; }
.signin ul { list-style: none; padding: 0; margin: 0 0 24px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.ms-logo { width: 16px; height: 16px; }
.ms1 { fill: #f25022; } .ms2 { fill: #7fba00; } .ms3 { fill: #00a4ef; } .ms4 { fill: #ffb900; }
.signin button { padding: 10px 18px; font-size: 15px; }
.loading { display: flex; justify-content: center; padding: 80px 0; color: var(--text-muted); gap: 8px; align-items: center; }

.pagefoot { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- tooltip ---------- */
.tooltip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 8px 10px;
  font-size: 12px;
  min-width: 150px;
}
.tooltip .t-head { color: var(--text-secondary); margin-bottom: 4px; font-weight: 600; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; }
.tooltip .t-row strong { font-variant-numeric: tabular-nums; }
.tooltip .t-row .muted { margin-left: auto; padding-left: 12px; }

@media (max-width: 860px) {
  .grid-main, .hero { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .app { padding: 0 16px 32px; }
  .hero .value { font-size: 32px; }
  .grid2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .tile .value { font-size: 17px; }
  .tile .top { font-size: 11px; }
  .tile .badge-icon { display: none; }
  .char .profs { display: none; }
  .brand .tagline { display: none; }
  #sync span { display: none; }
  .tile svg.spark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .skel, .spin, .syncpill.busy::before { animation: none; }
}
.tile .value .delta { font-size: 19px; padding: 2px 12px; margin-top: 2px; }

/* ---------- trends and flips ---------- */
.line.dash { stroke-dasharray: 5 5; stroke-width: 1.75; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--text-secondary); }
.trend svg { width: 14px; height: 14px; }
.trend.up { color: var(--up); }
.trend.down { color: var(--down); }
.volat { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.volat.steady { background: var(--up-soft); color: var(--up); }
.volat.moderate { background: var(--gold-soft); color: var(--gold); }
.volat.volatile { background: var(--down-soft); color: var(--down); }
.badge.kind-dip { background: var(--gold-soft); color: var(--gold); }
.badge.kind-vendor-sell { background: var(--up-soft); color: var(--up); }
.badge.kind-vendor-resale { background: var(--surface-3); color: var(--text-primary); }
.conf { display: grid; grid-template-columns: 56px auto; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.conf .meter > span { background: var(--gold); }
.conf.high .meter > span { background: var(--up); }
.conf.low .meter > span { background: var(--down); }
.why { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.callout { display: flex; gap: 10px; align-items: flex-start; background: var(--gold-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; color: var(--text-primary); }
.callout svg { width: 18px; height: 18px; color: var(--gold); flex: none; margin-top: 1px; }
.progress-days { display: flex; gap: 4px; margin-top: 6px; }
.progress-days span { width: 18px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.progress-days span.on { background: var(--gold); }
@media (max-width: 560px) {
  .why { display: none; }
}

.itemfacts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: -4px 0 14px; }
