:root {
  --bg: #0b0e14;
  --panel: #131722;
  --panel-2: #1a2030;
  --border: #232b3d;
  --text: #d7dce6;
  --muted: #7c8698;
  --gold: #f5b942;
  --green: #26a69a;
  --red: #ef5350;
  --blue: #4f8cff;
}

/* ---- Themes (8 dark + 2 light) -------------------------------------- */
[data-theme="carbon"] {
  --bg: #111213;
  --panel: #18191b;
  --panel-2: #1f2124;
  --border: #2c2f33;
  --text: #d6d8da;
  --muted: #8a9099;
  --gold: #8ab4f8;
  --green: #34d399;
  --red: #f87171;
  --blue: #60a5fa;
}
[data-theme="bloomberg"] {
  --bg: #0a0803;
  --panel: #12100a;
  --panel-2: #1a160d;
  --border: #33290f;
  --text: #ffd98a;
  --muted: #a68542;
  --gold: #ffb000;
  --green: #00c853;
  --red: #ff5252;
  --blue: #ffb000;
}
[data-theme="nord"] {
  --bg: #242933;
  --panel: #2e3440;
  --panel-2: #3b4252;
  --border: #4c566a;
  --text: #eceff4;
  --muted: #9aa5b6;
  --gold: #ebcb8b;
  --green: #a3be8c;
  --red: #bf616a;
  --blue: #88c0d0;
}
[data-theme="dracula"] {
  --bg: #21222c;
  --panel: #282a36;
  --panel-2: #343746;
  --border: #44475a;
  --text: #f8f8f2;
  --muted: #9aa0b3;
  --gold: #f1fa8c;
  --green: #50fa7b;
  --red: #ff5555;
  --blue: #bd93f9;
}
[data-theme="forest"] {
  --bg: #0c1210;
  --panel: #111a17;
  --panel-2: #16231f;
  --border: #23352f;
  --text: #d3e4dc;
  --muted: #7ba392;
  --gold: #d8b45a;
  --green: #4ade80;
  --red: #f87171;
  --blue: #5eead4;
}
[data-theme="ocean"] {
  --bg: #0a1520;
  --panel: #0f1e2e;
  --panel-2: #14283c;
  --border: #1f3a54;
  --text: #d8e7f5;
  --muted: #7d9cb8;
  --gold: #ffd166;
  --green: #2dd4bf;
  --red: #fb7185;
  --blue: #38bdf8;
}
[data-theme="crimson"] {
  --bg: #140b0e;
  --panel: #1c1014;
  --panel-2: #26161b;
  --border: #3d2229;
  --text: #ecd9de;
  --muted: #a97f8a;
  --gold: #f5b942;
  --green: #34d399;
  --red: #f43f5e;
  --blue: #c084fc;
}

/* v2.1: the roster is dark-only (8 themes). The removed light themes
   "paper" and "solarized" reset to Midnight via static/theme.js. */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }

#topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-coin { color: var(--gold); font-size: 20px; }
.brand-name { font-size: 16px; letter-spacing: .5px; }
.brand-name b { color: var(--gold); }

.brand-col { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.theme-wrap { position: relative; }
.theme-btn {
  padding: 3px 10px;
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.theme-btn:hover { color: var(--text); border-color: var(--gold); }
#theme-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 190px;
  right: auto;
  padding: 4px;
}
.theme-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.theme-row:hover { background: rgba(128,128,128,.15); }
.theme-row.active { background: rgba(245,185,66,.12); }
.theme-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex: none;
}

.shutdown-btn {
  padding: 7px 12px;
  font-size: 12px;
  color: var(--red);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.shutdown-btn:hover { border-color: var(--red); background: rgba(239,83,80,.08); }

.chip-stale {
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
}

#shutdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.shutdown-card { max-width: 420px; text-align: center; padding: 28px; }
.shutdown-card h2 { margin-bottom: 10px; }
.shutdown-card p { margin-bottom: 6px; }

.search-wrap { position: relative; flex: 1; max-width: 520px; }
#search-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
#search-input:focus { border-color: var(--gold); }

.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 380px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.dd-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  cursor: pointer;
}
.dd-row:hover, .dd-row.sel { background: rgba(245,185,66,.12); }
.dd-row img { width: 24px; height: 24px; object-fit: contain; }
.dd-row .dd-id { margin-left: auto; color: var(--muted); font-size: 11px; }

