:root,
[data-theme="dark"] {
  /* BullAnt: charcoal and gold, from the brand artwork */
  --bg: #121318;
  --panel: #181b21;
  --panel-2: #22262e;
  --border: #262a32;
  --text: #e3e5e9;
  --muted: #868b95;
  --accent: #fad524;
  --accent-ink: #121318;
  --accent-soft: rgba(250, 213, 36, 0.16);
  --up: #089981;
  --down: #f23645;
  --hover: #22262e;
  --grid: rgba(38, 42, 50, 0.6);
  --input: #121318;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --gold: #fad524;
  --gold-soft: rgba(250, 213, 36, 0.14);
  --scroll: #353a44;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #ffffff;
  --panel: #f7f7f5;
  --panel-2: #eeeee9;
  --border: #e3e3dc;
  --text: #15161a;
  --muted: #6a6c73;
  --accent: #d9ab00;
  --accent-ink: #15161a;
  --accent-soft: rgba(217, 171, 0, 0.16);
  --up: #089981;
  --down: #f23645;
  --hover: #eeeee9;
  --grid: rgba(227, 227, 220, 0.7);
  --input: #ffffff;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  --gold: #b88f00;
  --gold-soft: rgba(184, 143, 0, 0.14);
  --scroll: #c9c9c0;
  color-scheme: light;
}
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
*:hover {
  scrollbar-color: var(--scroll) transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}
:hover::-webkit-scrollbar-thumb {
  background: var(--scroll);
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font:
    13px/1.4 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Ubuntu,
    "Helvetica Neue",
    Arial,
    sans-serif;
  overflow: hidden;
}
button,
select,
input,
textarea {
  font: inherit;
  color: inherit;
}
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.hidden {
  display: none !important;
}
.spacer {
  flex: 1;
}
.up {
  color: var(--up);
}
.down {
  color: var(--down);
}
.muted {
  color: var(--muted);
}

/* top bar */
.topbar {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
  overflow-y: hidden;
}
.topbar::-webkit-scrollbar {
  height: 0;
}
.brand {
  display: flex;
  align-items: center;
  padding: 0 8px 0 2px;
}
.sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 6px;
  flex: none;
}
.tb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
}
a.tb {
  color: inherit;
  text-decoration: none;
}
.tb:hover,
.tb.active {
  background: var(--hover);
}
.tb.on {
  color: var(--accent);
}
.tb.icon {
  padding: 0 7px;
}
select.tb {
  appearance: none;
  padding-right: 22px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 12px) 14px,
    calc(100% - 8px) 14px;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}
select.tb option {
  background: var(--panel);
}
.tb.check {
  gap: 5px;
  color: var(--muted);
}
.symbol-btn {
  font-weight: 600;
  font-size: 14px;
}
.tf-group {
  display: flex;
  gap: 1px;
  flex: none;
}
.tf-group button {
  height: 32px;
  min-width: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  padding: 0 6px;
}
.tf-group button:hover {
  background: var(--hover);
}
.tf-group button.active {
  color: var(--accent);
  background: var(--accent-soft);
}
.tf-custom {
  width: 46px;
  height: 28px;
  margin-left: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input);
  padding: 0 6px;
  text-align: center;
  flex: none;
}
.status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  margin: 0 6px 0 8px;
  flex: none;
}
.status.ok {
  background: var(--up);
}
.status.warn {
  background: #f7a600;
}
.status.bad {
  background: var(--down);
}

