/* =========================================================
   六維度 台股 AI Terminal — dark trading UI
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  background:
    radial-gradient(1100px 600px at 10% -10%, rgba(76, 201, 240, .08), transparent 60%),
    radial-gradient(900px 500px at 120% 10%, rgba(124, 77, 255, .08), transparent 60%),
    #070a12;
  color: #d9e0ea;
  font-size: 13px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

:root {
  --bg: #070a12;
  --panel: rgba(17, 22, 34, .72);
  --panel-2: rgba(24, 30, 46, .6);
  --border: rgba(120, 140, 180, .14);
  --border-2: rgba(120, 140, 180, .25);
  --text: #d9e0ea;
  --muted: #7b8697;
  --up: #ff5a6a;      /* 台股慣例: 紅漲綠跌 */
  --dn: #3ed598;
  --flat: #9aa3b2;
  --accent: #4cc9f0;
  --accent2: #7c4dff;
  --warn: #ffb547;
  --glow-up: 0 0 18px rgba(255, 90, 106, .35);
  --glow-dn: 0 0 18px rgba(62, 213, 152, .35);
}

button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
.up { color: var(--up); }
.dn { color: var(--dn); }
.flat { color: var(--flat); }

/* ================= TOP BAR ================= */
.topbar {
  display: grid;
  grid-template-columns: 300px 1fr 260px;
  gap: 20px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, rgba(8,11,20,.95), rgba(8,11,20,.65));
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  position: relative;
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, #1a1f30 0%, #0b0f1c 50%, #2a1a3c 100%);
  border: 1px solid rgba(124, 77, 255, .4);
  color: #e5ecf7; font-weight: 900; font-size: 17px;
  font-family: "Noto Serif TC", "PMingLiU", serif;
  letter-spacing: -1px;
  box-shadow:
    0 8px 22px rgba(76, 201, 240, .25),
    inset 0 0 12px rgba(124, 77, 255, .2);
}
.brand .logo-dot {
  position: absolute; right: 6px; bottom: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff5a6a 0%, #ff1744 100%);
  box-shadow: 0 0 10px rgba(255, 90, 106, .8);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.85); }
}
.brand-title { font-size: 14px; font-weight: 700; letter-spacing: .5px; }
.brand-title .brand-accent {
  background: linear-gradient(135deg, #4cc9f0, #7c4dff);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; font-weight: 900; letter-spacing: 1.2px;
}
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: .3px; margin-top: 1px; }