.top-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ctl-label { color: var(--muted); font-size: 12px; }
#refresh-interval {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-bad { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot-off { background: var(--muted); }

#layout {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr 260px;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

#left-panel, #right-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-y: auto;
  min-height: 0;
}

.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.panel-view { padding: 8px; }

.item-list { list-style: none; }

/* Density controls (v2.0 phase 2): comfortable by default, compact trims
   row padding and type across watchlist/portfolio/alerts lists. */
:root {
  --row-pad-y: 6px;
  --row-pad-x: 8px;
  --row-font: 13px;
  --row-sub-font: 11px;
  --row-price-font: 12px;
}
body.density-compact {
  --row-pad-y: 3px;
  --row-pad-x: 6px;
  --row-font: 12px;
  --row-sub-font: 10px;
  --row-price-font: 11px;
}

/* Wide mode (v2.0 phase 2): larger side columns and gutters so dense
   dashboards breathe on big monitors. */
body.wide-mode #layout {
  grid-template-columns: 340px 1fr 320px;
  gap: 16px;
  padding: 16px;
}

/* Accessibility (v2.0 phase 3): visible keyboard focus everywhere and a
   calm mode for users who prefer reduced motion. */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.wl-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: var(--row-pad-y) var(--row-pad-x);
  border-radius: 8px;
  cursor: grab;
}
.wl-row:active { cursor: grabbing; }
.wl-row:hover { background: var(--panel-2); }
.wl-row.selected { background: rgba(245,185,66,.10); outline: 1px solid rgba(245,185,66,.35); }
.wl-row.dragging { opacity: .45; outline: 1px dashed rgba(245,185,66,.5); }
.wl-row img { width: 26px; height: 26px; object-fit: contain; }
.wl-name { font-size: var(--row-font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-sub { font-size: var(--row-sub-font); color: var(--muted); }
.wl-right { text-align: right; }
.wl-price { font-size: var(--row-font); font-weight: 600; transition: color .25s; }
.wl-price.buy,
.wl-price.sell { font-size: var(--row-price-font); line-height: 1.35; }
.wl-price.buy { color: var(--green); }
.wl-price.sell { color: var(--red); }
.wl-arrow { font-size: 10px; margin-right: 3px; }
.wl-arrow.up { color: var(--green); }
.wl-arrow.down { color: var(--red); }
.wl-arrow.eq { color: var(--gold); }
.flash-up { color: var(--green) !important; }
.flash-down { color: var(--red) !important; }
.wl-x {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 2px 4px;
}
.wl-x:hover { color: var(--red); }
/* Armed (confirm-to-remove) state: same footprint, tinted in place.
   No padding/size changes — the hit area must stay exactly the ✕. */
.wl-x.arm {
  background: rgba(239, 83, 80, 0.18);
  color: var(--red);
  border-radius: 4px;
}
.wl-moves { display: flex; flex-direction: column; gap: 1px; }
.wl-move {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 9px; line-height: 1; padding: 1px 3px;
  visibility: hidden;
}
.wl-row:hover .wl-move { visibility: visible; }
.wl-move:hover:not(:disabled) { color: var(--gold); }
.wl-move:disabled { opacity: .25; }
.theme-btn.on { color: var(--gold); border-color: rgba(245,185,66,.55); }
.alert-row {
  display: flex; align-items: center; gap: 6px;
  padding: calc(var(--row-pad-y) - 1px) var(--row-pad-x);
  font-size: var(--row-sub-font);
}

.empty-hint { color: var(--muted); font-size: 12px; padding: 12px; text-align: center; }
#alerts-section h3 { font-size: 12px; color: var(--muted); padding: 10px 8px 4px; text-transform: uppercase; }

.summary {
  margin-top: 10px;
  padding: 10px;
  background: var(--panel-2);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
}

#center-panel { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

#item-hero { display: flex; gap: 14px; align-items: center; }
.item-icon { width: 56px; height: 56px; object-fit: contain; }
/* Icon backing chips (v2.0.3): OSRS sprites are transparent with dark
   outlines that vanish on dark themes. A translucent neutral plate +
   hairline border keeps every icon readable on any theme without
   touching the sprite itself. */
.wl-row img, .mover-row img, .dd-row img, .item-icon {
  background: rgba(127, 127, 127, 0.16);
  border: 1px solid rgba(127, 127, 127, 0.30);
  border-radius: 6px;
}
.dd-row img { border-radius: 4px; }
.hero-main { flex: 1; min-width: 0; }
.hero-main h2 { font-size: 18px; }
.hero-name-row { display: flex; align-items: center; gap: 8px; }
/* Watchlist toggle star beside the item name (v2.0.2): outline ☆ when
   not watching, gold filled ★ when watching. */
.star-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--muted);
}
.star-btn.on { color: var(--gold); text-shadow: 0 0 8px rgba(245, 185, 66, .35); }
.star-btn:hover { transform: scale(1.15); }
.hero-sub { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.chip {
  font-size: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 9px;
  color: var(--muted);
}
.chip-members { color: var(--gold); border-color: rgba(245,185,66,.4); }
.examine { color: var(--muted); font-style: italic; font-size: 12px; margin-top: 6px; }
.hero-price { text-align: right; }
.big-price { font-size: 26px; font-weight: 700; color: var(--gold); }
.today-change { font-size: 13px; margin-top: 2px; }
.live-time { font-size: 11px; color: var(--muted); margin-top: 2px; }

.pos { color: var(--green); }
.neg { color: var(--red); }
.neu { color: var(--muted); }

#spread-card { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.spread-box { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 8px; }
.spread-box.buy { background: rgba(38,166,154,.08); border: 1px solid rgba(38,166,154,.25); }
.spread-box.sell { background: rgba(239,83,80,.08); border: 1px solid rgba(239,83,80,.25); text-align: right; }
.spread-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.spread-value { font-size: 20px; font-weight: 700; }
.spread-box.buy .spread-value { color: var(--green); }
.spread-box.sell .spread-value { color: var(--red); }
.spread-time { font-size: 10px; color: var(--muted); }
.spread-mid { text-align: center; }
.margin-value { display: block; font-size: 17px; font-weight: 700; }

#trend-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trend-chip {
  display: flex; flex-direction: column; align-items: center;
  background: var(--panel-2); border-radius: 8px; padding: 8px 14px; min-width: 74px;
}
.tl { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.tv { font-size: 15px; font-weight: 700; }
.calc-group { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.calc-group label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.calc-group input {
  width: 90px; padding: 6px 8px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 6px; color: var(--text);
}
.calc-out { font-size: 12px; background: var(--panel-2); padding: 6px 10px; border-radius: 6px; }

.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.chart-head h3 { font-size: 14px; }
.range-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.range-btn {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: 12px;
}
.range-btn:hover { color: var(--text); }
.range-btn.active { color: var(--gold); border-color: var(--gold); }
.range-btn.export:hover { color: var(--blue); border-color: var(--blue); }

#chart-wrap { position: relative; height: 320px; }
#price-chart { width: 100%; height: 100%; display: block; }
#chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(10,13,20,.95);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  z-index: 10;
  white-space: nowrap;
}

.volume-section { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.volume-head h3 { color: var(--muted); font-weight: 600; }
.vol-btn.active { color: var(--blue); border-color: var(--blue); }
#volume-wrap { position: relative; height: 130px; }
#volume-chart { width: 100%; height: 100%; display: block; }
#volume-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(10,13,20,.95);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  z-index: 10;
  white-space: nowrap;
}
.chip-pressure-buy { color: var(--green); border-color: rgba(38,166,154,.4); }
.chip-pressure-sell { color: var(--red); border-color: rgba(239,83,80,.4); }

.pf-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

/* Watchlist sort + group chips (v2.0 phase 4) */
.wl-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.wl-controls select {
  flex: 1;
  padding: 6px 8px;
  background: #1a2030;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}
.wl-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.wl-group-chip {
  padding: 2px 10px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.wl-group-chip.on {
  color: var(--gold);
  border-color: rgba(245,185,66,.4);
}
button.wl-group {
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 8px;
  font-size: 10px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
button.wl-group.has {
  border-style: solid;
  color: var(--gold);
  border-color: rgba(245,185,66,.4);
}

.chart-actions { display: flex; gap: 8px; margin-top: 10px; }
.action-btn {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 12px;
}
.action-btn:hover { border-color: var(--gold); }
.action-btn.primary { background: rgba(245,185,66,.15); border-color: var(--gold); color: var(--gold); }
.action-btn.mini {
  padding: 1px 8px;
  font-size: 11px;
  float: right;
}

.alert-form { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.alert-form select, .alert-form input {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 7px 9px;
}
.alert-form input { width: 130px; }

.welcome { text-align: center; padding: 40px 20px; }
.welcome h2 { color: var(--gold); margin-bottom: 10px; }
.welcome p { color: var(--muted); margin: 6px 0; }
.hint-line .pseudo-link { color: var(--blue); cursor: pointer; text-decoration: underline; }

.movers-card h3 { font-size: 13px; margin-bottom: 8px; }
.movers-card h4 { font-size: 11px; text-transform: uppercase; margin: 10px 0 4px; letter-spacing: .5px; }
.gain-head { color: var(--green); }
.lose-head { color: var(--red); }
.mover-list { list-style: none; }
.mover-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.mover-row:hover { background: var(--panel-2); }
.mover-row img { width: 20px; height: 20px; object-fit: contain; }
.mover-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mover-pct { font-weight: 700; }

#footer {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 16px; border-top: 1px solid var(--border); background: var(--panel);
}
.diag-badge { font-size: 12px; cursor: pointer; color: var(--green); }
.diag-badge.has-errors { color: var(--red); }

#toast-container {
  position: fixed; bottom: 44px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--panel-2); border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
  max-width: 340px; box-shadow: 0 6px 20px rgba(0,0,0,.5);
  animation: slide-in .25s ease;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--gold); }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

#modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
#modal { width: min(560px, 92vw); max-height: 80vh; overflow-y: auto; }
#modal h3 { color: var(--gold); margin-bottom: 10px; }
#modal label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 4px;
}
#modal input,
#modal select {
  width: 100%;
  padding: 8px;
  background: #1a2030;
  border: 1px solid #232b3d;
  border-radius: 6px;
  color: #d7dce6;
  box-sizing: border-box;
}
#modal .modal-row2 { display: flex; gap: 8px; }
#modal .modal-row2 > div { flex: 1; }
#modal button[type="submit"] { margin-top: 14px; width: 100%; }
#tx-history h4 { color: var(--gold); margin: 16px 0 6px; font-size: 13px; }
.log-entry { font-size: 11px; padding: 4px 0; border-bottom: 1px solid var(--border); font-family: Consolas, monospace; }
.log-entry .lv-ERROR { color: var(--red); }
.log-entry .lv-WARNING { color: var(--gold); }
.modal-close { float: right; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- v1.1.3: LIVE badge, seed strip, storage modal ------------------- */
.chip-live {
  color: var(--green);
  border-color: var(--green);
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.seed-strip {
  margin: 0 0 8px 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-2);
}
.seed-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.seed-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--gold);
  transition: width .4s ease;
}
.seed-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.wl-row.seeding { position: relative; overflow: hidden; }
.wl-row.seeding::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%,
    rgba(245, 185, 66, 0.10) 50%, transparent 70%);
  animation: seed-shimmer 1.4s linear infinite;
  pointer-events: none;
}
@keyframes seed-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.wl-row.seed-failed {
  cursor: pointer;
  outline: 1px dashed var(--red);
  outline-offset: -1px;
}
.wl-row.seed-failed:hover { background: rgba(239, 83, 80, 0.08); }

