:root {
  --bg: #070b14;
  --bg-elevated: #0d1220;
  --surface: #111827;
  --surface-hover: #1a2336;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #f59e0b;
  --accent-dim: rgba(245, 158, 11, 0.15);
  --up: #34d399;
  --up-bg: rgba(52, 211, 153, 0.1);
  --down: #fb7185;
  --down-bg: rgba(251, 113, 133, 0.1);
  --info: #60a5fa;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 158, 11, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(96, 165, 250, 0.06), transparent),
    var(--bg);
  line-height: 1.5;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 200px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tag {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.league-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill {
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.status-pill.ok {
  color: var(--up);
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--up-bg);
}

/* Game toggle */
.game-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.game-btn {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.game-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.nav-btn.hidden {
  display: none;
}

.mover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.priority-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.priority-badge.pri-high {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent);
}

.priority-badge.pri-med {
  background: rgba(96, 165, 250, 0.15);
  color: var(--info);
}

.priority-badge.pri-low {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-dim);
}

.mover-score {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

.loop-row {
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.loop-row h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.loop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.loop-chip {
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--mono);
}

.path-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.path-card {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.path-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.path-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.path-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.phase-banner {
  padding: 12px 16px;
  margin-bottom: 14px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.playbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.playbook-card {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.playbook-card h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.playbook-card.pri-high {
  border-color: rgba(34, 197, 94, 0.45);
}

.exchange-card {
  border-left: 3px solid var(--accent);
}

/* poe.watch-inspired exchange UI */
.pw-exchange-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.pw-currency-card {
  padding: 12px 14px;
  background: linear-gradient(145deg, rgba(30, 27, 46, 0.95), rgba(22, 20, 34, 0.98));
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}

.pw-currency-card:hover {
  border-color: rgba(168, 85, 247, 0.55);
  transform: translateY(-1px);
}

.pw-currency-card.up {
  box-shadow: inset 3px 0 0 rgba(34, 197, 94, 0.65);
}

.pw-currency-card.down {
  box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.65);
}

.pw-currency-card.flat {
  box-shadow: inset 3px 0 0 rgba(148, 163, 184, 0.45);
}

.pw-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pw-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.pw-icon-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
}

.pw-card-main {
  flex: 1;
  min-width: 0;
}

.pw-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pw-meta {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: capitalize;
}

.pw-trend {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--mono);
  white-space: nowrap;
}

.pw-trend-up,
.pw-trend.up {
  color: var(--up);
}

.pw-trend-down,
.pw-trend.down {
  color: var(--down);
}

.pw-trend-flat,
.pw-trend.flat {
  color: var(--text-dim);
}

.pw-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.pw-price {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
}

.pw-vol {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.pw-sparkline {
  display: block;
  opacity: 0.9;
}

.pw-sparkline-empty {
  width: 88px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.pw-low-conf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent);
  font-size: 0.62rem;
  vertical-align: middle;
}

.pw-detail-panel {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius);
}

.pw-detail-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pw-detail-head-left .pw-item-icon {
  width: 48px;
  height: 48px;
}

.pw-ext-link {
  font-size: 0.75rem;
  color: #c084fc;
  text-decoration: none;
}

.pw-ext-link:hover {
  text-decoration: underline;
}

.pw-sparkline-wrap {
  margin: 12px 0;
  padding: 16px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pw-sparkline-wrap svg {
  width: 100%;
  max-width: 420px;
  height: 72px;
}

.pw-flip-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.45;
}

/* Exchange Commander (ex-*) — unified PoE1/PoE2 */
.ex-commander[data-game-accent="poe1"],
.ex-commander.poe1-accent {
  --ex-accent: #c9a227;
  --ex-glow: rgba(201, 162, 39, 0.15);
  --ex-border: rgba(201, 162, 39, 0.35);
}

.ex-commander[data-game-accent="poe2"],
.ex-commander.poe2-accent {
  --ex-accent: #2dd4bf;
  --ex-glow: rgba(45, 212, 191, 0.15);
  --ex-border: rgba(45, 212, 191, 0.35);
}

.ex-commander {
  --ex-accent: var(--accent);
  --ex-glow: rgba(168, 85, 247, 0.12);
  --ex-border: rgba(168, 85, 247, 0.28);
  position: relative;
}

.ex-stat-row .stat-card {
  border-radius: 999px;
  padding: 8px 14px;
}

.ex-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
}

