/* ============================================================
   Yao 選股平台 V3.0 — style.css
   Theme: Terminal / Industrial Dark
   New: market-bar (fear-greed gauge + oil futures + reserve)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

/* ── Variables ── */
:root {
  --bg:        #0a0c11;
  --bg2:       #0f1219;
  --bg3:       #151922;
  --bg4:       #1c2130;
  --bg5:       #222840;
  --border:    rgba(255,255,255,0.055);
  --border2:   rgba(255,255,255,0.11);
  --border3:   rgba(255,255,255,0.18);
  --text:      #dde3f0;
  --text2:     #7a859e;
  --text3:     #3e4a5e;
  --text4:     #232d40;
  --green:     #00cc7a;
  --green-d:   rgba(0,204,122,0.10);
  --green-b:   rgba(0,204,122,0.30);
  --red:       #ff4d4d;
  --red-d:     rgba(255,77,77,0.10);
  --red-b:     rgba(255,77,77,0.28);
  --amber:     #f5a623;
  --amber-d:   rgba(245,166,35,0.10);
  --amber-b:   rgba(245,166,35,0.28);
  --blue:      #4da6ff;
  --blue-d:    rgba(77,166,255,0.08);
  --blue-b:    rgba(77,166,255,0.28);
  --purple:    #c77dff;
  --purple-d:  rgba(199,125,255,0.08);
  --mono:      'IBM Plex Mono', monospace;
  --sans:      'Noto Sans TC', sans-serif;
  --r:         6px;
  --r2:        10px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
input, select, button, textarea { font-family: var(--sans); font-size: 13px; }
button { cursor: pointer; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }

.mono { font-family: var(--mono); }
.up   { color: var(--red); }
.down { color: var(--green); }
.flat { color: var(--text2); }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 68px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--green) 0%, transparent 45%);
  opacity: 0.5;
}
.header-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--green);
  margin-bottom: 3px;
}
.header h1 { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.v-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  background: var(--green-d);
  border: 1px solid var(--green-b);
  color: var(--green);
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 4px;
}
.subtitle { font-size: 10px; color: var(--text2); font-family: var(--mono); margin-top: 2px; }
.header-stats { display: flex; gap: 10px; }
.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 5px 16px;
}
.stat-num { font-family: var(--mono); font-size: 1.15rem; font-weight: 500; }
.stat-label { font-size: 9px; color: var(--text2); margin-top: 1px; letter-spacing: .05em; }

/* ============================================================
   MARKET BAR — 市場總覽橫條
   ============================================================ */
.market-bar {
  display: grid;
  grid-template-columns: 380px 260px 260px 1fr;
  gap: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
  flex-shrink: 0;
  min-height: 200px;
}

/* ── Generic market card ── */
.mkt-card {
  border-right: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  position: relative;
}
.mkt-card:last-child { border-right: none; }

.mkt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  flex-shrink: 0;
}
.mkt-card-title {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--text2);
  text-transform: uppercase;
}
.mkt-badge {
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: var(--bg4);
  color: var(--text2);
  letter-spacing: .05em;
}
.mkt-badge.live    { color: var(--green); border-color: var(--green-b); background: var(--green-d); }
.mkt-badge.mock    { color: var(--amber); border-color: var(--amber-b); background: var(--amber-d); }
.mkt-badge.loading { color: var(--text3); border-color: var(--border); background: transparent; }

.mkt-card-foot {
  padding: 5px 14px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text3);
  border-top: 1px solid var(--border);
  margin-top: auto;
  flex-shrink: 0;
}

/* ── Fear & Greed Card ── */
.fg-card { }

.fg-body {
  display: flex;
  flex: 1;
  gap: 0;
  min-height: 0;
}

.fg-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 14px 4px;
  flex: 1;
  min-width: 0;
}

.fg-svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  overflow: visible;
}

.fg-zones {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 220px;
  margin-top: 2px;
}
.fgz {
  font-size: 8px;
  font-family: var(--mono);
  letter-spacing: .02em;
  text-align: center;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* History table */
.fg-hist {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 14px 8px 0;
  gap: 4px;
  min-width: 160px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
}
.fgh-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--r);
  gap: 8px;
}
.fgh-row.fgh-hi { background: var(--green-d); }
.fgh-row.fgh-lo { background: var(--red-d); }
.fgh-l { font-size: 10px; color: var(--text2); font-family: var(--mono); white-space: nowrap; }
.fgh-v {
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 500;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

/* ── Oil Futures Card ── */
.oil-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 10px 14px;
  gap: 0;
}