.storage-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}
.storage-table td, .storage-table th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
}
.storage-table th { color: var(--muted); font-weight: 600; }
.storage-table td.num { text-align: right; font-family: Consolas, monospace; }
.storage-total td { font-weight: 700; border-bottom: none; }

/* ==========================================================================
   v1.1.6 UI animation pass. Everything here is compositor-friendly
   (transform/opacity only) and disabled under prefers-reduced-motion.
   ========================================================================== */

/* Theme crossfade: panels/cards/inputs morph between palettes. Canvas
   charts still snap (they read CSS vars at draw time). */
body,
#topbar,
#left-panel,
#right-panel,
.card,
#search-input,
.alert-form select,
.alert-form input,
.calc-group input {
  transition: background-color .35s ease, color .35s ease,
    border-color .35s ease;
}

/* Button micro-interactions: hover lift + press-down. */
.range-btn,
.action-btn,
.wl-x,
.theme-btn,
.shutdown-btn {
  transition: transform .12s ease, border-color .15s ease,
    background-color .15s ease, color .15s ease;
}
.range-btn:hover,
.action-btn:hover,
.wl-x:hover,
.theme-btn:hover {
  transform: translateY(-1px);
}
.range-btn:active,
.action-btn:active,
.wl-x:active,
.theme-btn:active,
.shutdown-btn:active {
  transform: scale(.96);
}