.indices {
  display: flex; gap: 16px; overflow-x: auto; padding: 2px 4px;
  scrollbar-width: none;
}
.indices::-webkit-scrollbar { display: none; }
.idx {
  display: flex; flex-direction: column; min-width: 140px;
  padding: 6px 12px; border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.idx-name { font-size: 11px; color: var(--muted); }
.idx-val  { font-size: 16px; font-weight: 700; }
.idx-chg  { font-size: 11px; }
.idx-skel { color: var(--muted); padding: 8px 12px; }

.status { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.pill {
  padding: 4px 10px; border-radius: 999px; font-size: 11px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.pill.live { color: var(--up); border-color: rgba(255,90,106,.4); }
.pill.closed { color: var(--muted); }
.pill.refresh { color: var(--accent); border-color: rgba(76,201,240,.3); cursor: pointer; }
.clock { font-feature-settings: "tnum"; color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: 1px; }

/* ================= LAYOUT ================= */
.layout {
  display: grid;
  grid-template-columns: 300px 1fr 340px;
  gap: 14px;
  padding: 14px 20px 8px;
  align-items: start;
}
@media (max-width: 1400px) {
  .layout { grid-template-columns: 260px 1fr 300px; }
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  overflow: hidden;
  position: relative;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.card-head h3 {
  margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .3px;
  color: #e5ecf7;
}
.card-actions { display: flex; gap: 6px; }

.inp-sm {
  background: rgba(10,14,24,.8);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 4px 8px; font-size: 12px; border-radius: 6px; width: 110px;
  outline: none;
}
.inp-sm:focus { border-color: var(--accent); }
.btn-sm, .btn-ghost {
  background: rgba(76,201,240,.15);
  border: 1px solid rgba(76,201,240,.35);
  color: var(--accent);
  padding: 4px 10px; font-size: 12px; border-radius: 6px; cursor: pointer;
}
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border-2); }
.btn-sm:hover, .btn-ghost:hover { filter: brightness(1.25); }

/* =========== LEFT: WATCHLIST =========== */
.col-left { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.watchlist-body { max-height: 440px; overflow-y: auto; }
.wl-row {
  display: grid;
  grid-template-columns: 52px 1fr 68px 62px 14px;
  align-items: center; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
  position: relative;
}
.wl-row:hover { background: rgba(76,201,240,.06); }
.wl-row.active { background: rgba(124,77,255,.12); border-left: 2px solid var(--accent2); }
.wl-code { font-weight: 700; font-size: 13px; }
.wl-name { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-price { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.wl-chg   { text-align: right; font-variant-numeric: tabular-nums; font-size: 11px; }
.wl-del   {
  opacity: 0; color: var(--muted); cursor: pointer; font-size: 13px;
  text-align: center; line-height: 1; user-select: none;
  transition: opacity .15s, color .15s;
}
.wl-del:hover { color: var(--up); }
.wl-row:hover .wl-del { opacity: 1; }

.scanner-opts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.scanner-opts label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }
.scanner-opts input { accent-color: var(--accent); }
.scanner-result { max-height: 280px; overflow-y: auto; padding: 8px 14px; font-size: 12px; }
.scanner-result .sr-row {
  display: grid; grid-template-columns: 60px 1fr 70px;
  padding: 6px 0; border-bottom: 1px dashed var(--border); cursor: pointer;
}
.scanner-result .sr-row:hover { color: var(--accent); }
.scanner-result .tag-up { color: var(--up); font-size: 10px; }
.scanner-result .tag-dn { color: var(--dn); font-size: 10px; }

/* =========== CENTER =========== */
.col-center { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.stock-hero {
  display: grid; grid-template-columns: 1fr 220px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(29,36,56,.85), rgba(15,19,32,.88));
}
.hero-id { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.hero-id #h-code { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: 1px; }
.hero-id #h-name { font-size: 18px; font-weight: 600; color: #c8d3e6; }
.hero-id .tag { padding: 2px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border-2); font-size: 11px; color: var(--muted); }

.hero-price { display: flex; align-items: baseline; gap: 14px; margin: 8px 0 14px; font-variant-numeric: tabular-nums; }
.hero-price #h-price { font-size: 44px; font-weight: 800; letter-spacing: -.5px; }
.hero-price .chg { font-size: 18px; font-weight: 700; }

.hero-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 18px; font-size: 11px; }
.hero-meta > div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--border); padding-bottom: 4px; }
.hero-meta span { color: var(--muted); }
.hero-meta b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }

.hero-right { border-left: 1px dashed var(--border); padding-left: 20px; display: flex; flex-direction: column; justify-content: center; }
.mini-gauge { text-align: center; }
.gauge-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.gauge-number {
  font-size: 42px; font-weight: 800;
  background: linear-gradient(135deg, #4cc9f0, #7c4dff);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; letter-spacing: -1px;
}
.gauge-bar { height: 6px; border-radius: 6px; background: var(--panel-2); margin: 6px 0; overflow: hidden; }
.gauge-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ff5a6a, #ffb547, #3ed598);
  transition: width .6s ease;
}
.gauge-verdict { font-size: 13px; font-weight: 700; }

/* chart */
.chart-card { padding: 10px 12px 12px; }
.chart-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; padding: 4px 4px 10px; border-bottom: 1px solid var(--border);
}
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 4px 10px; font-size: 11px; cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: rgba(76,201,240,.15); color: var(--accent); }
.seg button:hover { color: var(--text); }

.chart-meta { display: flex; gap: 14px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.chart-meta b { color: var(--text); font-variant-numeric: tabular-nums; }

#chart { width: 100%; height: 420px; display: block; }
#chart-sub { width: 100%; height: 120px; display: block; }

.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .row-3 { grid-template-columns: 1fr; } }
.row-3 .card { padding: 10px 14px; min-height: 240px; }
.row-3 .card h3 { margin: 0 0 8px; font-size: 13px; }

.book { font-variant-numeric: tabular-nums; font-size: 12px; }
.book-row { display: grid; grid-template-columns: 70px 1fr 70px; padding: 3px 2px; position: relative; }
.book-row .bar { position: absolute; top: 0; bottom: 0; opacity: .25; border-radius: 2px; }
.book-row .ask-bar { right: 0; background: var(--dn); }
.book-row .bid-bar { left: 0; background: var(--up); }
.book-row span { position: relative; z-index: 1; }
.book-row .vol { color: var(--muted); font-size: 11px; }
.book-row .ask { color: var(--dn); text-align: right; font-weight: 600; }
.book-row .bid { color: var(--up); text-align: right; font-weight: 600; }
.book-mid { display: grid; grid-template-columns: 1fr 1fr; text-align: center; padding: 6px 0; margin: 6px 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); font-size: 11px; color: var(--muted); }
.book-mid b { color: var(--text); display: block; font-size: 13px; }

