.top-nav { display: inline-flex; align-items: center; }
.top-nav a {
  padding: .58rem .82rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
}
.top-nav a:hover { color: var(--text); border-color: rgba(140,190,220,.32); }

/* Home-page preview only. */
.watch-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.watch-card {
  display: flex;
  min-height: 8.6rem;
  flex-direction: column;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #101d2d;
}
.watch-card:hover { border-color: rgba(140,190,220,.32); background: #132235; }
.watch-card-top,.watch-meta { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.watch-card-top strong { display: block; font-size: 1.18rem; }
.watch-card-top span,.watch-card p,.watch-meta { color: var(--muted); }
.watch-card p { flex: 1; margin: .55rem 0 .3rem; font-size: .86rem; }
.watch-score { color: #b6d4e7 !important; font-weight: 800; }

.watch-mini-scores {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin: .25rem 0 .55rem;
}
.watch-home-candidates {
  margin-top: .9rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
}
.watch-home-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .7rem;
  margin-bottom: .55rem;
}
.watch-home-title b { color: var(--text); font-size: .9rem; }
.watch-home-title span { color: var(--muted); font-size: .72rem; }
.watch-home-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d1928;
}
.watch-home-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
}
.watch-home-table th,
.watch-home-table td {
  padding: .55rem .65rem;
  border-bottom: 1px solid rgba(255,255,255,.055);
  text-align: left;
  vertical-align: middle;
}
.watch-home-table th {
  color: var(--muted-2);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.watch-home-table td { color: #cbd7e3; font-size: .78rem; }
.watch-home-table tr:last-child td { border-bottom: 0; }
.watch-home-table td:first-child b { display: block; color: var(--text); }
.watch-home-table td:first-child small {
  display: block;
  max-width: 13rem;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}


.score-stack { display: inline-flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: .32rem;
  padding: .24rem .42rem;
  border: 1px solid rgba(141,207,226,.18);
  border-radius: 999px;
  background: rgba(141,207,226,.045);
  white-space: nowrap;
}
.score-pill small {
  display: inline !important;
  max-width: none !important;
  margin: 0 !important;
  color: var(--muted-2) !important;
  font-size: .58rem !important;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.score-pill b { color: #d7edf7; font-size: .82rem; }
.score-pill.current { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.03); }
.score-pill.current b { color: #cbd7e3; }
.watch-card-top .score-stack { justify-content: flex-end; }

.watch-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: .5rem 0 1rem;
  padding: 1rem 0 1.15rem;
  border-bottom: 1px solid var(--line);
}
.watch-header h1 { margin: .2rem 0 .25rem; font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.065em; }
.watch-header p { margin: 0; color: var(--muted); }
.watch-shell { min-height: 24rem; }

.watch-summary-strip,
.performance-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0d1928;
}
.watch-summary-strip > div,
.performance-strip > div { min-width: 0; padding: .9rem 1rem; border-right: 1px solid var(--line); }
.watch-summary-strip > div:last-child,
.performance-strip > div:last-child { border-right: 0; }
.watch-summary-strip span,
.performance-strip span {
  display: block;
  margin-bottom: .28rem;
  color: var(--muted-2);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.watch-summary-strip strong,.performance-strip strong { display: block; overflow: hidden; font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }

.watch-summary-strip > div > small {
  display: inline-block;
  margin-left: .35rem;
  color: var(--muted-2);
  font-size: .62rem;
  font-weight: 750;
  vertical-align: middle;
}

.performance-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1.2rem; }

.watch-pl-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: .8rem;
}
.watch-pl-strip strong span { font-size: inherit; }



.watch-explainer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem 0 1.15rem;
}
.watch-explainer > div {
  min-width: 0;
  padding: .85rem .95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d1928;
}
.watch-explainer b {
  display: block;
  margin-bottom: .25rem;
  color: var(--text);
  font-size: .86rem;
}
.watch-explainer span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.4;
}

.watch-tabs { display: flex; gap: 1.6rem; margin: 1.25rem 0 0; border-bottom: 1px solid var(--line); }
.watch-tabs button {
  margin-bottom: -1px;
  padding: .75rem .1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}
.watch-tabs button:hover { color: var(--text); transform: none; }
.watch-tabs button.active { color: var(--text); border-bottom-color: #8dcfe2; }

.watch-tabs button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  margin-left: .32rem;
  padding: .05rem .34rem;
  border: 1px solid rgba(141,207,226,.18);
  border-radius: 999px;
  color: var(--muted-2);
  font-size: .66rem;
}
.watch-tabs button.active span { color: #8dcfe2; border-color: rgba(141,207,226,.32); }
.watch-pane { display: none; padding-top: 1rem; }
.watch-pane.active { display: block; }

.watch-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 230px 180px; gap: .65rem; }
.watch-toolbar-simple { grid-template-columns: minmax(220px, 320px); }
.watch-toolbar input,.watch-toolbar select {
  width: 100%;
  min-height: 2.65rem;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: #0d1928;
}
.watch-toolbar input:focus,.watch-toolbar select:focus { border-color: rgba(141,207,226,.45); }
.watch-result-meta { margin: .75rem 0 .55rem; color: var(--muted); font-size: .78rem; }

