.ws-filter-chips { display: flex; flex-wrap: wrap; gap: .9rem 1.2rem; }
.ws-filter-group { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.ws-filter-group-label { text-transform: uppercase; font-size: .68rem; letter-spacing: .04em; margin-right: .15rem; }
.ws-filter-chip { border: 1px solid var(--border-soft); }
.ws-filter-chip.active { background: rgba(var(--primary-rgb), .28); color: var(--accent-text-strong); border-color: var(--border-active); }
.ws-list-scroll { max-height: 560px; overflow: auto; }
.ws-row-selected { background: rgba(var(--primary-rgb), .12) !important; }
#opportunity-rows tr:hover { background: rgba(148, 163, 184, .06); }

/* Compact table styling */
.ws-compact-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.ws-compact-table th { padding: 0.6rem 0.75rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.ws-compact-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }

/* Sticky column for ticker */
.ws-compact-table .sticky-col {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.2);
}
.ws-compact-table tr:hover .sticky-col {
  background: var(--surface-2);
}
.ws-compact-table tr.ws-row-selected .sticky-col {
  background: rgba(var(--primary-rgb), 0.18);
}

/* On mobile the primary opportunity list becomes readable cards. All decision
   conditions remain available without horizontal scrolling. Analysis is a deeper table. */
@media (max-width: 768px) {
  .ws-compact-table { table-layout: fixed; min-width: 0; }
  #analysis-table { table-layout: auto; min-width: 720px; }
  #opportunity-table, #opportunity-rows { display:block; width:100%; }
  #opportunity-table thead { display:none; }
  #opportunity-rows tr { display:flex; flex-direction:column; padding:.85rem; border-bottom:1px solid var(--border-medium); }
  #opportunity-rows td { display:block; width:100%; padding:.25rem 0; border:0; position:static; box-shadow:none; background:transparent; }
  #opportunity-rows td:nth-child(3), #opportunity-rows td:nth-child(4), #opportunity-rows td:nth-child(5) { display:none; }
  #opportunity-rows td:nth-child(8) { order:-1; }
  #opportunity-rows td:first-child { order:-3; }
  #opportunity-rows td:nth-child(2) { order:-2; }
  #opportunity-rows td[data-label]::before { content:attr(data-label) ": "; color:var(--text-muted); }
}
.ws-ticker-link {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text) !important;
  text-decoration: none !important;
}
.ws-ticker-link:hover {
  color: var(--accent-text) !important;
}

/* ---------- Ticker Detail Drawer ---------- */
.decision-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 10, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.decision-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.decision-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(740px, 94vw);
  background: var(--surface);
  border-left: 1px solid var(--border-medium);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.55);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}
.decision-drawer.is-open {
  transform: translateX(0);
}

.decision-drawer-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-head);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}
.decision-drawer-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.decision-drawer-ticker {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
  font-family: var(--font-mono, monospace);
}
.decision-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}
.decision-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.decision-drawer-close:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-medium);
}

/* ---------- Defensive one-liner ---------- */
.ws-defensive-line { margin: -0.35rem 0 1rem; }

/* ---------- Compact market context strip ---------- */
.ws-market-strip {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.3);
}
.ws-market-strip-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.ws-market-strip .cockpit-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; }
.ws-market-strip .cockpit-kpi { padding: 0.5rem 0.7rem; }
.ws-market-strip .cockpit-kpi .value { font-size: 0.88rem; }
.ws-system-status { margin-top: .6rem; color: var(--text-muted); font-size: .78rem; }
.ws-system-status summary { cursor: pointer; width: fit-content; }

