/* Time-series page — builds on styles.css + history.css */
.ts-tabs { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; }
.ts-tabs a { padding: 5px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.ts-tabs a:hover { color: var(--text); }
.ts-tabs a.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.ts-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.ts-foot { max-width: 900px; line-height: 1.5; margin: 0; }

/* stat tiles */
.ts-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ts-tile { background: var(--panel); padding: 10px 12px; min-width: 0; }
.ts-tile .k { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.ts-tile .v { font-family: var(--mono); font-size: 17px; margin-top: 2px; white-space: nowrap; }
.ts-tile .s { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* segmented toggle inside cards */
.ts-seg { display: inline-flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.ts-seg button { background: none; border: 0; color: var(--muted); font-size: 12px; padding: 3px 9px; border-radius: 4px; cursor: pointer; }
.ts-seg button.active { background: var(--panel-2); color: var(--text); }

/* chart extras */
.ts-chart { position: relative; }
.ts-chart + .ts-chart { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.s-trend { stroke: var(--accent); stroke-dasharray: 5 4; stroke-width: 1.2; }
.s-chan { fill: rgba(233, 162, 59, .07); stroke: none; }
.s-cone95 { fill: rgba(90, 169, 255, .10); stroke: none; }
.s-cone68 { fill: rgba(90, 169, 255, .20); stroke: none; }
.s-garch { stroke: var(--accent); }
.s-ewma { stroke: var(--sma200); }
.s-vol20 { stroke: var(--sma50); stroke-width: 1.2; }
.s-fc { stroke: var(--accent); stroke-dasharray: 3 3; }
.s-normal { stroke: var(--accent); fill: none; stroke-width: 1.6; }
.s-dd { fill: rgba(239, 90, 90, .22); stroke: var(--down); stroke-width: 1; }
.s-fcdiv { stroke: var(--line-2); stroke-dasharray: 2 3; }
.ts-fc-lab { fill: var(--muted); font-family: var(--mono); font-size: 10px; }
.sw.s-trend { background: var(--accent); } .sw.s-chan { background: rgba(233,162,59,.35); height: 8px; }
.sw.s-cone68 { background: rgba(90,169,255,.5); height: 8px; } .sw.s-garch { background: var(--accent); }
.sw.s-ewma { background: var(--sma200); } .sw.s-vol20 { background: var(--sma50); } .sw.s-normal { background: var(--accent); }
.sw.s-dd { background: var(--down); }
.h-bar { fill: var(--sma50); fill-opacity: .75; }
.h-bar.hot { fill: var(--down); fill-opacity: .8; }
.stem { stroke-width: 3; stroke-linecap: butt; }
.stem.in { stroke: var(--muted); stroke-opacity: .6; }
.stem.out { stroke: var(--accent); }
.h-band { fill: rgba(138, 145, 156, .10); }

/* tests table */
.ts-tests td.v-yes { color: var(--accent); }
.ts-tests td.v-no { color: var(--muted); }
.ts-tests td.t-name { font-family: var(--sans); color: var(--text); white-space: normal; min-width: 150px; }
.ts-tests td.t-name span { display: block; font-size: 11px; color: var(--muted); }
.ts-tests td.t-verdict { font-family: var(--sans); text-align: left; white-space: normal; min-width: 120px; }
.ts-tests td:nth-child(3) { white-space: normal; }

/* seasonality */
.ts-heat { display: grid; gap: 2px; font-family: var(--mono); font-size: 10.5px; margin-top: 10px; }
.ts-heat .c { padding: 5px 0; text-align: center; border-radius: 3px; color: var(--text); }
.ts-heat .h { color: var(--muted); text-align: center; padding: 2px 0; }
.ts-heat .y { color: var(--muted); text-align: right; padding: 5px 6px 5px 0; }
.ts-heat .c.na { background: transparent; color: var(--line-2); }
.ts-heat .ya { margin-left: 6px; font-weight: 600; }
.ts-sub { font-size: 12px; font-weight: 600; margin: 14px 0 2px; }
.ts-sub:first-of-type { margin-top: 0; }

.ts-empty { padding: 30px 4px; }

@media (max-width: 1100px) {
  .ts-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .ts-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ts-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ts-tabs { order: 2; }
}