/* Quant Research Map — scoped to .hh-tool-quant, inherits the SPA's theme tokens.
   No palette of its own: every colour below resolves through --surface/--text/--blue
   so light and dark mode follow the shell automatically. */

/* the SPA's own segmented control (.pill-tabs2): a --surface-2 track with the
   active item lifted onto --surface, rather than a filled accent pill */
.hh-tool-quant .qr-nav{display:inline-flex;gap:2px;background:var(--surface-2);
  padding:3px;border-radius:8px;margin:0 0 12px;flex-wrap:wrap}
.hh-tool-quant .qr-nav button{font:inherit;font-size:12.5px;font-weight:500;padding:5px 13px;
  border:0;background:none;color:var(--text-dim);border-radius:6px;cursor:pointer;
  transition:all .15s}
.hh-tool-quant .qr-nav button:hover{color:var(--text)}
.hh-tool-quant .qr-nav button.on{background:var(--surface);color:var(--text);
  box-shadow:var(--shadow-sm);font-weight:600}
.hh-tool-quant .qr-nav button:focus-visible,
.hh-tool-quant .qr-ctl select:focus-visible,
.hh-tool-quant .qr-ctl input:focus-visible{outline:2px solid var(--blue);outline-offset:2px}

.hh-tool-quant .qr-panel{background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius,14px);padding:14px;margin:0 0 12px}
.hh-tool-quant .qr-head{display:flex;flex-wrap:wrap;align-items:baseline;
  justify-content:space-between;gap:8px;margin:0 0 4px}