/* Modal open: backdrop fades, card scales in. */
#modal-backdrop { animation: backdrop-in .18s ease both; }
#modal { animation: modal-in .18s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(.96) translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Watchlist direction arrows pop when the trend flips. */
.wl-arrow.pop { animation: arrow-pop .45s cubic-bezier(.2,.9,.3,1.4); }
@keyframes arrow-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* Movers rows cascade in when the data changes. */
.mover-row.anim { animation: row-in .22s ease both; }
@keyframes row-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: none; }
}

/* Search dropdown results cascade per keystroke. */
.dd-row.anim { animation: dd-in .16s ease both; }
@keyframes dd-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #modal-backdrop,
  #modal,
  .wl-arrow.pop,
  .mover-row.anim,
  .dd-row.anim {
    animation: none;
  }
  body,
  #topbar,
  #left-panel,
  #right-panel,
  .card,
  #search-input,
  .alert-form select,
  .alert-form input,
  .calc-group input,
  .range-btn,
  .action-btn,
  .wl-x,
  .theme-btn,
  .shutdown-btn {
    transition: none;
  }
}

/* ---- v2.0.7: remote-aware shutdown + What's New patch notes ---------- */
body.remote #btn-shutdown {
  display: none;
}

.whatsnew-btn {
  position: relative;
}