.oil-item {
  padding: 6px 0;
  flex: 1;
}
.oil-reserved { opacity: 0.65; }
.oil-res-tag {
  font-size: 8px;
  font-family: var(--mono);
  padding: 1px 5px;
  border-radius: 20px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  color: var(--text3);
  margin-left: 5px;
  vertical-align: middle;
}

.oil-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}
.oil-namebox { display: flex; flex-direction: column; gap: 1px; }
.oil-ticker { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--blue); }
.oil-fullname { font-size: 9px; color: var(--text3); font-family: var(--mono); }
.oil-pricebox { display: flex; align-items: baseline; gap: 4px; }
.oil-price { font-family: var(--mono); font-size: 20px; font-weight: 500; color: var(--text); }
.oil-unit { font-size: 9px; color: var(--text3); font-family: var(--mono); }

.oil-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.oil-chg { font-family: var(--mono); font-size: 11px; }
.oil-ohlv { font-family: var(--mono); font-size: 9px; color: var(--text3); }

.oil-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.oil-spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0 2px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.oil-spread-l { font-size: 9.5px; font-family: var(--mono); color: var(--text3); }
.oil-spread-v { font-family: var(--mono); font-size: 11px; color: var(--amber); }

/* ── Reserve Card ── */
.reserve-card { }
.reserve-body { flex: 1; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.res-list { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.res-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg3);
}
.res-icon { color: var(--text3); font-size: 11px; }
.res-name { font-size: 11px; color: var(--text2); flex: 1; }
.res-val { font-family: var(--mono); font-size: 11px; color: var(--text3); }
.res-note {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--text3);
  line-height: 1.5;
  padding: 5px 6px;
  background: var(--bg3);
  border-radius: var(--r);
  border: 1px solid var(--border);
}

/* ── USD FX Card ── */
.fx-card { }

.fx-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Primary block: big rate display */
.fx-primary {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.fx-pair-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.fx-flag { font-size: 20px; line-height: 1; flex-shrink: 0; }

.fx-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.fx-pair {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: .05em;
}
.fx-fullname {
  font-size: 9px;
  color: var(--text3);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fx-main-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
}
.fx-rate {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -.01em;
  transition: color .3s;
}
.fx-rate.flash-up   { color: var(--red); }
.fx-rate.flash-down { color: var(--green); }
.fx-unit {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--mono);
}

.fx-type-label {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--green);
  letter-spacing: .08em;
  padding: 2px 7px;
  background: var(--green-d);
  border: 1px solid var(--green-b);
  border-radius: 20px;
  display: inline-block;
  margin-top: 2px;
}

/* Detail grid */
.fx-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  flex-shrink: 0;
}
.fx-cell {
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.fx-cell:nth-child(even) { border-right: none; }
.fx-cell-label {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--text3);
  letter-spacing: .05em;
  margin-bottom: 2px;
}
.fx-cell-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.fx-cell-val.fx-muted { color: var(--text2); font-weight: 400; }

/* Other currencies section */
.fx-other-currencies {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fx-other-head {
  padding: 5px 14px 4px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.fx-other-title {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--text3);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.fx-other-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 4px 0;
  overflow: hidden;
}
.fx-other-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-bottom: 1px solid var(--border);
}
.fx-other-item:last-child { border-bottom: none; }
.fx-o-flag { font-size: 13px; flex-shrink: 0; }
.fx-o-name { font-size: 10px; color: var(--text2); font-family: var(--mono); flex: 1; }
.fx-o-rate { font-family: var(--mono); font-size: 11px; color: var(--text); text-align: right; }
.fx-muted  { color: var(--text3) !important; }

/* Data status banner (inside card, above footer) */
.fx-status-banner {
  padding: 4px 14px;
  font-size: 9px;
  font-family: var(--mono);
  letter-spacing: .06em;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.fx-status-banner.live { color: var(--green); background: var(--green-d); }
.fx-status-banner.mock { color: var(--amber); background: var(--amber-d); }

/* ============================================================
   TABS
   ============================================================ */
.tab-nav {
  display: flex;
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
  padding: 0 1.5rem;
  flex-shrink: 0;
}
.tab-btn {
  padding: 10px 22px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); }

