/*
 * The Ideas page and the screener's "Today's ideas" line. Colours and sizes come from tokens.css only.
 * The bars use the up/down pair (blue = above the sector, orange = below; the pair passes the dataviz
 * palette validator in both themes, see tokens.css) and grey for "no pattern found". Numbers and labels stay
 * in text colours; the bar beside them carries the direction, the sign carries it again. Text wraps: nothing
 * here is clipped, nothing is sticky.
 */
.jts .jts-ideas-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0 8px; border-top: 1px solid var(--line-soft); }
.jts .jts-ideas-bar .jts-ideas-csv { margin-left: auto; }
.jts .jts-ideas-bar .jts-sfield select { max-width: 100%; }
.jts .jts-ideas-how { font-size: var(--fs-sm); color: var(--text-2); margin: 0 0 4px; max-width: 120ch; }
.jts .jts-ideas-how b { color: var(--text); font-weight: 650; }

.jts .jts-ideas { margin-top: var(--s4); }
.jts .jts-ideas-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.jts .jts-ideas-h h2 { font-size: var(--fs-lg); font-weight: 700; }
.jts .jts-ideas-h .jts-ideas-count { font-size: var(--fs-sm); color: var(--text-3); }
.jts .jts-ideas-record { font-size: var(--fs-sm); color: var(--text-2); margin: 0 0 6px; max-width: 130ch; }
.jts .jts-ideas-record b { color: var(--text); font-weight: 650; }

.jts .jts-ideas-wrap { border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.jts .jts-ideas-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); table-layout: fixed; }
.jts .jts-ideas-table th { text-align: left; font-weight: 650; color: var(--text-2); font-size: var(--fs-xs); padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--raised); vertical-align: bottom; }
.jts .jts-ideas-table th:first-child { border-top-left-radius: 7px; }
.jts .jts-ideas-table th:last-child { border-top-right-radius: 7px; }
.jts .jts-ideas-table td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; overflow-wrap: anywhere; }
.jts .jts-ideas-table tbody tr:last-child td { border-bottom: 0; }
.jts .jts-ideas-table tbody tr:hover td { background: var(--row-hover); }
.jts .jts-ideas-table .c-rank { width: 46px; color: var(--text-3); font-variant-numeric: tabular-nums; overflow-wrap: normal; }
.jts .jts-ideas-table .c-co { width: 21%; }
.jts .jts-ideas-table .c-past { width: 27%; }
.jts .jts-ideas-table .c-ev { width: 92px; }

.jts .jts-idea-tk { font-weight: 700; color: var(--text); text-decoration: none; margin-right: 6px; }
.jts .jts-idea-tk:hover { text-decoration: underline; }
.jts .jts-idea-name { color: var(--text); }
.jts .jts-idea-meta { display: block; color: var(--text-3); font-size: var(--fs-xs); margin-top: 1px; }
.jts .jts-idea-meta b { font-weight: 600; color: var(--text-2); }
.jts .jts-idea-rule { font-weight: 650; color: var(--text); }
.jts .jts-idea-text { color: var(--text); }
.jts .jts-idea-sub { display: block; color: var(--text-3); font-size: var(--fs-xs); margin-top: 1px; }
.jts .jts-idea-new { display: inline-block; padding: 0 5px; border-radius: 3px; background: var(--text); color: var(--card); font-size: 10.5px; font-weight: 700; line-height: 16px; margin-right: 5px; vertical-align: 1px; }
.jts .jts-idea-flag { color: var(--text-2); }

.jts .jts-idea-past { display: grid; grid-template-columns: 70px minmax(40px, 1fr); align-items: center; gap: 1px 8px; }
.jts .jts-idea-num { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.jts .jts-idea-past.is-none .jts-idea-num, .jts .jts-idea-past.is-unmeasured .jts-idea-num { font-weight: 500; color: var(--text-2); }
.jts .jts-idea-n { grid-column: 1 / -1; color: var(--text-3); font-size: var(--fs-xs); }
.jts .jts-idea-svg { width: 100%; height: 10px; display: block; overflow: visible; }
.jts .jts-idea-svg rect.is-up { fill: var(--up); }
.jts .jts-idea-svg rect.is-down { fill: var(--down); }
.jts .jts-idea-past.is-none .jts-idea-svg rect, .jts .jts-idea-svg.is-none rect { fill: var(--neutral); }
.jts .jts-idea-svg line { stroke: var(--text-3); stroke-width: 1; vector-effect: non-scaling-stroke; }
.jts .jts-idea-ev a { display: block; }

.jts .jts-ideas-more { margin-top: 6px; }
.jts .jts-ideas-more > summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); padding: 4px 0; }
.jts .jts-ideas-more[open] > summary { margin-bottom: 4px; }
.jts .jts-ideas-none { font-size: var(--fs-sm); color: var(--text-2); padding: 8px 0; }

.jts .jts-ideas-rules .c-name { width: 24%; }
.jts .jts-ideas-rules .c-num { width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.jts .jts-ideas-rules .c-bar { width: 16%; }
.jts .jts-ideas-rules td.c-num { color: var(--text); }
.jts .jts-ideas-rules .jts-idea-res { font-weight: 650; }
.jts .jts-ideas-rules tr.is-none td, .jts .jts-ideas-rules tr.is-unmeasured td { color: var(--text-2); }

/* the screener's one line */
.jts .jts-ideastrip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 8px; font-size: var(--fs-sm); }
.jts .jts-ideastrip-h { font-weight: 700; color: var(--text); text-decoration: none; margin-right: 2px; }
.jts .jts-ideastrip-h:hover { text-decoration: underline; }
.jts .jts-ideastrip-i { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text-2); text-decoration: none; }
.jts .jts-ideastrip-i:hover { border-color: var(--text-3); text-decoration: none; }
.jts .jts-ideastrip-i b { color: var(--text); }
.jts .jts-ideastrip-i i { font-style: normal; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.jts .jts-ideastrip-i::before { content: ""; width: 7px; height: 7px; border-radius: 2px; align-self: center; background: var(--down); }
.jts .jts-ideastrip-i.is-look::before { background: var(--up); }

@media (max-width: 860px) {
  .jts .jts-ideas-table { table-layout: auto; }
  .jts .jts-ideas-table thead { display: none; }
  .jts .jts-ideas-table, .jts .jts-ideas-table tbody, .jts .jts-ideas-table tr, .jts .jts-ideas-table td { display: block; width: auto; }
  .jts .jts-ideas-table tr { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); }
  .jts .jts-ideas-table tbody tr:last-child { border-bottom: 0; }
  .jts .jts-ideas-table td { border: 0; padding: 2px 0; }
  .jts .jts-ideas-table td.c-co, .jts .jts-ideas-table td.c-past, .jts .jts-ideas-table td.c-ev, .jts .jts-ideas-rules td { width: auto; }
  .jts .jts-ideas-table td.c-rank { display: inline; width: auto; padding-right: 6px; }
  .jts .jts-ideas-table td.c-co { display: inline; width: auto; }
  .jts .jts-ideas-table td[data-l]::before { content: attr(data-l) ": "; color: var(--text-3); font-size: var(--fs-xs); }
  .jts .jts-idea-past { max-width: 360px; }
  .jts .jts-idea-ev a { display: inline; margin-right: 12px; }
  .jts .jts-ideas-rules td.c-num { text-align: left; }
  .jts .jts-ideas-bar .jts-ideas-csv { margin-left: 0; }
}