.whatsnew-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.pn-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.pn-version {
  color: var(--gold);
  font-weight: 700;
  font-size: 1.1em;
}

.pn-meta {
  color: var(--muted);
  font-size: 0.85em;
}

.pn-section h4 {
  margin: 12px 0 4px;
  color: var(--text);
}

.pn-section ul {
  margin: 0 0 8px 18px;
  padding: 0;
}

.pn-section li {
  margin: 3px 0;
  line-height: 1.45;
}

details.pn-history {
  border-top: 1px solid var(--border);
  padding: 8px 2px 2px;
}

details.pn-history summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9em;
}

details.pn-history summary:hover {
  color: var(--text);
}
.pn-old { margin-top: 6px; }

/* ---- v2.0.8: LootVex landing page ------------------------------------ */
body.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
}

.lv-hero {
  max-width: 760px;
  text-align: center;
  padding: 64px 0 24px;
}

.lv-brand-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
}

.lv-mark { color: var(--gold); font-size: 1.6em; }

.lv-hero h1 {
  font-size: 2.4em;
  letter-spacing: 1px;
}

.lv-hero h1 span { color: var(--gold); }
.lv-hero h1 small { color: var(--muted); font-size: 0.45em; }

.lv-tag {
  color: var(--gold);
  font-size: 1.05em;
  margin: 6px 0 14px;
}

