/* Research tab (public/js/research.js, stock.js, symbolSearch.js, newsFeed.js).
   Uses the design tokens from app.css, so both themes work. */

/* ---------- search bar and view switch ---------- */
.rs-bar { gap: 12px; position: relative; z-index: 6; }
.rs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.rs-row .seg { flex-wrap: wrap; }
#rs-status:empty { display: none; }
.fa-browse-label { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.fa-controls[hidden] { display: none; }
#fa-modes { align-self: flex-start; }

.ss { position: relative; }
.ss-form { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-2); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.ss-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ss-icon svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; display: block; }
.ss-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: 500 15px var(--sans); padding: 8px 0; }
.ss-input::placeholder { color: var(--muted); font-weight: 400; }
.ss-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: ss-spin .8s linear infinite; flex: none; }
.ss-spin[hidden] { display: none; }
@keyframes ss-spin { to { transform: rotate(360deg); } }
.ss-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: min(460px, 60vh); overflow-y: auto; margin: 0; padding: 6px; list-style: none; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel); box-shadow: 0 18px 48px rgba(0, 0, 0, .35); }
.ss-list[hidden] { display: none; }
.ss-group { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ss-note { padding: 10px; }
.ss-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.ss-item.on { background: var(--accent-soft); }
.ss-main { min-width: 0; }
.ss-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-sub { margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-sym { font: 600 12px var(--mono); color: var(--fg-2); }
.ss-item mark { background: transparent; color: var(--accent); font-weight: 700; }
.ss-type { flex: none; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--fg-2); }

/* ---------- quote header (Yahoo-style) ---------- */
.rs-quote { gap: 8px; }
.rq-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; }
.rq-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rq-name { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.rq-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.rq-sym { font: 600 12.5px var(--mono); color: var(--fg); padding: 1px 7px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); }
.rq-state { display: inline-flex; align-items: center; gap: 6px; }
.rq-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.rq-state.open::before { background: var(--up); box-shadow: 0 0 0 3px var(--up-bg); }
.rq-price { text-align: right; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 4px 12px; }
.rq-price > div { flex-basis: 100%; }
.rq-px { font: 600 32px var(--mono); letter-spacing: -.03em; }
.rq-ch { font: 500 15px var(--mono); }
.rq-ext { display: inline; }

.rq-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.rq-grid-b { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); }
.rq-chart .card-head { flex-wrap: wrap; gap: 8px; }
.rq-chart-title { display: flex; align-items: baseline; gap: 10px; }
.rq-chart .ranges button.on { background: var(--accent-soft); color: var(--fg); }
.rq-plot { min-height: 290px; position: relative; }
.rq-stats { gap: 10px; }
.rq-kv { display: grid; grid-template-columns: 1fr auto; margin: 0; font-size: 13px; }
.rq-kv dt, .rq-kv dd { padding: 7px 0; border-bottom: 1px solid var(--line); margin: 0; }
.rq-kv dt { color: var(--muted); }
.rq-kv dd { text-align: right; font-weight: 500; }
.rq-kv dt:nth-last-of-type(1), .rq-kv dd:last-child { border-bottom: 0; }

.sr-hero-2 { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }
.rq-about { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.rq-desc { margin: 0; color: var(--fg-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.rq-desc.open { -webkit-line-clamp: unset; }
.rs-loading { min-height: 120px; justify-content: center; }
.rs-macro { gap: 14px; }
.rs-macro .card { box-shadow: none; }
.mc-fold { margin: 0; }

/* ---------- live news feed ---------- */
.rq-news { gap: 10px; max-height: 760px; }
.nf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.nf-title { display: flex; align-items: center; gap: 8px; }
.nf-live { width: 8px; height: 8px; border-radius: 50%; background: var(--down); box-shadow: 0 0 0 0 color-mix(in srgb, var(--down) 60%, transparent); animation: nf-pulse 2s infinite; }
@keyframes nf-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--down) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.nf-status { margin-right: auto; }
.seg-xs button { padding: 3px 9px; font-size: 11.5px; }
.nf-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.nf-filters:empty { display: none; }
.chip-xs { padding: 2px 9px; font-size: 11.5px; }
.nf-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.nf-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.nf-item:last-child { border-bottom: 0; }
.nf-item.key { border-left: 3px solid var(--accent); padding-left: 10px; }
.nf-item.fresh { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.nf-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.nf-meta:empty { display: none; }
.nf-key, .nf-tag, .nf-new { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--fg-2); }
.nf-key { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--fg); }
.nf-new { background: var(--up-bg); color: var(--up); border-color: transparent; }
.nf-tag.t-earnings { color: var(--accent); }
.nf-tag.t-analyst { color: var(--warn); }
.nf-tag.t-legal { color: var(--down); }
.nf-tag.t-deal, .nf-tag.t-capital { color: var(--up); }
a.nf-headline, .card a.nf-headline { font-size: 13.5px; font-weight: 500; line-height: 1.4; color: var(--fg); text-decoration: none; }
.nf-headline:hover { color: var(--accent); text-decoration: underline; }
.nf-sum { margin: 0; font-size: 12px; color: var(--fg-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nf-empty { padding: 12px 0; }
.nf-foot:empty { display: none; }
.rs-tech { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 1080px) {
  .rq-grid, .rq-grid-b { grid-template-columns: 1fr; }
  .rq-news { max-height: 560px; }
}
@media (max-width: 640px) {
  .rq-top { align-items: flex-start; }
  .rq-price { text-align: left; justify-content: flex-start; }
  .rq-px { font-size: 26px; }
  .sr-hero-2 { grid-template-columns: 1fr; }
  .ss-form .btn { padding: 7px 10px; }
  .ss-input { font-size: 14px; }
}