.ticks-head, .ticks-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; padding: 3px 2px; font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.ticks-head { color: var(--muted); border-bottom: 1px dashed var(--border); padding-bottom: 6px; margin-bottom: 4px; }
.ticks { max-height: 220px; overflow-y: auto; }
.ticks-row.up b { color: var(--up); }
.ticks-row.dn b { color: var(--dn); }

.fund { font-size: 12px; }
.fund-row { display: grid; grid-template-columns: 80px 1fr 80px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-variant-numeric: tabular-nums; }
.fund-row .val { text-align: right; font-weight: 600; }
.fund-bar { height: 4px; background: var(--panel-2); border-radius: 4px; overflow: hidden; margin-top: 4px; position: relative; }
.fund-bar .fill { height: 100%; background: var(--up); }
.fund-bar .fill.dn { background: var(--dn); }

/* =========== RIGHT =========== */
.col-right { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.ai-card, .signal-card, .news-card { }
.ai-dot { color: var(--dn); font-size: 11px; letter-spacing: 1px; }

.ai-dims { padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-dim-row { }
.ai-dim-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.ai-dim-head b { color: var(--text); font-variant-numeric: tabular-nums; }
.ai-dim-bar { height: 6px; background: var(--panel-2); border-radius: 6px; margin-top: 4px; overflow: hidden; }
.ai-dim-bar .fill { height: 100%; border-radius: 6px; transition: width .5s ease; }
.ai-summary {
  margin-top: 8px; padding: 10px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(76,201,240,.08), rgba(124,77,255,.08));
  border: 1px solid var(--border);
  font-size: 12px; line-height: 1.55;
}
.ai-summary .label { color: var(--accent); font-weight: 700; }

.signals { max-height: 320px; overflow-y: auto; padding: 4px 0; }
.sig-row {
  display: grid; grid-template-columns: 52px 18px 1fr;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  font-size: 12px; gap: 6px;
}
.sig-row .t { color: var(--muted); font-size: 11px; }
.sig-row .dot { font-size: 14px; line-height: 1; }
.sig-row .msg b { font-weight: 700; }
.sig-buy  .dot { color: var(--up); }
.sig-sell .dot { color: var(--dn); }
.sig-warn .dot { color: var(--warn); }
.sig-info .dot { color: var(--accent); }

.news { max-height: 360px; overflow-y: auto; padding: 4px 0; }
.news-item {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.news-item a { color: var(--text); text-decoration: none; font-size: 12px; display: block; line-height: 1.45; }
.news-item a:hover { color: var(--accent); }
.news-item .src { color: var(--muted); font-size: 10px; margin-top: 4px; }

/* =========== BOTTOM GRID =========== */
.bottom-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 14px; padding: 4px 20px 14px;
}
@media (max-width: 1100px) { .bottom-grid { grid-template-columns: 1fr 1fr; } }
.movers, .sectors { padding: 6px 0; max-height: 320px; overflow-y: auto; }
.mv-row, .sec-row {
  display: grid; grid-template-columns: 60px 1fr 70px 60px;
  padding: 6px 14px; font-size: 12px; border-bottom: 1px dashed var(--border);
  cursor: pointer; font-variant-numeric: tabular-nums;
}
.mv-row:hover, .sec-row:hover { background: rgba(76,201,240,.06); }
.mv-row .mv-price { text-align: right; font-weight: 600; }
.mv-row .mv-chgp { text-align: right; }
.sec-row { grid-template-columns: 1fr 90px 60px; }
.sec-bar { height: 16px; background: var(--panel-2); border-radius: 4px; position: relative; overflow: hidden; }
.sec-bar .f { height: 100%; }

/* =========== FOOT =========== */
.foot {
  display: flex; justify-content: space-between;
  padding: 14px 20px 24px;
  color: var(--muted); font-size: 11px;
  border-top: 1px solid var(--border); margin-top: 10px;
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 10px 18px; background: rgba(10,14,24,.95);
  border: 1px solid var(--border-2); border-radius: 10px;
  color: var(--text); font-size: 12px; z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

/* ============= SOURCES MODAL ============= */
#sources-btn { cursor: pointer; transition: all .15s; }
#sources-btn:hover { background: rgba(76,201,240,.15); color: var(--accent); border-color: rgba(76,201,240,.4); }

.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 6, 12, .72);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  width: min(780px, 94vw); max-height: 86vh;
  background: linear-gradient(180deg, rgba(24,30,46,.96), rgba(14,18,30,.98));
  border: 1px solid var(--border-2);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 80px rgba(124,77,255,.15);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: modalIn .22s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 15px; letter-spacing: .3px; }