.watch-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.watch-table { width: 100%; min-width: 980px; border-collapse: collapse; }
.watch-table th {
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  background: #0b1624;
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
}
.watch-table td { padding: .68rem .75rem; border-bottom: 1px solid rgba(255,255,255,.055); color: #cbd7e3; font-size: .82rem; vertical-align: middle; }
.watch-table tbody tr:last-child td { border-bottom: 0; }
.watch-table tbody tr:hover td { background: rgba(255,255,255,.022); }
.watch-table td:first-child b { color: var(--text); font-size: .9rem; }
.watch-table td small { display: block; max-width: 260px; margin-top: .14rem; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.watch-status { display: inline-flex; padding: .28rem .48rem; border: 1px solid var(--line); border-radius: 6px; font-size: .68rem; font-weight: 750; white-space: nowrap; }
.watch-status.good { color: var(--green); border-color: rgba(86,230,165,.2); background: rgba(86,230,165,.05); }
.watch-status.neutral { color: var(--muted); background: transparent; }

.tier-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: .25rem .48rem;
  border: 1px solid rgba(141,207,226,.2);
  border-radius: 999px;
  color: #cfe8f5;
  background: rgba(141,207,226,.055);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tier-badge.a { color: #56e6a5; border-color: rgba(86,230,165,.26); background: rgba(86,230,165,.07); }
.tier-badge.b { color: #ffd166; border-color: rgba(255,209,102,.28); background: rgba(255,209,102,.075); }
.tier-badge.active { color: #8dcfe2; border-color: rgba(141,207,226,.28); background: rgba(141,207,226,.075); }
.tier-badge.muted { color: var(--muted); background: transparent; }
.setup-cell { display: grid; gap: .25rem; min-width: 9rem; }
.setup-cell small {
  color: var(--muted-2) !important;
  font-size: .62rem !important;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.setup-cell em {
  display: block;
  max-width: 18rem;
  overflow: hidden;
  color: var(--muted);
  font-size: .72rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.watch-toolbar-signals { grid-template-columns: minmax(220px, 320px) minmax(140px, 180px); }
.good { color: var(--green) !important; }.bad { color: var(--red) !important; }.neutral { color: var(--muted) !important; }
.watch-empty { margin: 1.2rem 0; color: var(--muted); }
.watch-more-wrap { display: flex; justify-content: center; padding: .9rem; }
.watch-more { padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #101d2d; cursor: pointer; }
.watch-more:hover { border-color: rgba(141,207,226,.35); transform: none; }

.watch-subsection { margin-top: 1rem; }
.watch-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; }
.watch-section-title h2 { margin: 0; font-size: 1.1rem; }
.watch-section-title p { margin: 0; color: var(--muted); font-size: .78rem; }
.cohort-table { min-width: 660px; }
.watch-history { margin-top: 1rem; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.watch-history > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; cursor: pointer; list-style: none; background: #0d1928; }
.watch-history > summary::-webkit-details-marker { display: none; }
.watch-history > summary span:first-child { display: flex; align-items: baseline; gap: .6rem; }
.watch-history > summary small,.watch-history > summary span:last-child { color: var(--muted); font-size: .75rem; }
.watch-history .watch-table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }

@media (max-width: 900px) {
  .watch-explainer { grid-template-columns: 1fr; }
  .watch-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-toolbar { grid-template-columns: 1fr 1fr; }
  .watch-toolbar input { grid-column: 1 / -1; }
  .watch-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .watch-summary-strip > div:nth-child(2) { border-right: 0; }
  .watch-summary-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; }.top-nav { order: 3; width: 100%; }.top-nav a { width: 100%; justify-content: center; }
  .watch-preview-grid,.watch-toolbar { grid-template-columns: 1fr; }
  .watch-toolbar input { grid-column: auto; }
  .watch-tabs { gap: .9rem; overflow-x: auto; }
  .watch-tabs button { white-space: nowrap; }
  .watch-summary-strip,.performance-strip { grid-template-columns: 1fr 1fr; }
  .watch-summary-strip > div,.performance-strip > div { border-bottom: 1px solid var(--line); }
  .watch-section-title { display: block; }.watch-section-title p { margin-top: .25rem; }
}

/* Keep homepage watchlist preview cards contained in narrow columns. */
.watch-preview-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.watch-card.compact { min-width: 0; overflow: hidden; }
.watch-card.compact .watch-card-top { min-width: 0; }
.watch-card.compact .watch-card-top > div:first-child { min-width: 0; }
.watch-card.compact .watch-card-top strong,
.watch-card.compact .watch-card-top span,
.watch-card.compact p,
.watch-card.compact .watch-meta span { overflow-wrap: anywhere; }
.watch-card.compact .watch-score { flex: 0 0 auto; }
.watch-card.compact .watch-meta {
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-start;
  row-gap: .18rem;
}
.watch-card.compact .watch-meta span { min-width: 0; }
.watch-card.compact .watch-meta span:first-child { flex: 1 1 100%; }
.watch-card.compact .watch-meta span:last-child { flex: 0 1 auto; max-width: 100%; }