/* ---------- Decision focus: bounded, explanatory cards rather than score-ranked tiles ---------- */
.ws-section-head { display:flex; justify-content:space-between; align-items:end; gap:1rem; margin-bottom:.75rem; }
.ws-focus-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.75rem; }
.ws-focus-card { display:flex; flex-direction:column; gap:.45rem; padding:1rem; border:1px solid var(--border-soft); border-radius:var(--radius-md); background:linear-gradient(145deg,rgba(var(--primary-rgb),.09),rgba(15,23,42,.22)); min-width:0; }
.ws-focus-card-head { display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.ws-focus-card-head > strong { font-family:var(--font-mono,monospace); font-size:1rem; letter-spacing:.035em; }
.ws-focus-card ul,.ws-drawer-overview ul { padding-left:1.05rem; margin:.1rem 0; color:var(--text-muted); font-size:.78rem; }
.ws-focus-card .btn { margin-top:auto; align-self:flex-start; }
.ws-focus-action { min-height:1.75rem; }

/* ---------- View switcher tabs (Cơ hội / Danh mục / Theo dõi / Khám phá / Tín hiệu kỹ thuật) ---------- */
.ws-view-tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ws-view-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.ws-view-tab:hover { color: var(--text); }
.ws-view-tab.active {
  color: var(--accent-text-strong);
  border-bottom-color: var(--primary);
}
.ws-view-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Drawer: decision answer first, evidence on demand ---------- */
.ws-drawer-overview { padding:1rem; border:1px solid var(--border-medium); border-radius:var(--radius-md); background:linear-gradient(145deg,rgba(var(--primary-rgb),.12),rgba(15,23,42,.2)); margin-bottom:1rem; }
.ws-drawer-overview-head { display:flex; justify-content:space-between; gap:.75rem; align-items:start; }
.ws-drawer-overview h4 { margin:0; font-family:var(--font-mono,monospace); letter-spacing:.04em; }
.ws-drawer-overview h4 span { font-family:var(--font-sans,inherit); letter-spacing:0; font-size:.8rem; font-weight:500; color:var(--text-muted); }
.ws-drawer-keyline { display:flex; flex-wrap:wrap; gap:.4rem; margin:.65rem 0; }
.ws-drawer-facts { display:flex; flex-wrap:wrap; gap:.6rem 1rem; font-size:.8rem; color:var(--text-muted); }
.ws-drawer-facts b { color:var(--text); font-variant-numeric:tabular-nums; }
.ws-drawer-overview p { margin:.75rem 0 .35rem; line-height:1.45; }
.ws-drawer-technical { padding:.9rem 1rem; border:1px solid var(--border-soft); border-radius:var(--radius-md); background:rgba(15,23,42,.22); margin-bottom:1rem; }
.ws-drawer-technical h6 { margin:0 0 .6rem; }
.ws-technical-snapshot { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.45rem; }
.ws-technical-snapshot div { padding:.5rem .6rem; border-radius:var(--radius-sm); background:var(--surface); }
.ws-technical-snapshot span { display:block; font-size:.7rem; color:var(--text-muted); }
.ws-technical-snapshot strong { display:block; font-size:.84rem; margin-top:.15rem; }
.ws-help { position:relative; border-bottom:1px dotted var(--text-muted); cursor:help; outline:none; }
.ws-help:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.ws-help:hover::after,.ws-help:focus::after,.ws-evidence-quality:hover::after,.ws-evidence-quality:focus::after {
  content:attr(data-help); position:absolute; z-index:5; left:0; bottom:calc(100% + .45rem); width:min(250px,72vw);
  padding:.55rem .65rem; border:1px solid var(--border-medium); border-radius:var(--radius-sm); background:var(--bg-deep); color:var(--text);
  font-size:.74rem; font-weight:400; line-height:1.35; box-shadow:0 8px 18px rgba(0,0,0,.35);
}
.ws-evidence-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.6rem; margin:0 0 1rem; }
.ws-evidence-summary-item { padding:.75rem; border:1px solid var(--border-soft); border-radius:var(--radius-md); background:rgba(15,23,42,.18); min-width:0; }
.ws-evidence-summary-item > div { display:flex; align-items:center; justify-content:space-between; gap:.4rem; color:var(--text-muted); font-size:.72rem; }
.ws-evidence-summary-item strong { display:block; margin-top:.45rem; font-size:.86rem; }
.ws-evidence-summary-item p { margin:.3rem 0 0; color:var(--text-muted); font-size:.73rem; line-height:1.35; }
.ws-evidence-quality { position:relative; display:inline-flex; align-items:center; flex:0 0 auto; padding:.12rem .38rem; border:1px solid var(--border-medium); border-radius:999px; color:var(--text-muted); cursor:help; outline:none; }
.ws-evidence-quality.tone-constructive { border-color:rgba(32,231,207,.45); color:var(--accent-text-strong); }
.ws-evidence-quality.tone-caution { border-color:rgba(240,196,90,.45); color:#f0c45a; }
.ws-evidence-quality:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.ws-deep-evidence { border-top:1px solid var(--border-soft); padding-top:.75rem; }
.ws-deep-evidence > summary { cursor:pointer; font-weight:700; color:var(--accent-text); margin-bottom:.85rem; }
.ws-signal-evidence h6 { font-size:.78rem; margin:0; }
.ws-signal-chip-row { display:flex; flex-wrap:wrap; gap:.45rem; margin-top:.45rem; }
.ws-signal-chip { display:inline-flex; flex-wrap:wrap; gap:.18rem; align-items:baseline; padding:.4rem .55rem; border-radius:999px; border:1px solid var(--border-medium); background:var(--surface); font-size:.75rem; }
.ws-signal-chip small,.ws-signal-chip em { color:var(--text-muted); font-style:normal; }
.ws-signal-unavailable { margin:0; color:var(--text-muted); font-size:.83rem; }

/* ---------- Research diagnostic transparency ---------- */
.ws-valuation-summary {
  padding: .65rem .75rem;
  border-left: 3px solid var(--primary);
  background: rgba(var(--primary-rgb), .07);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.45;
}
.ws-valuation-methods { display: grid; gap: .55rem; margin-top: .75rem; }
.ws-valuation-method {
  padding: .7rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, .26);
}
.ws-valuation-method-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.ws-valuation-method-value { margin: .25rem 0; font-size: 1rem; }
.ws-diagnostic-value { font-variant-numeric: tabular-nums; }
.ws-diagnostic-context, .ws-diagnostic-blocker { margin-top: .3rem; }
.ws-diagnostic-blocker { color: var(--text-muted); }
.ws-axis-diagnostic > * + * { margin-top: .35rem; }
.ws-axis-diagnostic .cockpit-list { margin-top: .2rem; }
.ws-reference-trigger { margin-top: .45rem; padding: .65rem .75rem; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: rgba(15, 23, 42, .26); }

@media (max-width: 480px) {
  .ws-valuation-method-head { align-items: flex-start; flex-direction: column; }
  .ws-focus-grid { grid-template-columns:1fr; }
  .ws-section-head { align-items:start; flex-direction:column; }
  .ws-technical-snapshot { grid-template-columns:1fr; }
  .ws-evidence-summary { grid-template-columns:1fr; }
}

@media (min-width: 481px) and (max-width: 980px) { .ws-focus-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }


@media (max-width:768px) {
  .ws-view-tabs { flex-wrap:wrap; overflow:visible; }
  .ws-view-tab { padding:.5rem .55rem; font-size:.82rem; }
  .decision-drawer-header { flex-wrap:wrap; gap:.5rem; padding:.75rem; }
  .decision-drawer-body { padding:.85rem; }
}
@media (prefers-reduced-motion:reduce) {
  .decision-drawer,.decision-drawer-backdrop { transition:none; }
}
