/* TA history page — builds on styles.css tokens */
.h-page { height: auto; }
.h-page .brand { color: var(--text); text-decoration: none; }
.h-search { display: flex; gap: 8px; flex: 1; max-width: 420px; }
.h-search input {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 7px 12px; font-family: var(--mono); text-transform: uppercase;
}
.h-search input:focus { outline: none; border-color: var(--accent); }
.h-ranges { padding: 0; margin-left: auto; }

.h-main { max-width: 1320px; margin: 0 auto; padding: 18px 20px 48px; display: flex; flex-direction: column; gap: 16px; }
.h-hero { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 4px 2px; }
.h-symbol { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: .02em; }
.h-price { font-family: var(--mono); }
.h-close { font-size: 22px; }
.h-meta { margin-left: auto; text-align: right; }

.h-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; }
.h-top { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.h-card { padding: 16px 18px; min-width: 0; }
.h-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.h-card-head h2 { margin: 0; }
.h-note { margin: 12px 0 0; line-height: 1.5; }

/* inference */
.h-verdict { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius);
  background: var(--panel-2); border-left: 3px solid var(--muted); margin-bottom: 12px; }
.h-verdict.up { border-left-color: var(--up); }
.h-verdict.down { border-left-color: var(--down); }
.h-verdict.flat { border-left-color: var(--accent); }
.h-verdict-label { font-size: 18px; font-weight: 600; }
.h-verdict.up .h-verdict-label { color: var(--up); }
.h-verdict.down .h-verdict-label { color: var(--down); }
.h-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.h-facts li { display: flex; gap: 10px; align-items: flex-start; }
.h-facts b { font-weight: 600; font-size: 13px; }
.h-facts p { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.h-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.up > .h-dot { background: var(--up); }
.down > .h-dot { background: var(--down); }
.flat > .h-dot { background: var(--accent); }

/* tables */
.h-scroll { overflow-x: auto; }
.h-tbl thead th { cursor: default; padding: 8px 10px; background: transparent; position: static; }
.h-tbl thead th:hover { color: var(--muted); }
.h-tbl tbody tr { cursor: default; }
.h-tbl tbody tr:hover td { background: var(--panel-2); }
.h-tbl tbody td { padding: 7px 10px; font-size: 12.5px; }
.h-tbl td.h-ind { font-family: var(--sans); color: var(--text); }
.h-tbl tr.h-base td { color: var(--muted); border-bottom-color: var(--line-2); }
.h-pct { display: inline-block; width: 38px; height: 4px; background: var(--line); border-radius: 2px; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.h-pct i { display: block; height: 100%; background: var(--accent); }
.h-spark-cell { width: 120px; }
.h-spark { width: 110px; height: 26px; display: block; margin-left: auto; }
.h-spark path { fill: none; stroke: var(--sma50); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.h-spark-zero { stroke: var(--line-2); stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }

/* charts */
.h-panel { padding: 10px 0 6px; border-top: 1px solid var(--line); }
.h-panel:first-child { border-top: 0; padding-top: 0; }
.h-panel-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.h-panel-title { font-weight: 600; font-size: 13px; }
.h-legend { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 11.5px; }
.h-legend b { font-weight: 500; }
.h-panel-note { color: var(--muted); margin: 3px 0 6px; line-height: 1.45; }
.h-svg { width: 100%; overflow: hidden; }
.h-svg svg { display: block; }
.sw { display: inline-block; width: 12px; height: 3px; margin-right: 5px; vertical-align: middle; border-radius: 1px; }

.h-gl { stroke: var(--line); stroke-width: 1; }
.h-ref { stroke: var(--line-2); stroke-dasharray: 3 3; }
.h-zero { stroke: var(--muted); stroke-opacity: .5; }
.h-ylab, .h-xlab { fill: var(--muted); font-family: var(--mono); font-size: 10px; }
.h-ylab { text-anchor: end; }
.h-line { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
.s-close { stroke: var(--text); }
.s-sma15 { stroke: var(--sma50); }
.s-sma45 { stroke: var(--sma200); }
.s-accent { stroke: var(--accent); }
.s-muted { stroke: var(--muted); stroke-dasharray: 4 3; }
.s-band { fill: rgba(233, 162, 59, .13); stroke: none; }
.sw.s-close { background: var(--text); } .sw.s-sma15 { background: var(--sma50); } .sw.s-sma45 { background: var(--sma200); }
.sw.s-accent { background: var(--accent); } .sw.s-muted { background: var(--muted); } .sw.s-band { background: rgba(233,162,59,.45); height: 8px; }
.sw.b-flat { background: var(--muted); }
.s-mk-up { fill: var(--up); } .s-mk-down { fill: var(--down); }
.b-up { fill: var(--up); fill-opacity: .8; }
.b-down { fill: var(--down); fill-opacity: .8; }
.b-flat { fill: var(--muted); fill-opacity: .55; }
.h-cross { stroke: var(--text); stroke-opacity: .35; stroke-width: 1; pointer-events: none; }
.h-hit { fill: transparent; cursor: crosshair; }
.h-strip-bg { fill: var(--panel-2); }
.h-strip-on { fill: var(--accent); }
.h-strip-on.s-lead_short_confirm { fill: var(--up); }
.h-strip-on.s-lead_confirm { fill: var(--sma50); }

/* events */
.h-events { max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; }
.h-ev { display: grid; grid-template-columns: 8px 78px 1fr auto; gap: 10px; align-items: baseline;
  padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.h-ev .h-dot { margin-top: 0; align-self: center; }
.h-ev-date { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.h-ev-f { font-family: var(--mono); font-size: 12px; white-space: nowrap; }

.h-tbl-wrap { max-height: 520px; }

@media (max-width: 1000px) {
  .h-grid, .h-top { grid-template-columns: 1fr; }
  .h-meta { margin-left: 0; text-align: left; }
}
@media (max-width: 640px) {
  .h-main { padding: 14px 16px 40px; }
  .h-search { order: 3; max-width: none; flex-basis: 100%; }
  .h-ev { grid-template-columns: 8px 64px 1fr; }
  .h-ev-f { grid-column: 3; }
}