/* =====================================================================
   MERLIN CHART — terminal chart surface (own renderer: merlin_canvas.js)
   Layout: HUD strip on top, chart field (left, fluid) + operator rail
   (right, 300px). Rail stacks under the chart below 900px.
   Dark-only by design (terminal), every color is a token on .mc-root.
   ===================================================================== */
.mc-root {
  --mc-bg:      #07060c;
  --mc-panel:   #0d0b16;
  --mc-panel-2: #120f1f;
  --mc-line:    #241d38;
  --mc-line-2:  #33294f;
  --mc-text:    #d6d1ef;
  --mc-dim:     #7d76a0;
  --mc-faint:   #4a4466;
  --mc-up:      #2de2e6;
  --mc-down:    #ff3d9a;
  --mc-accent:  #ff9500;
  --mc-violet:  #9b5cff;
  --mc-gold:    #e0b341;
  --mc-bad:     #ff5c5c;
  --mc-good:    #5cf2a0;

  --mc-font-hud:  "Chakra Petch", "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --mc-font-data: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;

  color-scheme: dark;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 560px;
  background: var(--mc-bg);
  color: var(--mc-text);
  font-family: var(--mc-font-data);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--mc-line);
  box-sizing: border-box;
}
.mc-root *, .mc-root *::before, .mc-root *::after { box-sizing: border-box; }
.mc-root [hidden] { display: none !important; }

/* ---------------- HUD strip ---------------- */
.mc-hud {
  position: relative; z-index: 8;   /* ticker dropdown sits above the chart */
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px 16px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--mc-line);
  background: linear-gradient(180deg, var(--mc-panel-2), var(--mc-panel));
}
.mc-brand {
  font-family: var(--mc-font-hud);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--mc-dim);
  white-space: nowrap;
}
.mc-brand b { color: var(--mc-accent); font-weight: 700; }
.mc-sym {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--mc-font-hud);
}
.mc-symbox { position: relative; display: flex; align-items: center; border: 1px solid var(--mc-line-2); border-radius: 3px; background: var(--mc-bg); }
.mc-symbox:hover { border-color: var(--mc-dim); }
.mc-symbox:focus-within { border-color: var(--mc-accent); }
.mc-sym-input {
  background: transparent; border: 0; color: var(--mc-text); outline: none;
  font-family: var(--mc-font-hud); font-size: 20px; font-weight: 700; letter-spacing: 0.04em;
  width: 6.5ch; padding: 1px 2px 1px 8px; text-transform: uppercase; cursor: text;
}
.mc-sym-input.bad { color: var(--mc-bad); animation: mc-shake 0.3s; }
.mc-symcaret { background: transparent; border: 0; color: var(--mc-dim); cursor: pointer; padding: 0 7px 0 2px; font-size: 13px; align-self: stretch; }
.mc-symbox:hover .mc-symcaret, .mc-symbox:focus-within .mc-symcaret { color: var(--mc-accent); }
.mc-symdrop {
  position: absolute; top: calc(100% + 4px); left: -1px; z-index: 30; min-width: 200px; max-height: 340px; overflow-y: auto;
  background: var(--mc-panel); border: 1px solid var(--mc-line-2); border-top: 2px solid var(--mc-accent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55); padding: 4px 0;
}
.mc-symitem {
  display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 12px;
  background: transparent; border: 0; color: var(--mc-text); cursor: pointer; padding: 5px 12px; text-align: left;
}
.mc-symitem:hover, .mc-symitem.act { background: var(--mc-panel-2); }
.mc-symitem.act { box-shadow: inset 2px 0 0 var(--mc-accent); }
.mc-symitem.cur .mc-symt { color: var(--mc-accent); }
.mc-symt { font-family: var(--mc-font-hud); font-size: 14px; font-weight: 700; letter-spacing: 0.04em; }
.mc-symtag { font-family: var(--mc-font-data); font-size: 10px; color: var(--mc-faint); }
.mc-symempty { padding: 8px 12px; color: var(--mc-faint); font-size: 11px; }
@keyframes mc-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.mc-last { font-family: var(--mc-font-data); font-size: 18px; font-weight: 600; }
.mc-chg { font-size: 12px; }
.mc-up   { color: var(--mc-up); }
.mc-down { color: var(--mc-down); }