.tab-content { display: none; flex: 1; flex-direction: column; min-height: 0; }
.tab-content.active { display: flex; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
  padding: 10px 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.template-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.template-label { font-size: 10px; font-family: var(--mono); color: var(--text3); letter-spacing: .08em; }
.tpl-btn {
  padding: 4px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 20px;
  color: var(--text2);
  font-size: 11px;
  transition: all .15s;
}
.tpl-btn:hover { color: var(--text); border-color: var(--border3); }
.tpl-btn.active { background: var(--green-d); border-color: var(--green-b); color: var(--green); }

.filter-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; flex: 1; }
.fg { display: flex; flex-direction: column; gap: 4px; min-width: 108px; }
.fg--themes { min-width: 280px; }
.fg label { font-size: 10px; font-family: var(--mono); color: var(--text2); letter-spacing: .05em; text-transform: uppercase; }
.fg input[type="number"], .fg select {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 6px 9px;
  color: var(--text);
  outline: none;
  width: 100%;
  transition: border-color .15s;
}
.fg input:focus, .fg select:focus { border-color: var(--green-b); }
.fg select option { background: var(--bg3); }
.input-row { display: flex; align-items: center; gap: 5px; }
.input-row input { width: 70px; }
.input-row span { color: var(--text3); font-size: 11px; }
.theme-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tc {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 20px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text2);
  user-select: none;
  transition: all .15s;
}
.tc input { display: none; }
.tc:hover { color: var(--text); }
.tc:has(input:checked) { background: var(--blue-d); border-color: var(--blue-b); color: var(--blue); }

.filter-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 2px; }

.btn-primary {
  padding: 8px 20px;
  background: var(--green);
  border: none;
  border-radius: var(--r);
  color: #0a0c11;
  font-weight: 700;
  font-size: 13px;
  transition: opacity .15s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: .85; }
.btn-primary:active { transform: scale(.97); }

.btn-secondary {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--r);
  color: var(--text2);
  font-size: 13px;
  transition: all .15s;
  white-space: nowrap;
}
.btn-secondary:hover { color: var(--text); background: var(--bg3); border-color: var(--border3); }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-layout {
  display: grid;
  grid-template-columns: 700px 1fr;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── List Panel ── */
.list-panel { border-right: 1px solid var(--border2); display: flex; flex-direction: column; overflow: hidden; }
.list-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.list-head-top { display: flex; justify-content: space-between; align-items: center; }
.list-head-controls { display: flex; gap: 7px; }
.list-head-controls input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 5px 9px;
  color: var(--text);
  outline: none;
}
.list-head-controls input:focus { border-color: var(--green-b); }
.list-head-controls select {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 5px 8px;
  color: var(--text2);
  outline: none;
  cursor: pointer;
}
.panel-title { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--text2); text-transform: uppercase; }
.panel-count { font-family: var(--mono); font-size: 11px; color: var(--green); }

.table-wrap { overflow-y: auto; overflow-x: auto; flex: 1; }
.stock-table { width: 100%; border-collapse: collapse; min-width: 580px; }
.stock-table thead { position: sticky; top: 0; z-index: 2; }
.stock-table th {
  background: var(--bg3);
  border-bottom: 1px solid var(--border2);
  padding: 7px 8px;
  text-align: right;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text2);
  letter-spacing: .05em;
  white-space: nowrap;
}
.stock-table th:nth-child(2), .stock-table th:nth-child(3) { text-align: left; }
.stock-table th:first-child { text-align: center; }
.stock-table th:last-child { text-align: left; }
.stock-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
}
.stock-table td:nth-child(2), .stock-table td:nth-child(3) { text-align: left; }
.stock-table td:first-child { text-align: center; }
.stock-table td:last-child { text-align: left; }
.stock-table tbody tr { cursor: pointer; transition: background .1s; }
.stock-table tbody tr:hover { background: var(--bg3); }
.stock-table tbody tr.active { background: var(--blue-d); }
.sym { font-weight: 500; color: var(--blue); font-size: 12px; }
.name-cell { max-width: 80px; overflow: hidden; text-overflow: ellipsis; font-family: var(--sans); font-size: 12px; }
.ind-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 20px;
  font-size: 9.5px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-family: var(--sans);
}
.fav-btn {
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  opacity: .35;
  transition: opacity .15s, transform .15s;
  padding: 2px;
}
.fav-btn:hover { opacity: .8; transform: scale(1.2); }
.fav-btn.active { opacity: 1; }
.empty-row td { text-align: center !important; padding: 3rem; color: var(--text3); font-family: var(--sans); cursor: default; }