.ex-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ex-chip {
  border: 1px solid var(--ex-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ex-chip:hover,
.ex-chip.active {
  background: var(--ex-glow);
  border-color: var(--ex-accent);
  color: var(--text);
}

.ex-sort-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.ex-sort {
  min-width: 160px;
}

.ex-anchor-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 44px;
  margin-bottom: 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ex-anchor-strip::-webkit-scrollbar {
  display: none;
  height: 0;
}

.ex-anchor-card {
  flex: 0 0 200px;
  width: 200px;
  padding: 14px 15px 12px;
  scroll-snap-align: start;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.35));
}

.ex-anchor-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.ex-anchor-name {
  font-size: 0.8rem;
  color: var(--text);
}

.ex-anchor-price {
  font-size: 1.05rem;
  font-family: var(--mono);
  color: var(--ex-accent);
}

.ex-anchor-trend {
  font-size: 0.68rem;
  margin-top: 0;
}

.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 12px;
}

.ex-grid--paths {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.ex-card {
  padding: 12px 14px;
  background: linear-gradient(145deg, rgba(30, 27, 46, 0.95), rgba(22, 20, 34, 0.98));
  border: 1px solid var(--ex-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
  font-variant-numeric: tabular-nums;
}

.ex-card:hover {
  border-color: var(--ex-accent);
  transform: translateY(-1px);
}

.ex-card.up { box-shadow: inset 3px 0 0 rgba(34, 197, 94, 0.65); }
.ex-card.down { box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.65); }
.ex-card.flat { box-shadow: inset 3px 0 0 rgba(148, 163, 184, 0.45); }
.ex-card--anchor { border-color: var(--ex-accent); }

.ex-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ex-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.ex-icon-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ex-accent);
  font-size: 0.9rem;
}

.ex-card-main { flex: 1; min-width: 0; }

.ex-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: capitalize;
}

.ex-trend {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.ex-trend-up, .ex-trend.up { color: var(--up); }
.ex-trend-down, .ex-trend.down { color: var(--down); }
.ex-trend-flat, .ex-trend.flat { color: var(--text-dim); }

.ex-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.ex-price {
  font-weight: 700;
  font-size: 0.95rem;
}

.ex-vol {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.ex-sparkline { display: block; }

.ex-sparkline-empty {
  font-size: 0.72rem;
  color: var(--text-dim);
  opacity: 0.6;
}

.ex-inline-detail {
  grid-column: 1 / -1;
  padding: 12px 16px;
  border: 1px dashed var(--ex-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.82rem;
}

.ex-inline-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.ex-load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 16px 0 8px;
}

.ex-flip-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ex-border);
}

.ex-section-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--ex-accent);
}

.ex-path-card .ex-name { white-space: normal; }

.ex-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  z-index: 120;
  background: var(--surface);
  border-left: 1px solid var(--ex-border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  padding: 16px 18px;
  overflow-y: auto;
}

.ex-drawer-head,
.ex-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.ex-drawer-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ex-drawer-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ex-ext-link {
  font-size: 0.75rem;
  color: var(--ex-accent);
  text-decoration: none;
}

.ex-ext-link:hover { text-decoration: underline; }

.ex-chart-wrap {
  min-height: 120px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--ex-border);
}

.ex-chart-wrap--lg { min-height: 220px; }

.ex-chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.ex-flip-hint {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.ex-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
}