.mc-tfs { display: flex; gap: 2px; }
.mc-tf {
  background: transparent; color: var(--mc-dim);
  border: 1px solid transparent; border-radius: 3px;
  font-family: var(--mc-font-data); font-size: 11px;
  padding: 3px 8px; cursor: pointer;
}
.mc-tf:hover { color: var(--mc-text); border-color: var(--mc-line-2); }
.mc-tf[aria-pressed="true"] { color: var(--mc-bg); background: var(--mc-accent); }

/* OHLC is the part that gives way when the HUD is tight, so the tools never wrap */
.mc-ohlc { display: flex; gap: 12px; color: var(--mc-dim); flex-wrap: nowrap; white-space: nowrap;
           flex: 0 1 auto; min-width: 0; overflow: hidden;
           -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.mc-ohlc span i { font-style: normal; color: var(--mc-faint); margin-right: 3px; }

.mc-spacer { flex: 1 1 auto; }
.mc-tools { display: flex; gap: 4px; flex: none; }
.mc-brand, .mc-sym, .mc-tfs, .mc-clock { flex: none; }
.mc-tool {
  background: transparent; color: var(--mc-dim); border: 1px solid var(--mc-line-2); border-radius: 2px;
  font-family: var(--mc-font-hud); font-size: 10px; font-weight: 600; letter-spacing: 0.14em;
  padding: 3px 8px; cursor: pointer;
}
.mc-tool:hover { color: var(--mc-text); border-color: var(--mc-accent); }
.mc-tool[aria-pressed="true"] { color: var(--mc-accent); }
.mc-root.mc-rail-off .mc-rail { display: none; }
.mc-root.mc-fs { height: 100vh; min-height: 0; border: 0; }
.mc-clock { display: flex; align-items: center; gap: 10px; color: var(--mc-dim); white-space: nowrap; }
.mc-feed {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mc-font-hud); letter-spacing: 0.14em; font-size: 11px;
  padding: 2px 8px; border: 1px solid var(--mc-line-2); border-radius: 2px;
}
.mc-feed::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--mc-gold);
}
.mc-feed[data-state="live"]::before { background: var(--mc-good); animation: mc-blink 1.2s steps(2) infinite; }
.mc-feed[data-state="off"]::before  { background: var(--mc-bad); }
.mc-countdown b { color: var(--mc-text); font-weight: 600; }

/* ---------------- body ---------------- */
.mc-body { flex: 1 1 auto; display: flex; min-height: 0; }
.mc-field { position: relative; flex: 1 1 auto; min-width: 0; }
.mc-chart { position: absolute; inset: 0; }

/* HUD corner brackets around the chart field */
.mc-field::before, .mc-field::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border: 1px solid var(--mc-accent); opacity: 0.7; pointer-events: none; z-index: 4;
}
.mc-field::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.mc-field::after  { bottom: 30px; right: 70px; border-left: 0; border-top: 0; }

/* faint scanlines — static texture, no motion */
.mc-scan {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: repeating-linear-gradient(0deg, rgba(155,92,255,0.035) 0 1px, transparent 1px 3px);
}

/* study legend, top-left inside the field */
.mc-legend {
  position: absolute; top: 10px; left: 26px; z-index: 5;
  display: flex; flex-direction: column; gap: 2px;
  pointer-events: none; max-width: calc(100% - 120px);
}
.mc-legend-row { background: rgba(7,6,12,0.72); padding: 1px 6px 1px 4px; border-radius: 2px; width: fit-content; max-width: 100%;
  display: flex; gap: 8px; align-items: baseline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-legend-row .n { color: var(--mc-dim); }
.mc-legend-row .tag { font-size: 9px; color: var(--mc-faint); border: 1px solid var(--mc-line-2); padding: 0 3px; border-radius: 2px; }
.mc-legend-row .err { color: var(--mc-bad); }

/* last-price beacon */
.mc-beacon {
  position: absolute; z-index: 5; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; background: var(--mc-accent); pointer-events: none;
  box-shadow: 0 0 10px var(--mc-accent);
}
.mc-beacon::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid var(--mc-accent); animation: mc-ping 1.6s ease-out infinite;
}