.modal-close {
  background: transparent; border: 1px solid var(--border-2);
  color: var(--muted); width: 28px; height: 28px; border-radius: 8px;
  cursor: pointer; font-size: 14px;
}
.modal-close:hover { color: var(--up); border-color: var(--up); }
.modal-body { overflow-y: auto; padding: 16px 20px 20px; }

.src-group { margin-bottom: 18px; }
.src-group-head {
  font-size: 12px; font-weight: 700;
  color: var(--accent); letter-spacing: .5px;
  padding-bottom: 6px; margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.src-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.src-table th, .src-table td {
  padding: 6px 10px; text-align: left;
  border-bottom: 1px solid rgba(120,140,180,.08);
}
.src-table th {
  color: var(--muted); font-weight: 600; font-size: 11px;
  background: rgba(10,14,24,.4);
}
.src-table td { color: var(--text); }
.src-table td.t { color: var(--accent); font-weight: 600; white-space: nowrap; }
.src-table a { color: var(--accent); text-decoration: none; }
.src-table a:hover { text-decoration: underline; }

.src-note { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 0; }
.src-note code {
  background: rgba(76,201,240,.1); color: var(--accent);
  padding: 2px 6px; border-radius: 4px; font-size: 11px;
}
.src-bullets { font-size: 12px; color: var(--text); line-height: 1.7; margin: 0; padding-left: 20px; }
.src-bullets li { margin-bottom: 4px; }
.src-bullets b { color: var(--warn); }

/* ============= HUNTER MODAL ============= */
.hunter-btn {
  cursor: pointer;
  background: linear-gradient(135deg, rgba(255,90,106,.15), rgba(124,77,255,.15));
  border-color: rgba(255,90,106,.35);
  color: #ffd0a5;
  position: relative;
}
.hunter-btn:hover { filter: brightness(1.2); }
.hunter-badge {
  display: inline-block;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--up);
  color: #fff; font-size: 10px; font-weight: 700;
  text-align: center; line-height: 16px;
  margin-left: 4px;
  box-shadow: 0 0 8px rgba(255,90,106,.6);
}

.hunter-card { width: min(1180px, 96vw); }
.hunter-body { overflow-y: auto; padding: 14px 20px 20px; }

.hunter-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(10,14,24,.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 12px;
}
.btn-hunter {
  padding: 8px 16px; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, #ff5a6a, #7c4dff);
  border: 0; border-radius: 8px; cursor: pointer;
  color: #fff; letter-spacing: 1px;
  box-shadow: 0 4px 14px rgba(255,90,106,.35);
  transition: transform .1s, filter .2s;
}
.btn-hunter:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-hunter:active { transform: translateY(0); }
.btn-hunter.on {
  background: linear-gradient(135deg, #3ed598, #4cc9f0);
  box-shadow: 0 4px 14px rgba(62,213,152,.35);
}

.hunter-status { display: inline-flex; align-items: center; gap: 6px; }
.hunter-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #7b8697;
  transition: all .3s;
}
.hunter-status .dot.running { background: var(--dn); box-shadow: 0 0 10px var(--dn); animation: pulse-dot 1.4s ease-in-out infinite; }
.hunter-status .dot.scanning { background: var(--warn); box-shadow: 0 0 10px var(--warn); }

.hunter-caveat {
  padding: 10px 14px; margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(255,181,71,.1), rgba(255,90,106,.05));
  border: 1px solid rgba(255,181,71,.3);
  border-radius: 8px;
  font-size: 12px; line-height: 1.7; color: #f8d9a0;
}
.hunter-caveat b { color: #ffb547; }

.hunter-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 900px) { .hunter-grid { grid-template-columns: 1fr; } }