.hh-tool-quant .qr-title{font-size:14px;font-weight:700;margin:0}
.hh-tool-quant .qr-sub{font-size:11.5px;color:var(--text-faint);line-height:1.5;margin:0 0 10px}
.hh-tool-quant .qr-ctl{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.hh-tool-quant .qr-ctl label{display:flex;flex-direction:column;gap:3px;font-size:11px;
  font-weight:600;color:var(--text-faint)}
.hh-tool-quant .qr-ctl select,.hh-tool-quant .qr-ctl input{font:inherit;font-size:12.5px;
  padding:6px 8px;border:1px solid var(--border);border-radius:8px;
  background:var(--surface);color:var(--text)}

/* heatmap — colour is a redundant cue; the number is always printed */
.hh-tool-quant .qr-hm-wrap{overflow-x:auto}
.hh-tool-quant .qr-hm{border-collapse:collapse;font-size:12px;width:100%;min-width:560px}
.hh-tool-quant .qr-hm th,.hh-tool-quant .qr-hm td{padding:5px 8px;text-align:center;
  border-bottom:1px solid var(--border-soft)}
.hh-tool-quant .qr-hm th:first-child,.hh-tool-quant .qr-hm td:first-child{
  text-align:left;white-space:nowrap;position:sticky;left:0;background:var(--surface)}
.hh-tool-quant .qr-hm thead th{font-size:10.5px;text-transform:uppercase;
  letter-spacing:.03em;color:var(--text-faint);font-weight:700}
.hh-tool-quant .qr-cell{display:block;border-radius:5px;padding:4px 0;font-weight:700;
  font-variant-numeric:tabular-nums;color:var(--text)}
.hh-tool-quant .qr-cell-na{background:repeating-linear-gradient(45deg,
  var(--surface-2) 0 4px,transparent 4px 8px);color:var(--text-faint);font-weight:400}
.hh-tool-quant .qr-sym{color:var(--blue);text-decoration:none;font-weight:700}
.hh-tool-quant .qr-legend{display:flex;align-items:center;gap:8px;font-size:11px;
  color:var(--text-faint);margin-top:10px;flex-wrap:wrap}
.hh-tool-quant .qr-legend i{display:inline-block;width:70px;height:8px;border-radius:4px;
  background:linear-gradient(90deg,var(--surface-2),var(--blue))}
.hh-tool-quant .qr-legend .qr-na-key{display:inline-block;width:14px;height:8px;
  border-radius:3px;background:repeating-linear-gradient(45deg,var(--surface-2) 0 3px,transparent 3px 6px)}

/* charts */
.hh-tool-quant .qr-svg{width:100%;height:auto;display:block;overflow:visible}
.hh-tool-quant .qr-axis{stroke:var(--border);stroke-width:1}
.hh-tool-quant .qr-grid{stroke:var(--border-soft);stroke-width:1}
.hh-tool-quant .qr-axis-text{fill:var(--text-faint);font-size:10px}
.hh-tool-quant .qr-axis-title{fill:var(--text-dim);font-size:11px;font-weight:600}
.hh-tool-quant .qr-pt{fill:var(--blue);fill-opacity:.55;stroke:var(--blue);stroke-width:.5;cursor:pointer}
.hh-tool-quant .qr-pt:hover,.hh-tool-quant .qr-pt:focus{fill-opacity:.95;stroke-width:1.5}
.hh-tool-quant .qr-bar{fill:var(--blue)}
.hh-tool-quant .qr-bar-label{fill:var(--text);font-size:10.5px;font-variant-numeric:tabular-nums}

/* sector bars */
.hh-tool-quant .qr-sec{display:flex;flex-direction:column;gap:6px}
.hh-tool-quant .qr-sec-row{display:grid;grid-template-columns:minmax(120px,1.4fr) 1fr auto;
  align-items:center;gap:10px;font-size:12px}
.hh-tool-quant .qr-sec-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hh-tool-quant .qr-sec-track{height:9px;border-radius:5px;background:var(--surface-2);overflow:hidden}
.hh-tool-quant .qr-sec-track i{display:block;height:100%;background:var(--blue);border-radius:5px}
.hh-tool-quant .qr-sec-val{font-variant-numeric:tabular-nums;font-weight:700;min-width:64px;
  text-align:right;font-size:12px}
.hh-tool-quant .qr-sec-na .qr-sec-val{color:var(--text-faint);font-weight:400}
.hh-tool-quant .qr-sec-n{color:var(--text-faint);font-weight:400;font-size:10.5px}

/* accessible data-table alternative to every chart */
.hh-tool-quant .qr-alt{margin-top:10px}
.hh-tool-quant .qr-alt summary{cursor:pointer;font-size:11.5px;font-weight:600;
  color:var(--blue);list-style:none}
.hh-tool-quant .qr-alt summary::-webkit-details-marker{display:none}
.hh-tool-quant .qr-alt summary::before{content:"+ "}
.hh-tool-quant .qr-alt[open] summary::before{content:"\2212 "}
.hh-tool-quant .qr-alt table{width:100%;border-collapse:collapse;font-size:11.5px;margin-top:8px}
.hh-tool-quant .qr-alt th,.hh-tool-quant .qr-alt td{padding:4px 6px;text-align:right;
  border-bottom:1px solid var(--border-soft)}
.hh-tool-quant .qr-alt th:first-child,.hh-tool-quant .qr-alt td:first-child{text-align:left}
.hh-tool-quant .qr-tip{font-size:11.5px;color:var(--text-dim);min-height:17px;margin-top:6px}

@media (max-width:760px){
  .hh-tool-quant .qr-nav button{flex:1;text-align:center}
  .hh-tool-quant .qr-ctl label{flex:1;min-width:104px}
  .hh-tool-quant .qr-sec-row{grid-template-columns:minmax(88px,1fr) 1fr auto;font-size:11.5px}
  .hh-tool-quant .qr-sec-val{min-width:52px}
}

/* ── chart tooltip (Phase 11.2) ───────────────────────────────────────────── */
/* Fixed-position and appended to <body>, so showing it never reflows the page. */
.qr-tip{position:fixed;z-index:80;pointer-events:none;min-width:132px;max-width:230px;
  padding:9px 11px;border:1px solid var(--border);border-radius:10px;
  background:var(--surface);box-shadow:var(--shadow);font-size:11.5px;line-height:1.45;
  color:var(--text-dim)}
.qr-tip-t{font-family:var(--mono);font-size:13px;font-weight:600;color:var(--text)}
.qr-tip-s{font-size:11px;color:var(--text-faint);margin:1px 0 6px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.qr-tip-r{display:flex;justify-content:space-between;gap:14px;padding:1.5px 0}
.qr-tip-r b{font-family:var(--mono);font-variant-numeric:tabular-nums;
  font-weight:600;color:var(--text)}
/* the hovered mark becomes prominent without changing its geometry */
.hh-tool-quant .qr-pt{transition:opacity .12s}
.hh-tool-quant .qr-pt.on{stroke:var(--gold);stroke-width:2;paint-order:stroke}
.hh-tool-quant .qr-bar.on{fill:var(--gold-ink)}
.hh-tool-quant .qr-pt:focus-visible,.hh-tool-quant .qr-bar:focus-visible{
  outline:2px solid var(--gold);outline-offset:2px}

/* median reference on the histogram — a dashed hairline in the app's own faint ink */
.hh-tool-quant .qr-med{stroke:var(--text-faint);stroke-width:1;stroke-dasharray:3 3}
.hh-tool-quant .qr-med-t{fill:var(--text-faint);font-size:9.5px;
  font-family:var(--mono);font-variant-numeric:tabular-nums}