/* ---------------- operator rail ---------------- */
.mc-rail {
  flex: 0 0 300px; display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid var(--mc-line); background: var(--mc-panel);
}
.mc-rail-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.mc-railbar { flex: none; display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--mc-line); background: var(--mc-panel-2); }
.mc-railbar .mc-btn { flex: 1 1 0; }
.mc-sec { border-bottom: 1px solid var(--mc-line); }
.mc-sec-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 6px;
  font-family: var(--mc-font-hud); font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; color: var(--mc-dim);
}
.mc-sec-h small { font-family: var(--mc-font-data); letter-spacing: 0; color: var(--mc-faint); font-weight: 400; }

/* level ladder */
.mc-ladder { padding: 0 6px 8px; display: flex; flex-direction: column; gap: 1px; }
.mc-rung {
  display: grid; grid-template-columns: 8px 1fr auto auto; gap: 8px; align-items: center;
  padding: 3px 6px; border-radius: 2px;
}
.mc-rung .sw { width: 8px; height: 2px; }
.mc-rung .lb { color: var(--mc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-rung .px { color: var(--mc-text); }
.mc-rung .d  { color: var(--mc-dim); width: 58px; text-align: right; }
.mc-rung.near { background: rgba(255,149,0,0.08); }
.mc-rung.near .d { color: var(--mc-accent); }
.mc-rung.price {
  background: var(--mc-accent); color: var(--mc-bg); font-weight: 700;
}
.mc-rung.price .lb, .mc-rung.price .px, .mc-rung.price .d { color: var(--mc-bg); }
.mc-empty { color: var(--mc-faint); padding: 4px 12px 10px; line-height: 1.5; }

/* studies */
.mc-studies { display: flex; flex-direction: column; padding: 0 6px 8px; gap: 4px; }
.mc-study { border: 1px solid var(--mc-line); border-radius: 3px; background: var(--mc-bg); }
.mc-study-h { display: flex; align-items: center; gap: 6px; padding: 5px 6px; }
.mc-study-h .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.mc-study-h .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-study-h .src.merlin { color: var(--mc-gold); border-color: var(--mc-gold); }
.mc-study-h .src.ai { color: var(--mc-violet); border-color: var(--mc-violet); }
.mc-study-h .src { font-size: 9px; color: var(--mc-faint); border: 1px solid var(--mc-line-2); padding: 0 4px; border-radius: 2px; }
.mc-study.off .nm { color: var(--mc-faint); text-decoration: line-through; }
.mc-study.bad { border-color: rgba(255,92,92,0.5); }
.mc-ib {
  background: transparent; border: 1px solid transparent; color: var(--mc-dim);
  font: inherit; font-size: 11px; padding: 1px 5px; border-radius: 2px; cursor: pointer;
}
.mc-ib:hover { color: var(--mc-text); border-color: var(--mc-line-2); }
.mc-study-err { color: var(--mc-bad); padding: 0 8px 6px; white-space: pre-wrap; word-break: break-word; }
.mc-inputs { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 2px 8px 8px; align-items: center; }
.mc-inputs label { color: var(--mc-dim); }
.mc-inputs input, .mc-inputs select {
  background: var(--mc-panel-2); color: var(--mc-text); border: 1px solid var(--mc-line-2);
  font: inherit; padding: 2px 4px; border-radius: 2px; width: 86px;
}
.mc-inputs input[type="checkbox"] { width: auto; }
.mc-inputs input[type="color"] { padding: 0; height: 20px; width: 40px; }

/* console */
.mc-console { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.mc-console-row { display: flex; gap: 6px; align-items: center; }
.mc-console select {
  flex: 1 1 auto; min-width: 0;
  background: var(--mc-panel-2); color: var(--mc-text); border: 1px solid var(--mc-line-2);
  font: inherit; padding: 3px 4px; border-radius: 2px;
}
.mc-code {
  width: 100%; min-height: 220px; resize: vertical;
  background: #05040a; color: #e6e1ff; border: 1px solid var(--mc-line-2); border-radius: 3px;
  font-family: var(--mc-font-data); font-size: 11.5px; line-height: 1.5; padding: 8px;
  tab-size: 2; white-space: pre; overflow: auto;
}
.mc-code:focus { outline: none; border-color: var(--mc-violet); }
.mc-btn {
  background: var(--mc-panel-2); color: var(--mc-text); border: 1px solid var(--mc-line-2);
  font-family: var(--mc-font-hud); font-size: 11px; letter-spacing: 0.12em; font-weight: 600;
  padding: 5px 10px; border-radius: 2px; cursor: pointer;
}
.mc-btn:hover { border-color: var(--mc-violet); }
.mc-btn.primary { background: var(--mc-accent); color: var(--mc-bg); border-color: var(--mc-accent); }
.mc-btn:disabled { opacity: 0.4; cursor: default; }
.mc-console-msg { min-height: 16px; color: var(--mc-dim); white-space: pre-wrap; word-break: break-word; }
.mc-console-msg.bad { color: var(--mc-bad); }
.mc-console-msg.ok { color: var(--mc-good); }
.mc-hint { color: var(--mc-faint); line-height: 1.5; }
.mc-name {
  width: 100%; background: #05040a; color: var(--mc-text); border: 1px solid var(--mc-line-2); border-radius: 3px;
  font-family: var(--mc-font-data); font-size: 11.5px; padding: 6px 8px;
}
.mc-name:focus { outline: none; border-color: var(--mc-violet); }
.mc-keys { margin-top: auto; padding: 10px 12px; font-size: 10px; color: var(--mc-faint); line-height: 1.5; }
.mc-legend-row.off { opacity: 0.45; }
.mc-chart canvas { touch-action: none; }

.mc-root button:focus-visible, .mc-root select:focus-visible, .mc-root input:focus-visible, .mc-root textarea:focus-visible {
  outline: 1px solid var(--mc-accent); outline-offset: 1px;
}

@keyframes mc-ping  { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.2); opacity: 0; } }
@keyframes mc-blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .mc-beacon::after, .mc-feed[data-state="live"]::before { animation: none; }
}