.lv-intro {
  color: var(--text);
  line-height: 1.6;
  opacity: 0.92;
}

.lv-banner {
  margin: 26px auto 0;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}

.lv-banner-head { color: var(--text); font-weight: 600; }
.lv-banner-sub { color: var(--muted); font-size: 0.85em; margin-top: 4px; }

.lv-bar {
  height: 6px;
  border-radius: 4px;
  background: rgba(127,127,127,.18);
  margin-top: 8px;
  overflow: hidden;
}

.lv-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
}

.lv-main { width: 100%; max-width: 860px; flex: 1; }

.lv-section { padding: 26px 0; }
.lv-section h2 {
  font-size: 1.15em;
  color: var(--text);
  margin-bottom: 14px;
}

.lv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.lv-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 16px;
  transition: transform .12s ease, border-color .12s ease;
}

button.lv-card { cursor: pointer; font: inherit; }

a.lv-tool {
  color: inherit;
  text-decoration: none;
}

.lv-game:hover, a.lv-tool:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
}

.lv-soon {
  opacity: 0.45;
  border-style: dashed;
  justify-content: center;
}

.lv-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9em;
  color: var(--muted);
  background: rgba(127,127,127,.16);
  border: 1px solid rgba(127,127,127,.30);
  border-radius: 12px;
  overflow: hidden;
}

.lv-icon img {
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
}

.lv-icon.fallback::before { content: "\2694"; color: var(--gold); }
.lv-icon-rs3.fallback::before { content: "\2694\FE0F"; }
.lv-icon-coin.fallback::before { content: "\1FA99"; }

.lv-card-name { font-weight: 700; color: var(--text); }
.lv-card-sub { color: var(--muted); font-size: 0.85em; }

.lv-desc {
  color: var(--text);
  opacity: 0.85;
  font-size: 0.88em;
  line-height: 1.5;
}

.lv-launch {
  margin-top: 8px;
  color: var(--gold);
  font-weight: 700;
}

.lv-back {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0 0 10px;
}
.lv-back:hover { color: var(--text); }