/* main layout */
.main {
  display: flex;
  height: calc(100% - 44px);
}
.drawbar {
  width: 44px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
  gap: 2px;
  flex: none;
}
.drawbar button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.drawbar button:hover {
  background: var(--hover);
}
.drawbar button.active {
  color: var(--accent);
  background: var(--accent-soft);
}
.drawbar hr {
  width: 24px;
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.grid {
  flex: 1;
  display: grid;
  gap: 1px;
  background: var(--border);
  min-height: 0;
}
.side {
  width: var(--side-w, 300px);
  position: relative;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex: none;
  background: var(--bg);
}

/* right panel: drag the left edge to resize, chevron to hide */
.side.hidden { display: none; }
.side-resize {
  position: absolute; left: -4px; top: 0; bottom: 0; width: 8px;
  cursor: col-resize; z-index: 5;
}
.side-resize::after {
  content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px;
  background: transparent; transition: background .15s;
}
.side-resize:hover::after, body.side-dragging .side-resize::after { background: var(--accent); }
body.side-dragging { cursor: col-resize; user-select: none; }
body.side-dragging iframe, body.side-dragging canvas { pointer-events: none; }
/* the hide arrow is pinned: tab names shrink (with …) before it can be pushed out of view */
#sideTabs { overflow: hidden; }
#sideTabs button { padding: 0 8px; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
#sideTabs .spacer { flex: 1 1 0; min-width: 0; }
#sideTabs .side-hide { flex: none; padding: 0 5px; }
#sideTabs .side-hide svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.side-show {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 26px; padding: 10px 0; border: 0; border-left: 1px solid var(--border);
  background: var(--bg); color: var(--muted); cursor: pointer; font: inherit; font-size: 11px;
}
.side-show[hidden] { display: none; }
.side-show:hover { color: var(--accent); background: var(--hover); }
.side-show svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.side-show span { writing-mode: vertical-rl; letter-spacing: .04em; }

/* chart panes */
.pane {
  position: relative;
  background: var(--bg);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.pane.active::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  pointer-events: none;
  z-index: 5;
}
.grid[data-count="1"] .pane.active::after {
  display: none;
}
.pane .chart {
  position: absolute;
  inset: 0;
}
.legend {
  position: absolute;
  left: 8px;
  top: 6px;
  z-index: 4;
  pointer-events: none;
  font-size: 12px;
  max-width: calc(100% - 90px);
}
.legend.sub { top: 0; }
.legend.sub[hidden] { display: none; }
.legend .ind-where { font-size: 10px; padding: 0 4px; border-radius: 3px; background: var(--hover); }
.legend .row {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 20px;
}
.legend .title {
  font-weight: 600;
  font-size: 13px;
  pointer-events: auto;
  cursor: pointer;
}
.legend .ohlc span {
  margin-right: 6px;
}
.legend .ohlc b {
  font-weight: 400;
  color: var(--muted);
  margin-right: 2px;
}
.legend .ind {
  pointer-events: auto;
  border-radius: 3px;
  padding: 0 4px 0 2px;
}
.legend .ind:hover {
  background: var(--panel);
}
.legend .ind .name {
  color: var(--muted);
}
.legend .ind .acts {
  display: none;
  gap: 2px;
}
.legend .ind:hover .acts {
  display: inline-flex;
}
.legend .ind .acts button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0 2px;
  color: var(--muted);
  height: 18px;
}
.legend .ind .acts button:hover {
  color: var(--text);
}
.legend .ind .acts svg {
  width: 14px;
  height: 14px;
}
.legend .note {
  color: #f7a600;
  font-size: 11px;
  pointer-events: auto;
  white-space: normal;
  max-width: 420px;
}
.pane-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  z-index: 3;
  pointer-events: none;
  text-align: center;
  padding: 20px;
}
.replay-bar {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: 4px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  box-shadow: var(--shadow);
}
.replay-bar button,
.replay-bar select {
  height: 28px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  padding: 0 8px;
}
.replay-bar button:hover {
  background: var(--hover);
}
.replay-bar .hint {
  color: var(--muted);
  padding: 0 6px;
}

/* tabs and panels */
.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 0 6px;
  height: 38px;
  flex: none;
}
.tabs button {
  border: 0;
  background: transparent;
  height: 30px;
  padding: 0 10px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--muted);
  white-space: nowrap;
}
.tabs button:hover {
  background: var(--hover);
  color: var(--text);
}
.tabs button.active {
  color: var(--text);
  background: var(--hover);
}
.tabs .icon {
  padding: 0 6px;
}
.tab-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.bottom {
  height: 320px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex: none;
  background: var(--bg);
}
.bottom.collapsed {
  height: 39px;
}
.bottom.collapsed .tab-body {
  display: none;
}
.bottom.collapsed #bottomToggle svg {
  transform: rotate(180deg);
}
.pad {
  padding: 10px 12px;
}
.row-flex {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.field {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
}
.field > input,
.field > select {
  min-width: 70px;
}
input.in,
select.in,
textarea.in,
.field input,
.field select {
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input);
  padding: 0 7px;
  color: var(--text);
}
textarea.in {
  height: auto;
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  width: 100%;
  resize: vertical;
  tab-size: 2;
}
.btn {
  height: 28px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: var(--hover);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn.primary:hover {
  filter: brightness(1.1);
}
.btn.small {
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
}
.btn.danger {
  color: var(--down);
}
.link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}
.hint-text {
  color: var(--muted);
  font-size: 12px;
}