/* HUD tightens with the chart's own width (works inside terminal tiles, not just the window) */
.mc-root { container-type: inline-size; container-name: mc; }
@container mc (max-width: 1240px) {
  .mc-brand { display: none; }
  .mc-hud { gap: 6px 12px; }
}
@container mc (max-width: 1040px) {
  .mc-countdown { display: none; }
  .mc-chg { display: none; }
}

@media (max-width: 900px) {
  .mc-root { height: auto; }
  .mc-body { flex-direction: column; }
  .mc-field { height: 460px; flex: 0 0 auto; }
  .mc-rail { flex: 0 0 auto; border-left: 0; border-top: 1px solid var(--mc-line); }
  .mc-ohlc { display: none; }
  .mc-hud { flex-wrap: wrap; }
}

/* ---------------- Merlin agent ---------------- */
.mc-ask {
  width: 100%; resize: vertical; min-height: 54px; background: var(--mc-bg); color: var(--mc-text);
  border: 1px solid var(--mc-line-2); border-radius: 3px; padding: 6px 8px;
  font-family: var(--mc-font-data); font-size: 12px; line-height: 1.45;
}
.mc-ask:focus { outline: none; border-color: var(--mc-violet); }
.mc-chk { display: inline-flex; align-items: center; gap: 4px; color: var(--mc-dim); font-size: 11px; cursor: pointer; }
.mc-agent .mc-sec-h span { color: var(--mc-violet); }
.mc-agent.busy .mc-console-msg { animation: mc-blink 1.2s infinite; }