/* ── Detail Panel ── */
.detail-panel { overflow-y: auto; padding: 1.25rem; background: var(--bg); }
.detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 280px; color: var(--text3); gap: 10px; }
.detail-empty-icon { font-size: 2.5rem; opacity: .25; }

.detail-content { display: flex; flex-direction: column; gap: 12px; }
.detail-hero { display: flex; justify-content: space-between; align-items: flex-start; }
.detail-name { font-size: 1.15rem; font-weight: 700; }
.detail-sym { font-family: var(--mono); font-size: 12px; color: var(--blue); margin-top: 2px; }
.detail-price-block { text-align: right; }
.detail-price { font-family: var(--mono); font-size: 1.75rem; font-weight: 500; }
.detail-change { font-family: var(--mono); font-size: 12px; margin-top: 2px; }
.detail-time { font-size: 9px; color: var(--text3); margin-top: 3px; font-family: var(--mono); }
.theme-badges { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.theme-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-family: var(--mono);
  background: var(--blue-d);
  border: 1px solid var(--blue-b);
  color: var(--blue);
}
.fav-btn-detail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r);
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  margin-top: 8px;
  transition: all .15s;
}
.fav-btn-detail:hover { border-color: var(--amber-b); color: var(--amber); }
.fav-btn-detail.active { background: var(--amber-d); border-color: var(--amber-b); color: var(--amber); }

/* Section cards */
.d-sec { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r2); overflow: hidden; }
.d-sec-head { display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-bottom: 1px solid var(--border); background: var(--bg3); }
.d-sec-icon { font-size: 13px; }
.d-sec-title { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--text2); text-transform: uppercase; }
.d-sec-body { padding: 12px 14px; }

.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.kv-grid.c3 { grid-template-columns: 1fr 1fr 1fr; }
.kv-grid.c4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv-l { font-size: 9.5px; color: var(--text3); font-family: var(--mono); letter-spacing: .05em; }
.kv-v { font-size: 13px; color: var(--text); font-family: var(--mono); }
.kv-v.big { font-size: 16px; font-weight: 500; }
.kv-v.prose { font-family: var(--sans); color: var(--text2); }

.d-desc { font-size: 12.5px; color: var(--text2); line-height: 1.7; margin-bottom: 10px; }

.tags-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { padding: 3px 9px; border-radius: 20px; font-size: 11px; font-family: var(--mono); border: 1px solid var(--border2); color: var(--text2); background: var(--bg3); }
.tag.up2   { color: var(--amber); border-color: var(--amber-b); background: var(--amber-d); }
.tag.mid   { color: var(--blue);  border-color: var(--blue-b);  background: var(--blue-d); }
.tag.dn    { color: var(--green); border-color: var(--green-b); background: var(--green-d); }
.tag.aff   { color: var(--purple); border-color: rgba(199,125,255,.3); background: var(--purple-d); }
.tag.comp  { color: var(--red);   border-color: var(--red-b);   background: var(--red-d); }

.chain-label { font-size: 9.5px; font-family: var(--mono); color: var(--text3); letter-spacing: .08em; margin-bottom: 5px; }
.chain-item { margin-bottom: 10px; }
.chain-item:last-child { margin-bottom: 0; }