.hunter-section {
  background: rgba(10,14,24,.4);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.hunter-section-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.hunter-section-head h4 { margin: 0; font-size: 13px; font-weight: 700; color: #e5ecf7; }
.hunter-section-head .count {
  display: inline-block;
  min-width: 22px; padding: 2px 6px;
  text-align: center;
  background: rgba(62,213,152,.15); color: var(--dn);
  border-radius: 999px; font-size: 11px; font-weight: 700;
}

.hunter-signal-list { max-height: 520px; overflow-y: auto; padding: 6px; }
.hunter-sig-card {
  background: rgba(24,30,46,.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
}
.hunter-sig-card:hover { border-color: rgba(76,201,240,.4); background: rgba(24,30,46,.85); }
.hunter-sig-card .sig-top {
  display: flex; justify-content: space-between; align-items: baseline;
}
.hunter-sig-card .sig-code { font-weight: 800; font-size: 15px; }
.hunter-sig-card .sig-name { color: var(--muted); font-size: 12px; margin-left: 6px; }
.hunter-sig-card .sig-score {
  font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, #4cc9f0, #7c4dff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hunter-sig-card .sig-trigger {
  display: inline-block;
  margin-top: 4px; padding: 2px 8px;
  background: rgba(255,90,106,.15); color: var(--up);
  border-radius: 999px; font-size: 11px;
}
.hunter-sig-card .sig-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 8px; font-size: 11px;
}
.hunter-sig-card .sig-grid > div { background: rgba(10,14,24,.5); padding: 4px 8px; border-radius: 4px; }
.hunter-sig-card .sig-grid span { color: var(--muted); display: block; font-size: 10px; }
.hunter-sig-card .sig-grid b { font-variant-numeric: tabular-nums; }
.hunter-sig-card .sig-progress {
  height: 4px; background: rgba(120,140,180,.1);
  border-radius: 4px; margin-top: 8px;
  position: relative; overflow: hidden;
}
.hunter-sig-card .sig-progress .fill {
  position: absolute; top: 0; bottom: 0; left: 50%;
  transition: all .5s;
}
.hunter-sig-card .sig-pnl {
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.hunter-sig-card .sig-sources {
  display: none;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 10px;
}
.hunter-sig-card.expanded .sig-sources { display: block; }
.hunter-sig-card .sig-sources a { color: var(--accent); text-decoration: none; display: block; padding: 2px 0; }
.hunter-sig-card .sig-sources a:hover { text-decoration: underline; }

.hunter-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px;
}
.hunter-stats-grid .stat {
  background: rgba(24,30,46,.6); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
}
.hunter-stats-grid .stat .label { font-size: 10px; color: var(--muted); }
.hunter-stats-grid .stat .value {
  font-size: 22px; font-weight: 800; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.hunter-stats-grid .stat.big { grid-column: span 2; }
.hunter-stats-grid .stat.big .value {
  font-size: 34px;
  background: linear-gradient(135deg, #3ed598, #4cc9f0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hunter-stats-grid .stat .sub { font-size: 10px; color: var(--muted); margin-top: 2px; }

.hunter-notes {
  padding: 8px 14px;
  font-size: 11px; color: var(--muted); line-height: 1.8;
  border-top: 1px dashed var(--border);
}

.hunter-history-wrap { max-height: 340px; overflow: auto; padding: 0; }
.hunter-history-table {
  width: 100%; border-collapse: collapse;
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.hunter-history-table th, .hunter-history-table td {
  padding: 6px 8px; text-align: left;
  border-bottom: 1px solid rgba(120,140,180,.08);
  white-space: nowrap;
}
.hunter-history-table th {
  color: var(--muted); font-weight: 600; font-size: 10px;
  position: sticky; top: 0; background: rgba(10,14,24,.95); z-index: 1;
}
.hunter-history-table td.up { color: var(--up); }
.hunter-history-table td.dn { color: var(--dn); }
.hunter-history-table .status-open   { color: var(--accent); }
.hunter-history-table .status-win    { color: var(--up); font-weight: 700; }
.hunter-history-table .status-stop   { color: var(--dn); font-weight: 700; }
.hunter-history-table .status-expired{ color: var(--muted); }

/* scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120,140,180,.2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120,140,180,.4); }

/* flash anim for price updates */
@keyframes flash-up {
  0% { background: rgba(255, 90, 106, .35); }
  100% { background: transparent; }
}
@keyframes flash-dn {
  0% { background: rgba(62, 213, 152, .35); }
  100% { background: transparent; }
}
.flash-up { animation: flash-up .6s ease; }
.flash-dn { animation: flash-dn .6s ease; }