/* ---------------- Merlin models ---------------- */
.mc-mlist { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.mc-mrow { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.mc-mrow.na { opacity: 0.45; }
.mc-mname { font-family: var(--mc-font-hud); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; color: var(--mc-dim); flex: 1 1 auto; }
.mc-mrow.on .mc-mname { color: var(--mc-text); }
.mc-mrow.busy .mc-mname { animation: mc-blink 1.2s infinite; }
.mc-switch {
  position: relative; flex: none; width: 30px; height: 16px; border-radius: 8px; cursor: pointer;
  background: var(--mc-bg); border: 1px solid var(--mc-line-2); padding: 0;
}
.mc-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--mc-faint); transition: transform 0.15s, background 0.15s;
}
.mc-switch[aria-checked="true"] { border-color: var(--mc-accent); }
.mc-switch[aria-checked="true"]::after { transform: translateX(14px); background: var(--mc-accent); }
.mc-switch:disabled { cursor: not-allowed; }
.mc-switch:focus-visible, .mc-segb:focus-visible { outline: 1px solid var(--mc-violet); outline-offset: 2px; }
.mc-seg { display: flex; flex: none; }
.mc-segb {
  background: transparent; color: var(--mc-faint); border: 1px solid var(--mc-line-2); cursor: pointer;
  font-family: var(--mc-font-data); font-size: 10px; padding: 1px 6px;
}
.mc-segb + .mc-segb { border-left: 0; }
.mc-segb[aria-pressed="true"] { color: var(--mc-bg); background: var(--mc-gold); border-color: var(--mc-gold); }
.mc-mstat { font-family: var(--mc-font-data); font-size: 10.5px; color: var(--mc-faint); padding: 0 0 4px 38px; line-height: 1.4; }
.mc-mstat:empty { display: none; }
.mc-mstat.bad { color: var(--mc-bad); }