/* Valuation */
.val-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.val-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  text-align: center;
}
.val-card .vc-label { font-size: 9.5px; font-family: var(--mono); color: var(--text3); margin-bottom: 4px; letter-spacing: .05em; }
.val-card .vc-value { font-size: 15px; font-weight: 500; font-family: var(--mono); color: var(--text); }
.val-card.highlight { background: var(--green-d); border-color: var(--green-b); }
.val-card.highlight .vc-value { color: var(--green); }
.val-card.warning   { background: var(--red-d);   border-color: var(--red-b); }
.val-card.warning .vc-value { color: var(--red); }
.val-signal {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.val-signal.cheap { background: var(--green-d); border: 1px solid var(--green-b); color: var(--green); }
.val-signal.fair  { background: var(--amber-d); border: 1px solid var(--amber-b); color: var(--amber); }
.val-signal.pricy { background: var(--red-d);   border: 1px solid var(--red-b);   color: var(--red); }

/* ============================================================
   WATCHLIST
   ============================================================ */
.watchlist-wrap { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 12px; }
.wl-header { display: flex; justify-content: space-between; align-items: flex-start; }
.wl-subtitle { font-size: 11px; color: var(--text3); font-family: var(--mono); margin-top: 3px; }
.wl-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r); }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text2); font-family: var(--mono); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.green { background: var(--green); }
.dot.red   { background: var(--red); }
.dot.gray  { background: var(--text3); }
.dot.amber { background: var(--amber); }
.wl-empty { text-align: center; padding: 4rem; color: var(--text3); font-size: 14px; line-height: 2; }
.wl-empty small { font-size: 11px; font-family: var(--mono); }

/* WL Card */
.wl-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r2); overflow: hidden; transition: border-color .2s; }
.wl-card.signal-buy    { border-color: var(--green-b); }
.wl-card.signal-sell   { border-color: var(--red-b); }
.wl-card.signal-watch  { border-color: var(--border2); }
.wl-card.signal-unset  { border-color: var(--amber-b); }
.wl-card-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg3); }
.wl-card-left { display: flex; align-items: center; gap: 10px; }
.wl-sym { font-family: var(--mono); font-weight: 500; color: var(--blue); font-size: 13px; }
.wl-name { font-size: 12px; color: var(--text2); }
.wl-price { font-family: var(--mono); font-size: 16px; font-weight: 500; }
.wl-change { font-family: var(--mono); font-size: 11px; margin-left: 6px; }
.wl-signal-badge { padding: 3px 10px; border-radius: 20px; font-size: 10px; font-family: var(--mono); font-weight: 500; letter-spacing: .05em; }
.wl-signal-badge.buy    { background: var(--green-d); border: 1px solid var(--green-b); color: var(--green); }
.wl-signal-badge.sell   { background: var(--red-d);   border: 1px solid var(--red-b);   color: var(--red); }
.wl-signal-badge.watch  { background: var(--bg4); border: 1px solid var(--border2); color: var(--text2); }
.wl-signal-badge.unset  { background: var(--amber-d); border: 1px solid var(--amber-b); color: var(--amber); }
.wl-card-body { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; padding: 12px 14px; }
.wl-field { display: flex; flex-direction: column; gap: 4px; }
.wl-field label { font-size: 9.5px; font-family: var(--mono); color: var(--text3); letter-spacing: .06em; }
.wl-field input {
  background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--r);
  padding: 6px 9px; color: var(--text); outline: none; width: 100%;
  font-family: var(--mono); font-size: 12px; transition: border-color .15s;
}
.wl-field input:focus { border-color: var(--green-b); }
.wl-field textarea {
  background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--r);
  padding: 6px 9px; color: var(--text); outline: none; width: 100%;
  font-family: var(--sans); font-size: 11.5px; resize: none;
  transition: border-color .15s; height: 52px;
}
.wl-field textarea:focus { border-color: var(--green-b); }
.btn-del { padding: 6px 12px; background: transparent; border: 1px solid var(--red-b); border-radius: var(--r); color: var(--red); font-size: 12px; opacity: .6; transition: opacity .15s; white-space: nowrap; }
.btn-del:hover { opacity: 1; }

/* Price bar */
.price-bar-wrap { padding: 0 14px 10px; }
.price-bar-track { position: relative; height: 4px; background: var(--bg4); border-radius: 4px; margin-top: 2px; }
.price-bar-fill { position: absolute; top: 0; left: 0; height: 100%; border-radius: 4px; transition: width .4s; }
.price-bar-marker { position: absolute; top: -4px; width: 12px; height: 12px; background: var(--text); border-radius: 50%; transform: translateX(-50%); border: 2px solid var(--bg); transition: left .4s; }
.price-bar-labels { display: flex; justify-content: space-between; margin-top: 4px; font-family: var(--mono); font-size: 9.5px; color: var(--text3); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 8px 1.5rem;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: .1em;
  text-align: center;
  flex-shrink: 0;
  background: var(--bg2);
}