.ex-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.ex-modal-panel {
  position: relative;
  width: min(720px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--ex-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.ex-range-tabs {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.ex-range-btn {
  border: 1px solid var(--ex-border);
  background: transparent;
  color: var(--text-dim);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.72rem;
  cursor: pointer;
}

.ex-range-btn.active {
  background: var(--ex-glow);
  color: var(--text);
  border-color: var(--ex-accent);
}

.ex-low-conf {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.65rem;
  opacity: 0.7;
}

/* Legacy pw-* aliases map to ex-* visually via shared rules above */

.phase-banner.warn {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}

.path-steps {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

.economy-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.15);
  color: var(--info);
  white-space: nowrap;
}

.mover-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 8px;
}

.profit-up {
  color: var(--up);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 4px;
}

.profit-down {
  color: var(--down);
  font-size: 0.82rem;
  margin-top: 4px;
}

.flip-why {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.status-pill.warn {
  color: var(--accent);
  background: var(--accent-dim);
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* Nav */
.app-nav {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-btn.active {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.08));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.nav-icon {
  font-size: 1rem;
}

/* Main */
.app-main {
  flex: 1;
}

.panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-head h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Buttons & inputs */
.btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  border-color: var(--text-dim);
  background: #243044;
}

.btn-primary {
  background: linear-gradient(180deg, #d97706, #b45309);
  border-color: #f59e0b;
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.select,
input[type="search"],
input[type="text"] {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.select:focus,
input:focus {
  border-color: var(--accent);
}

.search-wrap input {
  min-width: 220px;
}

/* Stats */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.stat-card .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.stat-card .value {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Mover grid */
.mover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.mover-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.mover-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.mover-card.up {
  border-left: 3px solid var(--up);
}

.mover-card.down {
  border-left: 3px solid var(--down);
}

.mover-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 10px;
}

.mover-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.mover-change {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.1rem;
}

.mover-change.up { color: var(--up); }
.mover-change.down { color: var(--down); }

.signal-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
}

.signal-tag.buy {
  color: var(--up);
  background: var(--up-bg);
}

.signal-tag.sell {
  color: var(--down);
  background: var(--down-bg);
}

/* Detail */
.detail-card {
  margin-top: 24px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-card.hidden { display: none; }

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.detail-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.detail-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-box {
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.metric-box .k {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-box .v {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  margin-top: 4px;
}

.detail-chart {
  height: 220px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

/* Craft */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.mod-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.mod-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.mod-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.importance-bar {
  width: 64px;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}

.importance-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #fbbf24);
  border-radius: 99px;
}

.importance-pct {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.ideas-block {
  margin-top: 24px;
  padding: 18px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.ideas-block h4 {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.idea-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.idea-item:last-child { border-bottom: none; }

/* Brief */
.brief-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.brief-card h3 {
  margin: 0 0 12px;
  color: var(--accent);
}

.ask-block {
  margin-top: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ask-block label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ask-row {
  display: flex;
  gap: 10px;
}

.ask-row input {
  flex: 1;
}

.ask-answer {
  margin-top: 14px;
  padding: 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ask-answer.hidden { display: none; }

/* Recipes */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.recipe-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.recipe-card .name {
  font-weight: 600;
  margin-bottom: 6px;
}

.recipe-profit {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--up);
}

.recipe-group {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recipe-warn {
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 8px;
}

/* Footer */
.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.discord-hint code {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 2px 6px;
  background: var(--surface);
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--info);
}

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

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.hidden { display: none !important; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  z-index: 100;
  animation: slideUp 0.3s ease;
}

.toast.ok { border-color: rgba(52, 211, 153, 0.4); color: var(--up); }
.toast.err { border-color: rgba(251, 113, 133, 0.4); color: var(--down); }

.budget-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.budget-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.budget-controls input {
  width: 88px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.budget-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.budget-card header {
  margin-bottom: 12px;
}

.budget-kind {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 4px;
}

.budget-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.budget-table {
  width: 100%;
  font-size: 0.85rem;
  border-collapse: collapse;
}

.budget-table td {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.budget-table td:last-child {
  text-align: right;
  font-family: var(--mono);
}

.budget-steps {
  margin: 10px 0 0;
  color: var(--text-muted);
}

.budget-caveats {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .app-shell { padding: 12px; }
  .app-header { flex-direction: column; align-items: stretch; }
  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1; }
  .nav-btn .nav-icon { display: none; }
  .ask-row { flex-direction: column; }
}