/* ---------------- my indicators ---------------- */
.mc-lib { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.mc-libitem { display: flex; align-items: center; gap: 6px; }
.mc-libname {
  flex: 1 1 auto; min-width: 0; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 2px;
  color: var(--mc-text); font-family: var(--mc-font-data); font-size: 12px; padding: 3px 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-libname:hover { border-color: var(--mc-line-2); }
.mc-libname.on { color: var(--mc-violet); }
.mc-libmeta { flex: none; font-size: 10px; color: var(--mc-faint); font-family: var(--mc-font-data); }

/* ---------------- sheet (code window / news) over the chart ---------------- */
.mc-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: min(62%, 520px); z-index: 6;
  display: flex; flex-direction: column; background: rgba(13, 11, 22, 0.97);
  border-top: 1px solid var(--mc-accent); box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.5);
}
.mc-sheet-h {
  flex: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 12px;
  font-family: var(--mc-font-hud); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; color: var(--mc-accent);
  border-bottom: 1px solid var(--mc-line);
}
.mc-sheet-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.mc-sheet-b[hidden] { display: none; }
.mc-sheet-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 4px;
  font-family: var(--mc-font-hud); font-size: 11px; letter-spacing: 0.14em; color: var(--mc-dim);
}
.mc-sheet-sub small { font-family: var(--mc-font-data); letter-spacing: 0; color: var(--mc-faint); }
.mc-ctl { display: flex; gap: 6px; align-items: center; }
.mc-ctl select { background: var(--mc-bg); color: var(--mc-text); border: 1px solid var(--mc-line-2); font-family: var(--mc-font-data); font-size: 11px; padding: 3px; }
.mc-console-wide { flex: 1 1 auto; }
.mc-sheet-b > .mc-console-msg { padding: 0 12px 6px; }
.mc-console-wide .mc-code { flex: 1 1 auto; min-height: 140px; }
.mc-news { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.mc-newsitem { border: 1px solid var(--mc-line); border-radius: 2px; background: var(--mc-panel); }
.mc-newsitem summary { list-style: none; cursor: pointer; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.mc-newsitem summary::-webkit-details-marker { display: none; }
.mc-newsitem[open] summary { border-bottom: 1px solid var(--mc-line); }
.mc-newsmeta { font-family: var(--mc-font-data); font-size: 10.5px; color: var(--mc-faint); }
.mc-newstitle { color: var(--mc-text); font-size: 12.5px; line-height: 1.35; }
.mc-newsitem p { margin: 0; padding: 8px; color: var(--mc-dim); font-size: 12px; line-height: 1.5; }

/* ---------------- Gap SVM card ---------------- */
.mc-card {
  position: relative; min-width: 360px; max-width: calc(100% - 100px);
  background: rgba(13, 11, 22, 0.94); border: 1px solid var(--mc-line-2); border-top: 2px solid var(--mc-accent);
  font-family: var(--mc-font-data); font-size: 11.5px; color: var(--mc-text); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.mc-card-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 4px 10px;
  font-family: var(--mc-font-hud); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; color: var(--mc-accent); }
.mc-card-row { padding: 3px 10px; color: var(--mc-dim); white-space: nowrap; }
.mc-card-t { border-collapse: collapse; margin: 2px 6px 4px; }
.mc-card-t th { font-weight: 400; color: var(--mc-faint); text-align: right; padding: 2px 6px; font-size: 10.5px; }
.mc-card-t td { text-align: right; padding: 2px 6px; font-variant-numeric: tabular-nums; }
.mc-card-t td:first-child { text-align: left; color: var(--mc-dim); }
.mc-card-t td.use { color: var(--mc-accent); font-weight: 600; }
.mc-card-t td.v { text-align: left; font-size: 10.5px; }
.mc-card-t td.v.good { color: var(--mc-good); }
.mc-card-t td.v.warn { color: var(--mc-gold); }
.mc-card-t td.v.dim { color: var(--mc-faint); }
.mc-card-foot { padding: 3px 10px 7px; color: var(--mc-faint); font-size: 10px; }
@container mc (max-width: 760px) { .mc-card { left: 8px; right: 8px; min-width: 0; max-width: none; } }

/* ---------------- analogues ---------------- */
.mc-arow { flex-wrap: nowrap; gap: 5px; }
.mc-arow .mc-mname { flex: 1 1 auto; }
.mc-nl { font-family: var(--mc-font-data); font-size: 9.5px; color: var(--mc-faint); }
.mc-num {
  width: 46px; background: var(--mc-bg); color: var(--mc-text); border: 1px solid var(--mc-line-2); border-radius: 2px;
  font-family: var(--mc-font-data); font-size: 11px; padding: 2px 4px;
}
.mc-num:focus { outline: none; border-color: var(--mc-violet); }
.mc-afind { padding: 3px 8px; font-size: 10px; }
.mc-arow.busy .mc-afind { animation: mc-blink 1.2s infinite; }
.mc-acard { position: absolute; left: 12px; bottom: 34px; z-index: 5; min-width: 330px; border-top-color: var(--mc-violet); }
.mc-acard .mc-card-h { color: var(--mc-violet); }
.mc-acard td.mc-up { color: var(--mc-up); } .mc-acard td.mc-down { color: var(--mc-down); }

/* trendlines: TREND button state + the floating bar for the selected line */
.mc-tool.mc-trend[aria-pressed="true"] { color: var(--mc-bg); background: var(--mc-accent); border-color: var(--mc-accent); }
.mc-dbar {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  background: color-mix(in srgb, var(--mc-panel) 94%, transparent); border: 1px solid var(--mc-line-2);
  border-top: 2px solid var(--mc-accent); border-radius: 2px; box-shadow: 0 6px 18px rgba(0,0,0,.45);
  max-width: calc(100% - 24px); flex-wrap: wrap;
}
.mc-dhint { font-family: var(--mc-font-hud); font-size: 10px; letter-spacing: 0.12em; color: var(--mc-accent); white-space: nowrap; }
.mc-dsw { width: 16px; height: 16px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; }
.mc-dsw[aria-pressed="true"] { border-color: var(--mc-text); box-shadow: 0 0 0 1px var(--mc-bg) inset; }
.mc-dsw:focus-visible, .mc-dbar .mc-tool:focus-visible { outline: 1px solid var(--mc-accent); outline-offset: 2px; }
.mc-ddel:hover { border-color: var(--mc-down); color: var(--mc-down); }

/* model timeframe picker (RPPI / PROSPECTIVE R) */
.mc-mopts { display: flex; align-items: center; gap: 8px; padding: 0 0 4px 38px; }
.mc-mopt-l { font-family: var(--mc-font-hud); font-size: 9.5px; letter-spacing: 0.14em; color: var(--mc-faint); }
.mc-mtf .mc-segb { min-width: 24px; }
.mc-segb:disabled { opacity: 0.35; cursor: not-allowed; }
.mc-mrow.na + .mc-mopts { opacity: 0.45; }

/* RTH / ETH in the top bar */
.mc-sess { flex: none; }
.mc-sess .mc-segb[aria-pressed="true"] { background: var(--mc-accent); border-color: var(--mc-accent); }