/* tables */
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.t th {
  position: sticky;
  top: 0;
  background: var(--bg);
  text-align: right;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  z-index: 1;
}
table.t td {
  text-align: right;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.t th:first-child,
table.t td:first-child,
table.t .l {
  text-align: left;
}
table.t tbody tr {
  cursor: pointer;
}
table.t tbody tr:hover {
  background: var(--hover);
}

/* watchlist */
.wl-head {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.wl-head select {
  flex: 1;
}
.wl-row {
  display: grid;
  grid-template-columns: 1fr auto 64px 18px;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.wl-row:hover {
  background: var(--hover);
}
.wl-row.current {
  background: var(--accent-soft);
}
.wl-row .sym {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wl-row .ex {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.wl-row .px {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.wl-row .chg {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.wl-row .x {
  opacity: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
}
.wl-row:hover .x {
  opacity: 1;
}
.wl-row .x svg {
  width: 14px;
  height: 14px;
}

/* cards in side panel */
.card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px;
  background: var(--panel);
}
.card .top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: start;
}
.card .sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.impact-High {
  color: var(--down);
}
.impact-Medium {
  color: #f7a600;
}
.impact-Low {
  color: var(--muted);
}
.impact-Holiday {
  color: var(--muted);
}

/* stats grid */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
.stat .k {
  color: var(--muted);
  font-size: 11px;
}
.stat .v {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.tester {
  display: grid;
  grid-template-columns: minmax(330px, 420px) 1fr;
  height: 100%;
}
.tester .left {
  border-right: 1px solid var(--border);
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 12px;
}
.tester .right {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rules {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 10px;
}
.rule {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px;
}
.rule select,
.rule input {
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input);
  padding: 0 5px;
  max-width: 150px;
}
.rule input.num {
  width: 70px;
}
.rule .x {
  margin-left: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}
h4 {
  margin: 10px 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.equity {
  height: 150px;
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
}
.next-step {
  font-size: 12px;
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding: 4px 10px;
}

/* heatmap */
.heatmap-wrap {
  position: relative;
  height: 100%;
}
.heatmap-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  box-shadow: var(--shadow);
  font-size: 12px;
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
  display: grid;
  place-items: start center;
  padding-top: 9vh;
}
.modal-card {
  width: min(560px, 94vw);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}
.modal-head button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}
.modal-body {
  padding: 12px 14px;
  overflow: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.search-in {
  width: 100%;
  height: 38px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input);
  padding: 0 12px;
  color: var(--text);
}
.list {
  margin-top: 8px;
}
.list .item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.list .item:hover,
.list .item.sel {
  background: var(--hover);
}
.list .item .meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.list .group {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 10px 4px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-grid .field input,
.form-grid .field select {
  width: 100%;
}

/* toasts */
.toasts {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  max-width: 360px;
  animation: in 0.2s ease-out;
}
.toast.err {
  border-left-color: var(--down);
}
.toast.alert {
  border-left-color: #f7a600;
}
@keyframes in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .side, .side-show {
    display: none;
  }
  .bottom {
    height: 45%;
  }
}

/* robustness checks verdict */
.q-verdict { display: inline-block; margin: 8px 0; padding: 4px 10px; border-radius: 4px; font-weight: 600; background: var(--hover); }
.q-verdict.up { color: var(--up); } .q-verdict.down { color: var(--down); } .q-verdict.warn { color: #f7a600; }
.tester code { background: var(--hover); padding: 1px 4px; border-radius: 3px; font-size: 12px; }

/* news */
a.card.news { display: block; color: inherit; text-decoration: none; }
a.card.news:hover { border-color: var(--accent); }
.news-title { font-weight: 600; line-height: 1.35; }
.news-sum { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
/* seasonals */
.seas { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); height: 100%; }
.seas-left { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.seas-chart { flex: 1; min-height: 160px; position: relative; }
.seas-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 12px; font-size: 12px; }
.seas-legend i { display: inline-block; width: 10px; height: 3px; margin-right: 5px; vertical-align: middle; }
.seas-right { overflow: auto; }
.seas-table td, .seas-table th { padding: 4px 5px; font-size: 11px; text-align: center; }
.seas-table td.l, .seas-table th:first-child { text-align: left; }
.seas-sum td { font-weight: 600; border-top: 1px solid var(--border); }
/* financials */
.fin-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12px; }
.fin-stats div { display: flex; flex-direction: column; }
.fin-bars { display: flex; gap: 10px; align-items: flex-end; height: 150px; margin: 12px 0 4px; }
.fin-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.fin-stack { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.fin-bar { width: 38%; border-radius: 3px 3px 0 0; min-height: 1px; }
.fin-bar.rev { background: var(--accent); } .fin-bar.ni { background: var(--up); } .fin-bar.ni.neg { background: var(--down); }
.fin-col .sub { font-size: 10px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.replay-bar.follower { pointer-events: none; opacity: .8; }

/* gold: robustness checks and advanced statistics */
.gold-box { border: 1.5px solid var(--gold); border-radius: 8px; padding: 10px 12px; background: var(--panel); box-shadow: 0 0 0 3px var(--gold-soft); }
.gold-box { min-width: 0; overflow-x: auto; }
.gold-box table.t td, .gold-box table.t th, .tester .right table.t td, .tester .right table.t th { white-space: normal; }
.gold-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.gold-badge { background: var(--gold); color: #1a1405; font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 3px; letter-spacing: .03em; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1405; font-weight: 600; }
.btn.gold:hover { filter: brightness(1.08); }
.gold-text { color: var(--gold) !important; }
#tQuant { margin-top: 4px; }
table.t.heat td { text-align: center; } table.t.heat td.base { outline: 2px solid var(--gold); outline-offset: -2px; font-weight: 700; }
.q-verdict.warn { color: #f7a600; }


/* clear close button for the bottom panel (strategy tester, screener, financials…) */
.bottom-close { display: inline-flex; align-items: center; gap: 5px; height: 26px; margin: 0 6px 0 4px; padding: 0 10px 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; flex: none; align-self: center; }
.bottom-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.bottom-close:hover { background: var(--down); border-color: var(--down); color: #fff; }
.bottom.collapsed .bottom-close { display: none; }
/* keep Close and the fold arrow pinned to the right even when the tab row scrolls */
#bottomTabs .bottom-close, #bottomTabs #bottomToggle { position: sticky; z-index: 2; box-shadow: -10px 0 10px var(--bg); }
#bottomTabs .bottom-close { right: 36px; }
#bottomTabs #bottomToggle { right: 0; background: var(--bg); }
#bottomTabs .bottom-close { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
#bottomTabs .bottom-close:hover { background: var(--down); border-color: var(--down); color: #fff; }
#bottomTabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
#bottomTabs::-webkit-scrollbar { height: 0; }

/* hover label for the drawing toolbar on the left of the chart */
.draw-tip { position: fixed; z-index: 70; pointer-events: none; display: flex; flex-direction: column; gap: 2px; max-width: 240px; padding: 7px 11px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 7px; box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.35; }
.draw-tip[hidden] { display: none; }
.draw-tip b { font-weight: 650; }
.draw-tip span { color: var(--muted); font-size: 11.5px; }
.draw-tip::before { content: ""; position: absolute; left: -7px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-right-color: var(--accent); border-left: 0; }

/* ---------- BullAgent chat (bottom panel) ---------- */
.bottom.agent-mode:not(.collapsed) { height: min(56vh, 600px); }
#bottomTabs .agent-tab { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; }
#bottomTabs .agent-tab img { border-radius: 3px; }
.ag { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.ag-state { padding: 16px; color: var(--muted); }
.ag-top { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--border); flex: none; }
.ag-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.ag-name img { border-radius: 4px; }
.ag-model { height: 26px; font-size: 12px; max-width: 260px; }
.ag-top .spacer { flex: 1; }
.ag-log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.ag-hello { max-width: 760px; }
.ag-hello p { margin: 0 0 10px; color: var(--text); line-height: 1.5; }
.ag-sug { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-chip { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.ag-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.ag-msg { display: flex; flex-direction: column; gap: 6px; max-width: 860px; }
.ag-user { align-self: flex-end; align-items: flex-end; }
.ag-bubble { background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 14px 14px 4px 14px; line-height: 1.45; font-weight: 500; max-width: 640px; }
.ag-bot { align-self: flex-start; }
.ag-text { line-height: 1.55; font-size: 13.5px; }
.ag-text p { margin: 0 0 7px; }
.ag-text p:last-child { margin-bottom: 0; }
.ag-text ul { margin: 4px 0 8px; padding-left: 20px; }
.ag-text li { margin: 2px 0; }
.ag-text .ag-h { font-weight: 700; margin-top: 8px; }
.ag-text code { background: var(--hover); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.ag-text pre { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; overflow-x: auto; font-size: 12px; }
.ag-text a, .ag-src a { color: var(--accent); }
.ag-acts { display: flex; flex-wrap: wrap; gap: 5px; }
.ag-act { font-size: 11.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.ag-src { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; align-items: baseline; }
.ag-src span { color: var(--muted); font-weight: 600; }
.ag-cost { font-size: 11px; color: var(--muted); }
.ag-typing { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.ag-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: ag-dot 1.2s infinite ease-in-out; }
.ag-typing i:nth-child(2) { animation-delay: .15s; } .ag-typing i:nth-child(3) { animation-delay: .3s; }
.ag-typing span { margin-left: 6px; }
@keyframes ag-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ag-typing i { animation: none; opacity: .7; } }
.ag-err { color: var(--down); font-size: 12.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ag-input { display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px 4px; border-top: 1px solid var(--border); flex: none; }
.ag-input textarea { flex: 1; resize: none; min-height: 36px; max-height: 140px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--input); color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.4; }
.ag-input textarea:focus { outline: none; border-color: var(--accent); }
.ag-input .btn { height: 36px; padding: 0 16px; }
.ag-fine { margin: 0; padding: 2px 12px 6px; font-size: 11px; color: var(--muted); flex: none; }
.ag-setup { max-width: 640px; padding: 16px 20px; overflow-y: auto; }
.ag-setup-head { display: flex; gap: 14px; align-items: flex-start; }
.ag-setup-head img { border-radius: 9px; flex: none; }
.ag-setup h3 { margin: 0 0 4px; font-size: 16px; }
.ag-setup p { margin: 0 0 8px; line-height: 1.5; }
.ag-setup ol { margin: 8px 0 12px; padding-left: 20px; line-height: 1.7; }
.ag-setup a { color: var(--accent); }
.ag-setup code { background: var(--hover); padding: 1px 5px; border-radius: 4px; }
.ag-keyform { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-keyform input { flex: 1; min-width: 220px; height: 32px; }
.ag-keyform .btn { height: 32px; }

/* ---------- magnifying lens ---------- */
.lens { position: fixed; z-index: 60; width: 160px; height: 160px; border-radius: 50%; overflow: hidden; pointer-events: none; border: 2px solid var(--accent); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 10px 30px rgba(0, 0, 0, 0.55); background: var(--bg); }
.lens[hidden] { display: none; }
.lens-page { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; overflow: hidden; background: var(--bg); }
.lens-page * { transition: none !important; animation: none !important; }
.lens-cross { position: absolute; left: 0; top: 0; display: block; }
.lens-zoom { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 700; }
body.lens-on, body.lens-on * { cursor: none !important; }

/* earnings / dividend badge hover card */
.ev-tip { position: absolute; z-index: 6; pointer-events: none; display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 6px; background: var(--panel); border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0,0,0,.4); font-size: 12px; white-space: nowrap; }
.ev-tip[hidden] { display: none; }
.ev-tip b { font-weight: 600; }
.ev-tip span { color: var(--muted); }
.ev-tip em { font-style: normal; }
.ev-tip em.up { color: var(--up); } .ev-tip em.down { color: var(--down); }