.lv-footer {
  width: 100%;
  max-width: 860px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85em;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.lv-footer a { color: var(--gold); text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .lv-game:hover, a.lv-tool:hover { transform: none; }
}

/* ==== v2.1: Front Door Glow-Up ========================================= */

/* ---- Remote visitors: hide destructive/local-only controls ------------ */
body.remote #btn-shutdown { display: none; }
body.remote #btn-storage { display: none; }

/* ---- v2.1.1: landing page must scroll ----------------------------------
   The tracker's global app-layout body rule (height:100vh +
   overflow:hidden) clamps every page; restore normal document flow on
   the landing page so the ticker/patch sections stay reachable. */
body.landing {
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ---- Tracker: Home link-button in top controls ------------------------ */
#btn-home {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ---- Landing: ambient dust canvas + stacking order --------------------- */
#lv-dust {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
body.landing > header,
body.landing > main,
body.landing > footer,
body.landing > #lv-ticker { position: relative; z-index: 1; }

/* ---- Landing: theme picker (fixed top-right) --------------------------- */
.lv-themewrap {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 20;
}
/* Open leftward with room for long labels ("Bloomberg Amber") instead of
   inheriting the tracker's shrink-to-button .dropdown geometry. */
.lv-themewrap #lv-theme-menu {
  min-width: 200px;
  left: auto;
  right: 0;
}
.lv-themewrap .dd-row { white-space: nowrap; }
@media (max-width: 640px) {
  .lv-themewrap { top: 10px; right: 10px; }
  .lv-hero { padding-top: 84px; }
}

/* ---- Landing: live market ticker --------------------------------------- */
.lv-ticker {
  width: 100%;
  max-width: 980px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  margin-top: 18px;
  padding: 7px 0;
  white-space: nowrap;
}
.lv-ticker-track {
  display: inline-block;
  animation: lv-scroll 40s linear infinite;
}
.lv-ticker:hover .lv-ticker-track { animation-play-state: paused; }
.lv-chip {
  display: inline-block;
  margin: 0 14px;
  font-size: .88em;
}
.lv-chip b { color: var(--text); font-weight: 600; }
.lv-chip-up { color: var(--green); }
.lv-chip-down { color: var(--red); }
.lv-warm {
  text-align: center;
  color: var(--muted);
  font-size: .85em;
  padding: 0 12px;
}
@keyframes lv-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---- Landing: RS3 wide banner card -------------------------------------- */
.lv-game-banner {
  width: 100%;
  height: 84px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 160% at 50% 10%,
      rgba(245,185,66,.16), rgba(13,18,32,0) 60%);
  border: 1px solid rgba(127,127,127,.25);
  overflow: hidden;
}
.lv-game-banner img {
  max-height: 56px;
  max-width: min(240px, 70%);
  object-fit: contain;
}
button.lv-card.active-game { border-color: var(--gold); }
.lv-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: .82em;
  font-weight: 600;
}
.lv-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: lv-pulse 1.6s ease-in-out infinite;
}
@keyframes lv-pulse {
  0%, 100% { opacity: .45; transform: scale(.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* ---- Landing: patch notes section --------------------------------------- */
.lv-patch {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.lv-patch h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 1em;
  color: var(--text);
  margin-bottom: 10px;
}
.lv-patch .pn-version {
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}
.lv-patch .pn-section h4 {
  color: var(--text);
  font-size: .92em;
  margin: 10px 0 4px;
}
.lv-patch .pn-section ul {
  margin: 0 0 4px 18px;
  color: var(--text);
  opacity: .88;
  font-size: .9em;
  line-height: 1.55;
}
.lv-patch details.pn-history { margin-top: 12px; }
.lv-patch details.pn-history summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .85em;
}
.lv-patch details.pn-history summary:hover { color: var(--text); }
.lv-patch .pn-old { margin-top: 4px; }

/* ---- Landing: micro-interactions ---------------------------------------- */
a.lv-tool, button.lv-card { position: relative; overflow: hidden; }
.lv-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg, transparent 30%,
    rgba(245,185,66,.08) 48%,
    rgba(255,255,255,.05) 52%,
    transparent 70%);
  transform: translateX(-120%);
  transition: transform .5s ease;
  pointer-events: none;
}
.lv-card:hover::after { transform: translateX(120%); }
.lv-icon-coin img { transition: transform .3s ease; }
a.lv-tool:hover .lv-icon-coin img,
button.lv-card:hover .lv-icon-coin img { transform: rotate(-12deg); }
.lv-launch { transition: transform .15s ease; }
a.lv-tool:hover .lv-launch { transform: translateX(4px); }

/* ---- Landing: entrance + scroll reveal ----------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.lv-hero h1 { animation: fadeUp .55s ease both; }
.lv-hero .lv-tag { animation: fadeUp .55s .12s ease both; }
.lv-hero .lv-intro { animation: fadeUp .55s .22s ease both; }
.lv-hero .lv-banner { animation: fadeUp .55s .34s ease both; }
.reveal { opacity: 0; transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Milestone bar fill animation */
.lv-bar-fill { transition: width 1s ease; }

/* ---- Reduced motion: kill everything decorative -------------------------- */
@media (prefers-reduced-motion: reduce) {
  .lv-ticker-track { animation: none; }
  .lv-ticker { overflow-x: auto; }
  .lv-live::before { animation: none; }
  .lv-hero h1, .lv-hero .lv-tag, .lv-hero .lv-intro, .lv-hero .lv-banner {
    animation: none;
  }
  .reveal { opacity: 1; transform: none; transition: none; }
  #lv-dust { display: none; }
}
