:root {
  --bg: #0b0e13;
  --panel: #12161d;
  --panel-2: #181d26;
  --line: #232a35;
  --text: #e6eaf0;
  --muted: #8a94a6;
  --accent: #2ee59d;
  --up: #22c55e;
  --down: #f0506e;
  --up-soft: rgba(34, 197, 94, 0.14);
  --down-soft: rgba(240, 80, 110, 0.14);
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
h1, h2 { margin: 0; }
h2 { font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 26px; height: 26px; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-tag { color: var(--muted); font-size: 12px; padding-left: 10px; border-left: 1px solid var(--line); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.clock { color: var(--muted); font-size: 12px; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #e0b341; box-shadow: 0 0 0 3px rgba(224,179,65,.18); }
.status[data-state="live"] i { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); animation: pulse 2s infinite; }
.status[data-state="down"] i { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

/* Layout */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 340px;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; gap: 8px; }

/* Watchlist */
.search { position: relative; padding: 0 12px 10px; }
.search input {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit; outline: none;
}
.search input:focus { border-color: var(--accent); }
.search-results {
  position: absolute; left: 12px; right: 12px; top: 42px; z-index: 20;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.search-results button {
  display: flex; width: 100%; justify-content: space-between; padding: 9px 11px; border: 0;
  background: none; cursor: pointer; text-align: left;
}
.search-results button:hover, .search-results button.active { background: #212836; }
.search-results .empty { padding: 10px 11px; color: var(--muted); }

.watchlist { list-style: none; margin: 0; padding: 0 6px 8px; overflow-y: auto; flex: 1; }
.watchlist li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center;
  padding: 9px 10px; border-radius: 9px; cursor: pointer; position: relative;
}
.watchlist li:hover { background: var(--panel-2); }
.watchlist li.active { background: #1c2330; box-shadow: inset 3px 0 0 var(--accent); }
.wl-base { font-weight: 600; }
.wl-name { color: var(--muted); font-size: 12px; }
.wl-price { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wl-chg { text-align: right; font-family: var(--mono); font-size: 12px; }
.up { color: var(--up); }
.down { color: var(--down); }
.flash-up { animation: fu .6s; }
.flash-down { animation: fd .6s; }
@keyframes fu { from { background: var(--up-soft); } }
@keyframes fd { from { background: var(--down-soft); } }
.wl-remove {
  position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; border-radius: 6px;
  border: 0; background: #2a3140; color: var(--muted); cursor: pointer; line-height: 1;
  opacity: 0; transition: opacity .15s;
}
.watchlist li:hover .wl-remove { opacity: 1; }
.wl-remove:hover { color: var(--text); background: #3a4356; }

/* Chart panel */
.chart-panel { padding: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 16px 18px 8px; flex-wrap: wrap; }
.symbol-line { display: flex; align-items: baseline; gap: 10px; }
.symbol-line h1 { font-size: 20px; font-weight: 700; }
.price-line { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.big-price { font-size: 30px; font-weight: 500; letter-spacing: -.02em; }
.chip { padding: 3px 8px; border-radius: 6px; font-size: 13px; background: var(--panel-2); }
.chip.up { background: var(--up-soft); }
.chip.down { background: var(--down-soft); }
.stats { display: flex; gap: 22px; margin: 0; }
.stats div { display: flex; flex-direction: column; gap: 2px; }
.stats dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.stats dd { margin: 0; font-size: 14px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 18px 10px; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button:hover { color: var(--text); }
.seg button.on { background: #273042; color: var(--text); }
.small-seg button { padding: 3px 9px; font-size: 12px; }

.chart { height: 460px; flex: none; position: relative; }
.chart .chart-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); z-index: 3; pointer-events: none; }
.toolbar-right { display: flex; align-items: center; gap: 12px; }
.ghost-btn, .btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 500;
}
.ghost-btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); padding: 4px 10px; }
.ghost-btn:hover { color: var(--text); border-color: #3a4356; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
.btn { border: 1px solid #2d6b51; background: #173a2c; color: #c9f7e2; padding: 7px 12px; }
.btn:hover { background: #1d4a38; }
.btn:disabled { opacity: .5; cursor: progress; }

/* Setup scanner */
.scanner { border-top: 1px solid var(--line); padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.scan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.scan-head h2 { margin-bottom: 3px; }
.scan-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fee-label { display: inline-flex; align-items: center; gap: 6px; }
.fee-label input {
  width: 64px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text); font: 12.5px var(--mono); outline: none;
}
.fee-label input:focus { border-color: var(--accent); }

.verdict-loading { padding: 14px; border-radius: 10px; background: var(--panel-2); color: var(--muted); }
.verdict-bar { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid; }
.verdict-label { font-weight: 700; font-size: 15px; letter-spacing: .04em; padding: 4px 10px; border-radius: 7px; white-space: nowrap; }
.verdict-text { line-height: 1.4; }
.v-go { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.35); }
.v-go .verdict-label { background: var(--up); color: #062312; }
.v-caution { background: rgba(224,179,65,.08); border-color: rgba(224,179,65,.35); }
.v-caution .verdict-label { background: #e0b341; color: #2a1f05; }
.v-no { background: rgba(240,80,110,.08); border-color: rgba(240,80,110,.35); }
.v-no .verdict-label { background: var(--down); color: #2b0711; }
.v-wait { background: var(--panel-2); border-color: var(--line); }
.v-wait .verdict-label { background: #2a3140; color: var(--text); }
.conf { display: flex; gap: 14px; align-items: center; margin-top: 10px; padding: 0 4px; }
.conf-big { font-size: 30px; font-weight: 500; }
.conf-text { color: var(--muted); line-height: 1.45; }
.conf-text strong { color: var(--text); font-weight: 600; }

.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.plan-grid div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; display: flex; flex-direction: column; gap: 3px; }
.plan-grid span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.plan-grid strong { font-weight: 500; font-size: 15px; }
.plan-grid small { font-size: 11.5px; opacity: .85; }
.plan p { margin: 8px 2px 0; }

.table-wrap { overflow-x: auto; }
.setups { width: 100%; border-collapse: collapse; font-size: 13px; }
.setups th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.setups td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.setups tbody tr { cursor: pointer; }
.setups tbody tr:hover { background: var(--panel-2); }
.setups tbody tr.shown { background: #1c2330; box-shadow: inset 3px 0 0 var(--accent); }
.setups .num { text-align: right; white-space: nowrap; }
.setups .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.setups .sub.down { color: var(--down); }
.setup-name { font-weight: 600; }
.setup-desc { color: var(--muted); font-size: 12px; margin-top: 2px; max-width: 340px; line-height: 1.35; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: #2a3140; color: var(--text); }
.pill-on { background: rgba(46,229,157,.16); color: var(--accent); }
.pill-edge, .v-pill-go { background: rgba(34,197,94,.18); color: #6ee7a0; }
.pill-weak, .pill-thin, .v-pill-caution { background: rgba(224,179,65,.16); color: #f0cb6a; }
.pill-negative, .v-pill-no { background: rgba(240,80,110,.16); color: #ff8aa2; }
.v-pill-wait { background: #2a3140; color: var(--muted); }

.scan-results-box:empty { display: none; }
.scan-title { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.scan-row {
  display: grid; grid-template-columns: 56px auto 1fr; align-items: center; gap: 8px; text-align: left;
  padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer;
}
.scan-row:hover { border-color: #3a4356; }
.scan-coin { font-weight: 600; }
.scan-detail { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.method { margin: 0; line-height: 1.5; }

/* News */
.news-meta { padding: 0 14px 6px; }
.news-list { list-style: none; margin: 0; padding: 0 6px 8px; overflow-y: auto; flex: 1; }
.news-list li a { display: block; padding: 10px; border-radius: 9px; color: inherit; text-decoration: none; }
.news-list li a:hover { background: var(--panel-2); }
.news-title { font-weight: 500; line-height: 1.35; }
.news-sub { display: flex; gap: 8px; align-items: center; margin-top: 5px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.tag { font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: #222a38; color: #b9c3d4; }
.news-empty { padding: 20px 14px; color: var(--muted); }

.foot { padding: 8px 18px 14px; text-align: center; }

/* Responsive */
/* Desktop: side panels stick while the centre column (chart + scanner) scrolls with the page. */
.layout { align-items: start; flex: none; }
.chart-panel { overflow: visible; }
.watch, .news { position: sticky; top: 12px; height: calc(100vh - 86px); min-height: 420px; }
@media (max-width: 1180px) {
  .layout { grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: auto auto; flex: none; }
  .watch { max-height: 640px; }
  .news { position: static; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news { grid-column: 1 / -1; height: 520px; }
}
@media (max-width: 760px) {
  .topbar { padding: 10px 16px; }
  .brand-tag, .clock { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 10px 16px; gap: 10px; }
  .watch { height: 300px; max-height: none; position: static; min-height: 0; }
  .news { height: 480px; min-height: 0; }
  .chart { height: 340px; }
  .scanner { padding: 14px; }
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .setup-desc { display: none; }
  .verdict-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .big-price { font-size: 24px; }
  .stats { gap: 14px; }
  .watchlist li { padding-right: 34px; }
  .wl-remove { opacity: 1; top: 50%; transform: translateY(-50%); right: 6px; }
}
.tm { font-size: 9px; font-weight: 500; color: var(--muted); margin-left: 1px; vertical-align: super; }

/* Money panel (step 3) */
.money { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.money-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.money-fields label, .calc-inputs label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.inp { display: flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; }
.inp:focus-within { border-color: var(--accent); }
.inp em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.inp input, .calc-inputs input {
  width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); font: 14px var(--mono); padding: 7px 0; outline: none;
}
.money-day { display: flex; flex-direction: column; gap: 8px; justify-content: space-between; font-size: 13px; }
.day-line { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.link-btn { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; font-size: 12px; }
.limit-bar { height: 5px; border-radius: 3px; background: #232a35; overflow: hidden; margin-top: 6px; }
.limit-bar i { display: block; height: 100%; background: var(--up); }
.limit-bar.near i { background: #e0b341; }
.limit-bar.hit i { background: var(--down); }
.guard-stop { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(240,80,110,.12); border: 1px solid rgba(240,80,110,.4); color: #ffc2cf; }
.log-form { display: flex; align-items: center; gap: 8px; }
.log-form .inp { flex: 1; max-width: 170px; }

.card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.card-title { font-weight: 600; }
.card-stop { background: rgba(240,80,110,.08); border-color: rgba(240,80,110,.4); }
.plan-grid .hl { border-color: #2d6b51; background: #142a21; }
.plan-grid small.muted { font-size: 11.5px; }
.prompt { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); color: var(--muted); }
.prompt strong { color: var(--text); }
.warn { padding: 8px 10px; border-radius: 8px; background: rgba(240,80,110,.1); border: 1px solid rgba(240,80,110,.35); color: #ffc2cf; font-size: 13px; }
.note { padding: 8px 10px; border-radius: 8px; background: rgba(224,179,65,.08); border: 1px solid rgba(224,179,65,.3); color: #f3d98f; font-size: 13px; }
.howto summary, .calc summary { cursor: pointer; font-weight: 600; }
.howto ol { margin: 10px 0 6px; padding-left: 20px; line-height: 1.9; }
.copy { border: 1px dashed #3a4356; background: #1b212c; color: var(--text); border-radius: 6px; padding: 1px 6px; cursor: copy; font-size: 12.5px; }
.copy.copied { border-color: var(--up); color: var(--up); }

.calc { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.calc[open] summary { margin-bottom: 10px; }
.calc-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.calc-inputs input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; }
.calc-inputs input:focus { border-color: var(--accent); }
.calc #c-out { display: flex; flex-direction: column; gap: 8px; }
.calc #c-out p { margin: 0; }

@media (max-width: 1180px) {
  .money { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .money-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-inputs { grid-template-columns: minmax(0, 1fr); }
}

/* Research panel (step 4) */
.report { flex: 1; overflow-y: auto; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 14px; }
.report[hidden], .news-list[hidden], .news-meta[hidden] { display: none; }
.r-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.r-sec h3 img { border-radius: 50%; }
.ai-badge { font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 1px 6px; border-radius: 5px; background: #2a2350; color: #b9a8ff; }
.ai-list { margin: 0 0 8px; padding-left: 18px; line-height: 1.5; }
.ai-list li { margin-bottom: 4px; }
.tiny { font-size: 11.5px; line-height: 1.45; }
.tiny a { color: inherit; }
.mood { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 6px; }
.mood-top { display: flex; flex-direction: column; gap: 2px; }
.mood-pos .mood-top strong { color: var(--up); }
.mood-neg .mood-top strong { color: var(--down); }
.mood-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #232a35; }
.mood-bar i { display: block; height: 100%; }
.mood-bar .neg { background: var(--down); }
.mood-bar .neu { background: #4a5468; }
.mood-bar .pos { background: var(--up); }
.mood-dot { display: inline-block; width: 14px; margin-right: 4px; font-size: 10px; }
.md-positive { color: var(--up); }
.md-negative { color: var(--down); }
.md-neutral { color: #5d677a; }
.rc { margin: 0; display: flex; flex-direction: column; gap: 9px; }
.rc div { display: flex; flex-direction: column; gap: 2px; }
.rc dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rc dd { margin: 0; line-height: 1.45; }
.rc strong { font-weight: 600; }
.news-meta { display: flex; flex-direction: column; gap: 6px; }

/* Alerts + polish (step 5) */
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; font-weight: 600; }
.icon-btn:hover { color: var(--text); border-color: #3a4356; }
.count { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #062312; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.count[hidden] { display: none; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.overlay[hidden] { display: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--panel); border-left: 1px solid var(--line); z-index: 50;
  transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; box-shadow: -20px 0 50px rgba(0,0,0,.4); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-body { overflow-y: auto; padding: 4px 16px 24px; }
.drawer-body section { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.drawer-body h3 { margin: 0; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.drawer-body p { margin: 0; }
.al-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.drawer select, .drawer input[type="number"] { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 7px; padding: 6px 8px; font: 13px var(--font); }
.drawer input[type="number"] { width: 80px; font-family: var(--mono); }
.al-price-form input[type="number"] { width: 120px; flex: 1; }
.switch { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; line-height: 1.4; }
.switch input { margin-top: 3px; accent-color: var(--accent); }
.al-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.al-list li { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); font-size: 13px; }
.al-list li.done { opacity: .55; }
.warn-text { color: #ffa3b6; }
.ghost-btn:disabled { opacity: .5; cursor: not-allowed; }

.toasts { position: fixed; top: 60px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: #171c25; color: var(--text);
  box-shadow: 0 12px 30px rgba(0,0,0,.45); cursor: pointer; animation: tin .2s ease; border-left: 4px solid #5d677a; font-size: 13px; }
.toast span { color: var(--muted); }
.toast-go, .toast-up { border-left-color: var(--up); }
.toast-caution { border-left-color: #e0b341; }
.toast-down { border-left-color: var(--down); }
.toast-price { border-left-color: var(--accent); }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .5s; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

.help-pop { position: fixed; top: 56px; right: 16px; z-index: 55; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: 0 12px 30px rgba(0,0,0,.45); font-size: 13px; }
.help-pop[hidden] { display: none; }
.help-pop dl { margin: 8px 0 0; display: grid; gap: 5px; }
.help-pop dl div { display: grid; grid-template-columns: 48px 1fr; gap: 8px; }
.help-pop dt { font-family: var(--mono); color: var(--accent); }
.help-pop dd { margin: 0; color: var(--muted); }

.ema-swatch { width: 14px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, #e0b341 50%, #7aa2ff 50%); }
.ghost-btn.on { color: var(--text); border-color: #3a4356; background: #232b38; }
.wl-badge { display: inline-block; margin-left: 6px; font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; vertical-align: 1px; letter-spacing: .03em; }
.wl-badge.go { background: rgba(34,197,94,.2); color: #6ee7a0; }
.wl-badge.caution { background: rgba(224,179,65,.18); color: #f0cb6a; }
.wl-badge.no { background: rgba(240,80,110,.16); color: #ff8aa2; }
@media (max-width: 760px) {
  #ema-toggle, #candle-info { display: none; }
  .toasts { top: auto; bottom: 16px; }
}

/* Step 6 + GUI: tabs, forecast, journal, signal record, AI */
.money-fields select { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 8px; font: 12.5px var(--font); }
.fee-custom { margin-top: 4px; }
.fee-custom[hidden] { display: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 2px; overflow-x: auto; }
.tabs button { border: 0; background: none; color: var(--muted); padding: 9px 14px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.count-inline { font-size: 10.5px; background: var(--accent); color: #062312; border-radius: 9px; padding: 0 6px; }
.count-inline[hidden] { display: none; }
.tab-body { display: flex; flex-direction: column; gap: 12px; }
.tab-body[hidden] { display: none; }
.tab-body h3 { margin: 6px 0 0; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.explain { margin: 0; line-height: 1.5; }
.explain strong { color: var(--text); }

.forecast-box:empty { display: none; }
.forecast-box { margin: 0 18px 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); display: flex; flex-direction: column; gap: 10px; }
.fc-title { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fc-range { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin-top: 3px; }
.fc-range strong { font-size: 16px; font-weight: 500; }
.fc-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fc-facts div { display: flex; flex-direction: column; gap: 2px; }
.fc-facts span { font-size: 11px; color: var(--muted); }
.fc-facts strong { font-weight: 600; }
.fc-good { color: var(--up); }
.fc-mid { color: #f0cb6a; }
.fc-bad { color: var(--down); }
.fc-swatch { width: 14px; height: 8px; border-top: 2px dashed var(--up); border-bottom: 2px dashed var(--down); }

.howto-scan { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); }
.howto-scan summary { cursor: pointer; font-weight: 600; }
.howto-scan ol { margin: 10px 0 2px; padding-left: 20px; line-height: 1.65; color: var(--muted); }
.howto-scan strong { color: var(--text); }
.scan-context:empty { display: none; }
.scan-context { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); padding: 0 4px; line-height: 1.5; }
.scan-context strong { color: var(--text); }
.edges:empty { display: none; }
.edges-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.edges-head { display: flex; justify-content: space-between; align-items: center; }
.edges-card p { margin: 0; }
.edge-list { display: flex; flex-direction: column; gap: 5px; }
.edge-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; }
.edge-row:hover { border-color: #3a4356; }
.edge-iv { font-weight: 600; min-width: 34px; color: var(--accent); }
.take-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.j-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.j-stats div, .sig-nums div { display: flex; flex-direction: column; gap: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
.j-stats span, .sig-nums span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.j-stats strong, .sig-nums strong { font-weight: 500; font-size: 15px; }
.j-open { display: flex; flex-direction: column; gap: 8px; }
.j-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.j-card-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.j-coin { font-weight: 700; font-size: 15px; color: var(--text); text-decoration: none; }
.j-live { margin-left: auto; font-size: 16px; }
.j-progress { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(240,80,110,.5), #2a3140 50%, rgba(34,197,94,.5)); }
.j-progress i { position: absolute; top: -4px; width: 4px; height: 14px; border-radius: 2px; background: var(--text); transform: translateX(-50%); }
.j-progress-labels { display: flex; justify-content: space-between; }
.j-edit, .j-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.j-form { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; align-items: end; }
.j-edit label, .j-form label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.j-edit input, .j-form input, .j-form select, .j-close input { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; color: var(--text); padding: 6px 8px; font: 13px var(--mono); min-width: 0; }
.j-close { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.j-close input { width: 130px; }
.j-add { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.j-add summary { cursor: pointer; font-weight: 600; }

.sig-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sig-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.sig-title { display: flex; flex-direction: column; gap: 4px; }
.sig-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sig-nums div { padding: 7px 8px; }
.sig-nums strong { font-size: 14px; }

.ai-tab-btn .ai-badge { font-size: 9.5px; }
.ai-chat { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; padding: 2px; }
.ai-chat[hidden] { display: none; }
.msg { padding: 10px 12px; border-radius: 12px; line-height: 1.5; max-width: 92%; }
.msg p { margin: 0 0 6px; }
.msg p:last-child { margin: 0; }
.msg ul { margin: 4px 0; padding-left: 18px; }
.msg-user { align-self: flex-end; background: #173a2c; border: 1px solid #2d6b51; }
.msg-ai { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); }
.msg-err { border-color: rgba(240,80,110,.4); }
.ai-chat > .link-btn { align-self: flex-start; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; }
.chip:hover { color: var(--text); border-color: #3a4356; }
.ai-form { display: flex; gap: 8px; align-items: stretch; }
.ai-form textarea { flex: 1; resize: vertical; min-height: 44px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 10px 12px; font: 14px var(--font); outline: none; }
.ai-form textarea:focus { border-color: var(--accent); }
.typing { display: inline-flex; gap: 3px; margin-right: 6px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }

@media (max-width: 1180px) {
  .j-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .forecast-box { margin: 0 14px 4px; }
  .fc-facts, .sig-groups { grid-template-columns: minmax(0, 1fr); }
  .j-stats, .j-edit, .j-form, .sig-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.money-fields { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.5fr); }
@media (max-width: 760px) { .money-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .money-fields label:last-child { grid-column: 1 / -1; } }

/* Stocks */
.kind-tag { display: inline-block; margin-left: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 5px; border-radius: 4px; background: rgba(122,162,255,.16); color: #a9c1ff; vertical-align: 1px; }
.sr-head { padding: 7px 11px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 1px solid var(--line); }
.sr-head:first-child { border-top: 0; }
.mkt { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; font-family: var(--font); }
.mkt.open { background: rgba(34,197,94,.16); color: #6ee7a0; }
.mkt.closed { background: #2a3140; color: var(--muted); }

/* Watchlist: color = Entryvex's verdict. Green = buy signal now, red = don't buy now, yellow = not enough data to judge. */
.watchlist li.sig-buy { box-shadow: inset 3px 0 0 var(--up); background: rgba(34,197,94,.07); }
.watchlist li.sig-wait { box-shadow: inset 3px 0 0 var(--down); background: rgba(240,80,110,.05); }
.watchlist li.sig-unknown { box-shadow: inset 3px 0 0 #e8b931; background: rgba(232,185,49,.06); }
.watchlist li.active { background: #1c2330; }
.watchlist li.active:not(.sig-buy):not(.sig-wait):not(.sig-unknown) { box-shadow: inset 3px 0 0 var(--accent); }
.watchlist li.active { outline: 1px solid rgba(120,140,255,.35); outline-offset: -1px; }
.wl-sig { display: inline-block; margin-left: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; vertical-align: 1px; }
.wl-sig.buy { background: rgba(34,197,94,.18); color: #6ee7a0; }
.wl-sig.wait { background: rgba(240,80,110,.16); color: #ff8fa6; }
.wl-sig.unknown { background: rgba(232,185,49,.16); color: #f1cd5c; }
.wl-sig.checking { background: #2a3140; color: var(--muted); }
.wl-price.blip-up { color: var(--up); transition: color .2s; }
.wl-price.blip-down { color: var(--down); transition: color .2s; }
.wl-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); padding: 4px 2px 6px; }
.wl-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }
.scan-all-btn { display: inline-flex; align-items: center; gap: 6px; }
.scan-all-btn[disabled] { opacity: .65; cursor: progress; }
.sr-tip { padding: 8px 11px 2px; }
/* Remove button no longer covers the price: the row makes room for it on hover */
.watchlist li { transition: padding-right .12s; }
.watchlist li:hover { padding-right: 34px; }
.wl-remove { top: 50%; transform: translateY(-50%); right: 6px; }

/* "Entryvex says" decision panel */
.decision:empty { display: none; }
.decision { margin: 4px 18px 10px; }
.d-card { border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.d-top { display: flex; gap: 16px; align-items: center; }
.d-verdict { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.d-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.d-verdict strong { font-size: 22px; font-weight: 800; letter-spacing: .01em; line-height: 1.15; }
.d-headline { line-height: 1.5; font-size: 14px; }
.d-buy { border-color: rgba(34,197,94,.45); background: linear-gradient(180deg, rgba(34,197,94,.10), var(--panel-2) 70%); }
.d-buy .d-verdict strong, .d-hold .d-verdict strong { color: #4ade80; }
.d-caution { border-color: rgba(224,179,65,.45); background: linear-gradient(180deg, rgba(224,179,65,.09), var(--panel-2) 70%); }
.d-caution .d-verdict strong { color: #f0cb6a; }
.d-no { border-color: rgba(240,80,110,.4); background: linear-gradient(180deg, rgba(240,80,110,.08), var(--panel-2) 70%); }
.d-no .d-verdict strong, .d-sell .d-verdict strong { color: #ff7d97; }
.d-sell { border-color: rgba(240,80,110,.6); background: linear-gradient(180deg, rgba(240,80,110,.14), var(--panel-2) 70%); animation: dpulse 2s infinite; }
@keyframes dpulse { 50% { box-shadow: 0 0 0 3px rgba(240,80,110,.15); } }
.d-hold { border-color: rgba(46,229,157,.4); }
.d-wait .d-verdict strong { color: var(--text); }
.d-steps { margin: 0; padding-left: 20px; line-height: 1.7; }
.d-steps li { padding-left: 2px; }
.d-meter-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.d-meter-top strong { font-size: 18px; color: var(--text); font-family: var(--mono); }
.d-bar { position: relative; height: 10px; border-radius: 5px; background: #232a35; margin-top: 6px; overflow: hidden; }
.d-bar i { position: absolute; top: 0; bottom: 0; }
.d-range { background: rgba(122,162,255,.25); }
.d-fill { left: 0; background: linear-gradient(90deg, #2e7d5b, var(--up)); opacity: .85; }
.d-be { width: 2px; background: #f0cb6a; }
.d-more summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.d-more[open] summary { margin-bottom: 8px; }
.d-checks { display: flex; flex-direction: column; gap: 6px; }
.d-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.d-check strong { font-weight: 600; margin-right: 4px; }
.d-ico { width: 14px; flex: none; font-size: 11px; margin-top: 2px; }
.eff-pos .d-ico { color: var(--up); }
.eff-neg .d-ico { color: var(--down); }
.eff-neu .d-ico { color: #5d677a; }
.d-more p { margin: 8px 0 0; }

/* Open trade advice in My trades */
.j-advice { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.45; }
.j-advice strong { font-weight: 800; white-space: nowrap; }
.adv-hold { background: rgba(46,229,157,.08); }
.adv-hold strong { color: #4ade80; }
.adv-sell { background: rgba(240,80,110,.14); }
.adv-sell strong { color: #ff7d97; }

@media (max-width: 760px) {
  .decision { margin: 4px 14px 10px; }
  .d-top { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* Opportunities board */
.opps-status { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.opps-list { display: flex; flex-direction: column; gap: 5px; }
.opp-row { display: grid; grid-template-columns: 64px 40px auto 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-size: 13px; }
.opp-row:hover { border-color: #3a4356; }
.opp-buy { border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.07); }
.opp-coin { font-weight: 700; }
.opp-iv { color: var(--accent); }
.d-elsewhere { display: block; margin-top: 4px; font-size: 13px; }
@media (max-width: 760px) {
  .opp-row { grid-template-columns: 56px 36px 1fr; }
  .opp-row > span:nth-child(4), .opp-row > span:nth-child(5) { grid-column: 1 / -1; }
}

/* Install button + welcome guide */
#install-btn[hidden] { display: none; }
.welcome { position: fixed; inset: 0; z-index: 80; background: rgba(5,7,10,.72); display: grid; place-items: center; padding: 16px; }
.welcome[hidden] { display: none; }
.welcome-card { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 22px 16px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.welcome-steps section { display: flex; flex-direction: column; gap: 10px; min-height: 190px; }
.welcome-steps section[hidden] { display: none; }
.welcome-steps h2 { font-size: 19px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0; }
.welcome-steps p { margin: 0; line-height: 1.55; }
.w-ico { font-size: 30px; }
.welcome-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.w-dots { display: flex; gap: 6px; }
.w-dots i { width: 7px; height: 7px; border-radius: 50%; background: #2a3140; }
.w-dots i.on { background: var(--accent); }
.w-btns { display: flex; gap: 14px; align-items: center; }
#show-welcome { margin-top: 10px; }

.pill-flat { background: #2a3140; color: #b9c3d4; }
.al-list li.unread { border: 1px solid rgba(46,229,157,.35); }
.new-dot { font-size: 9.5px; font-weight: 800; letter-spacing: .05em; padding: 1px 5px; border-radius: 4px; background: var(--accent); color: #062312; vertical-align: 1px; }

/* Drag to reorder the watchlist */
.watchlist li { padding-left: 22px; }
.wl-grip { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 14px; text-align: center; color: #4a5468; cursor: grab; font-size: 13px; letter-spacing: -2px; touch-action: none; user-select: none; padding: 6px 0; }
.watchlist li:hover .wl-grip { color: var(--muted); }
.watchlist.is-dragging { cursor: grabbing; }
.watchlist.is-dragging .wl-grip { cursor: grabbing; }
.watchlist li.dragging { opacity: .9; background: #232b38 !important; box-shadow: 0 6px 18px rgba(0,0,0,.4), inset 3px 0 0 var(--accent) !important; z-index: 2; }

/* Phones: show every tab (wrap into pills instead of scrolling sideways) */
@media (max-width: 760px) {
  .tabs { flex-wrap: wrap; overflow: visible; border-bottom: 0; gap: 6px; }
  .tabs button { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; margin: 0; font-size: 13px; }
  .tabs button.on { border-color: var(--accent); background: rgba(46,229,157,.08); }
}

/* Market movers */
.movers-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.movers-head .live-dot { display: inline-block; vertical-align: 1px; margin-right: 4px; animation: pulse 2s infinite; }
.movers-table td { vertical-align: middle; }
.movers-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1180px) { .movers-split { grid-template-columns: minmax(0, 1fr); } }

/* "When would Entryvex say BUY?" + predictions */
.d-when { border-top: 1px solid var(--line); padding-top: 10px; }
.d-when-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.d-when p { margin: 4px 0 0; line-height: 1.5; }
.d-trig { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.d-trig li { line-height: 1.5; font-size: 13.5px; }
.d-trig .pill { margin-right: 4px; }

/* Long-term view */
.longterm:empty { display: none; }
.longterm { margin: 0 18px 10px; }
.lt-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.lt-card p { margin: 0; line-height: 1.5; }
.lt-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lt-hold { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lt-hold div { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: var(--panel); }
.lt-hold span { font-size: 11px; color: var(--muted); }
.lt-hold strong { font-size: 16px; }
.lt-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.lt-grid div { display: flex; flex-direction: column; gap: 2px; }
.lt-grid span { font-size: 11px; color: var(--muted); }
.lt-grid strong { font-family: var(--mono); font-weight: 500; }
.lt-fund { border-top: 1px solid var(--line); padding-top: 8px; }
@media (max-width: 1180px) { .lt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .longterm { margin: 0 14px 10px; } .lt-hold { grid-template-columns: minmax(0, 1fr); } }

/* "If you buy now" */
.buynow:empty { display: none; }
.bn-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, rgba(122,162,255,.05), transparent 60%); }
.bn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.bn-amount { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bn-amount .inp { width: 130px; }
.bn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bn-grid div { display: flex; flex-direction: column; gap: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
.bn-grid span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bn-grid strong { font-weight: 500; font-size: 15px; }
.bn-grid small { font-size: 11.5px; line-height: 1.35; }
.bn-grid .bn-good { border-color: rgba(34,197,94,.4); }
.bn-grid .bn-bad { border-color: rgba(240,80,110,.35); }
.bn-verdict { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); }
@media (max-width: 1180px) { .bn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .bn-grid { grid-template-columns: minmax(0, 1fr); } }

/* Watchlist briefing */
.ai-briefing { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel-2); display: flex; flex-direction: column; gap: 8px; }
.brief-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.brief-list { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; font-size: 13.5px; }
.brief-sym { font-weight: 700; color: var(--accent); text-decoration: none; margin-right: 4px; }
.brief-watch { margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(224,179,65,.08); border: 1px solid rgba(224,179,65,.25); }
.ai-briefing p { margin: 0; }
.brief-chg { font-size: 12px; margin-right: 6px; }

/* Trading style bar */
.style-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px 0; }
.style-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.style-seg button { padding: 6px 12px; }
.style-hint { flex: 1; min-width: 180px; }

/* Order of the cards in the center column depends on the trading style */
.chart-panel > .style-bar { order: 1; }
.chart-panel > .chart-head { order: 2; }
.chart-panel > .toolbar { order: 3; }
.chart-panel > #chart { order: 4; }
.chart-panel > #decision { order: 5; }
.chart-panel > #forecast-box { order: 6; }
.chart-panel > #longterm { order: 7; }
.chart-panel > #scanner { order: 8; }
.style-hold .chart-panel > #longterm { order: 5; }
.style-hold .chart-panel > #decision { order: 6; }
.style-hold .chart-panel > #forecast-box { order: 7; }

/* Long-term card as a collapsible section */
details.lt-card > summary { list-style: none; cursor: pointer; flex-wrap: wrap; }
details.lt-card > summary::-webkit-details-marker { display: none; }
details.lt-card > summary::before { content: "▸"; color: var(--muted); margin-right: 6px; transition: transform .15s; display: inline-block; }
details.lt-card[open] > summary::before { transform: rotate(90deg); }
.lt-head { display: flex; align-items: center; gap: 10px; }
.lt-sum { color: var(--muted); flex: 1; }
.lt-sum strong { color: var(--text); }
details.lt-card:not([open]) { padding-bottom: 12px; }

/* Research tabs: five compact tabs */
.research-head { flex-wrap: wrap; row-gap: 8px; }
.research-tabs button { padding: 3px 7px; font-size: 11.5px; }

/* World markets */
.world-head { padding-top: 2px; }
.world-group { display: flex; flex-direction: column; gap: 2px; }
.world-gname { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 4px; font-weight: 600; }
.world-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 64px auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; border: 0; background: none; text-align: left; cursor: pointer; width: 100%; }
.world-row:hover { background: var(--panel-2); }
.w-flag { font-size: 15px; }
.w-name { display: flex; flex-direction: column; font-size: 13px; font-weight: 500; min-width: 0; }
.w-name small { font-size: 10.5px; font-weight: 500; }
.w-open { color: var(--up); }
.w-closed { color: var(--muted); }
.w-num { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.spark { display: block; }

/* Economic calendar */
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-day { display: flex; flex-direction: column; gap: 2px; }
.cal-row { display: grid; grid-template-columns: 44px 20px minmax(0, 1fr) auto; grid-template-areas: "time flag title pill" ". . cd cd"; gap: 2px 8px; align-items: center; padding: 7px 8px; border-radius: 8px; font-size: 13px; }
.cal-time { grid-area: time; color: var(--muted); }
.cal-flag { grid-area: flag; }
.cal-title { grid-area: title; display: flex; flex-direction: column; line-height: 1.35; }
.cal-title small { font-size: 11px; }
.cal-row .pill { grid-area: pill; }
.cal-cd { grid-area: cd; font-size: 11px; }
.cal-soon { background: rgba(240,80,110,.1); border: 1px solid rgba(240,80,110,.35); }
.cal-past { opacity: .5; }

/* Headlines */
.tag.region { background: rgba(122,162,255,.16); color: #a9c1ff; }
.headlines-toggle { align-self: flex-start; margin-bottom: 4px; }

@media (max-width: 760px) {
  .style-bar { padding: 12px 14px 0; }
  .style-seg button { padding: 6px 8px; font-size: 12px; }
}

/* Stock picks (Entryvex Stock Rank) */
.picks-intro { margin-bottom: 8px; }
.picks-load { padding: 18px 4px; color: var(--muted); font-size: 13px; }
.picks-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 6px 0; }
.pk-row { display: grid; grid-template-columns: 34px minmax(0, 2.2fr) 1fr 0.8fr 0.8fr 0.7fr; gap: 8px; align-items: center; padding: 8px 10px; background: transparent; border: 0; border-top: 1px solid var(--line); color: inherit; text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.pk-row:first-child { border-top: 0; }
.pk-row:hover:not(.pk-head) { background: #1a2130; }
.pk-head { cursor: default; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #141a24; }
.pk-row.pk-top { box-shadow: inset 3px 0 0 var(--up); }
.pk-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picks-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.picks-stats > div { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.picks-stats span { font-size: 11px; color: var(--muted); }
.picks-stats strong { font-size: 18px; }
.picks-chart { width: 100%; height: 220px; margin-top: 6px; }
.picks-legend { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); margin: 4px 0 8px; }
.picks-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: 3px; }
.picks-facts { margin: 6px 0 10px; padding-left: 18px; line-height: 1.55; }
.picks-honest { margin: 8px 0; }
.picks-honest summary { cursor: pointer; font-size: 13px; }
@media (max-width: 640px) {
  .pk-row { grid-template-columns: 26px minmax(0, 1.8fr) 1fr 0.8fr; }
  .pk-row span:nth-child(5), .pk-row span:nth-child(6) { display: none; }
  .picks-stats { grid-template-columns: 1fr; }
}

.rank-pill { margin-left: 6px; font: 600 10.5px var(--font); padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: #1a2130; color: var(--muted); cursor: pointer; }
.rank-pill.top { border-color: rgba(46,229,157,.5); color: #6ee7a0; background: rgba(46,229,157,.08); }
.wl-summary { font-size: 11px; color: var(--muted); padding: 0 2px 6px; }
.wl-summary strong.b { color: #6ee7a0; } .wl-summary strong.w { color: #ff8fa6; } .wl-summary strong.u { color: #f1cd5c; }

/* Earnings card (US stocks) */
.chart-panel > #earnings-box { order: 5; }
.style-hold .chart-panel > #earnings-box { order: 6; }
.earn-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; }
.earn-card.earn-soon { border-color: rgba(232,185,49,.55); }
.earn-card p { margin: 0; }
.earn-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.earn-chip { font: 11px var(--mono); padding: 2px 7px; border-radius: 999px; background: #1a2130; border: 1px solid var(--line); }
.earn-row.earn-mine { box-shadow: inset 3px 0 0 var(--accent); }

/* Candle tooltip that follows the cursor on the chart */
#chart { position: relative; }
.chart-tip { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; min-width: 170px; padding: 8px 10px; border-radius: 9px;
  background: rgba(16,20,28,.94); border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0,0,0,.35); font-size: 12px; }
.ct-time { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.ct-grid { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.ct-grid span, .ct-vol span { color: var(--muted); }
.ct-grid b { font: 600 12px var(--mono); text-align: right; font-weight: 600; }
.ct-grid b small { font-size: 10.5px; }
.ct-vol { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.ct-vol + .ct-vol { border-top: 0; margin-top: 0; padding-top: 0; }
.ct-vol strong { font: 600 12px var(--mono); }
@media (hover: none) { .chart-tip { min-width: 150px; font-size: 11px; } }

/* AI news read */
.nai-score { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; }
.nai-label { font-weight: 600; font-size: 13px; text-transform: capitalize; min-width: 120px; }
.nai-bar { position: relative; flex: 1; height: 6px; border-radius: 999px; background: linear-gradient(90deg, rgba(240,80,110,.7), #2a3140 50%, rgba(34,197,94,.7)); }
.nai-bar i { position: absolute; top: -4px; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: var(--text); }
.nai-top { margin: 6px 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.nai-top a { color: inherit; }
.nai-record { margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.nai-pool { margin-top: 4px; }

/* "If you buy now": big colored results, simple amount box */
.bn-amount { flex-direction: column; align-items: flex-end; gap: 3px; }
.bn-amount .inp { width: 220px; }
.bn-grid strong.bn-big { font: 700 21px var(--mono); line-height: 1.2; }
.bn-grid strong.bn-big span { font-size: 12px; text-transform: none; letter-spacing: 0; }
.bn-grid div.bn-range { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; background: none; border: 0; padding: 0; border-radius: 0; }
.bn-grid span.bn-to { font-size: 13px; text-transform: none; letter-spacing: 0; }
.bn-grid small strong { font-size: 11.5px; font-weight: 600; }
@media (max-width: 640px) { .bn-amount { align-items: stretch; width: 100%; } .bn-amount .inp { width: 100%; } .bn-grid strong.bn-big { font-size: 18px; } }

/* gap between candle sizes and the 1Y/5Y/ALL views */
.seg .seg-gap { width: 1px; align-self: stretch; margin: 3px 4px; background: var(--line); }
.ct-pat { margin-top: 5px; padding-top: 4px; border-top: 1px solid var(--line); font-weight: 600; font-size: 12px; }

/* Phones: candle sizes + 1Y/5Y/ALL wrap instead of overflowing the screen */
@media (max-width: 640px) {
  #intervals { flex-wrap: wrap; max-width: 100%; }
  #intervals button { padding: 5px 8px; }
  #intervals .seg-gap { display: none; }
  .toolbar { flex-wrap: wrap; min-width: 0; }
}
.d-regime { margin: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ---------- Clean-up pass ---------- */
/* Money settings: one tidy row now that the daily stop is gone */
.money { grid-template-columns: 1fr; }
.money-fields { grid-template-columns: minmax(150px, 1.2fr) minmax(110px, .8fr) minmax(200px, 1.6fr); max-width: 680px; }
@media (max-width: 640px) { .money-fields { grid-template-columns: 1fr 1fr; } .money-fields label:last-child { grid-column: 1 / -1; } }
/* Style switch: the hint lives in the tooltip */
.style-hint { display: none; }
/* Watchlist summary doubles as the color key */
.wl-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 2px 2px 8px; }
.wl-summary .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.wl-summary .when { margin-left: auto; }
.d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.d-actions > span { flex: 1 1 220px; }
/* Chart grows with the window on big screens */
@media (min-width: 900px) { .chart { height: clamp(380px, 58vh, 620px); } }
#setups tr.row-more { display: none; }
#setups tfoot td { padding: 8px 10px; text-align: center; }

/* Forecast: shaded zone + one-line caption on the chart */
.fc-zone { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; }
.fc-caption { position: absolute; left: 10px; top: 8px; right: 90px; z-index: 3; pointer-events: none; font-size: 12px; line-height: 1.45;
  color: var(--muted); background: rgba(13,17,23,.72); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; width: fit-content; max-width: 560px; }
.fc-caption strong { color: var(--text); }
.fc-zone-swatch { display: inline-block; width: 18px; height: 9px; border-radius: 3px; vertical-align: 0; background: rgba(122,162,255,0.35); border: 1px solid rgba(122,162,255,0.6); }
@media (max-width: 640px) { .fc-caption { font-size: 11px; right: 10px; } }

/* Watchlist / Browse tabs and the Browse lists */
.wl-head { padding-bottom: 6px; }
.wl-tabs { display: flex; gap: 4px; width: 100%; }
.wl-tabs button { flex: 1; }
#wl-view, #browse-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#wl-view[hidden], #browse-view[hidden] { display: none; }
.browse-seg { margin: 0 12px 8px; display: flex; }
.browse-seg button { flex: 1; padding: 5px 4px; }
.browse-meta { padding: 0 14px 6px; }
.browse-list li { grid-template-columns: 26px minmax(0, 1fr) auto 26px; grid-template-areas: "rank base price add" "rank name chg add"; padding: 7px 8px; }
.browse-list li:hover { padding-right: 8px; }
.browse-list .br-rank { grid-area: rank; color: var(--muted); font-size: 11px; text-align: right; }
.browse-list .wl-base { grid-area: base; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browse-list .wl-name { grid-area: name; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browse-list .wl-price { grid-area: price; }
.browse-list .wl-chg { grid-area: chg; }
.br-add { grid-area: add; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 14px; line-height: 1; }
.br-add:hover { border-color: var(--accent); }
.br-add.added { color: var(--up); border-color: rgba(34,197,94,.4); }
.br-empty { cursor: default; display: block !important; }
.brand-scan { margin-left: 12px; padding: 5px 12px; }
@media (max-width: 640px) { .brand-scan { margin-left: 8px; padding: 5px 9px; } .brand-scan span { display: none; } }
.al-ntfy { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.al-ntfy h4 { margin: 0 0 4px; font-size: 13px; }
.al-steps { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.al-topic { display: inline-block; padding: 2px 6px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); user-select: all; word-break: break-all; }
