/* DESIGN SYSTEM: Banny Hills (Shadcn/UI Idiom)
   Vibe: Minimalist, clean, token-driven, highly polished.
*/

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500&display=swap');

:root {
  /* --- shadcn/ui base tokens (Light Theme) --- */
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  
  --muted-bg: 240 4.8% 95.9%;
  --muted-fg: 240 3.8% 46.1%;
  
  --accent-bg: 240 4.8% 95.9%;
  --accent-fg: 240 5.9% 10%;
  
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 10% 3.9%;
  
  --radius: 0.5rem;

  /* --- Banny Hills required variables mapped to shadcn --- */
  --bg: hsl(var(--background));
  --panel: hsl(var(--card));
  --line: hsl(var(--border));
  --fg: hsl(var(--foreground));
  --muted: hsl(var(--muted-fg));
  --accent: hsl(var(--primary));
  
  /* Semantic Directions */
  --neg: hsl(var(--destructive));
  --pos: hsl(142.1 76.2% 36.3%);
  --mixed: hsl(38 92% 50%);
  --neutral: hsl(var(--muted-fg));
  
  /* High-Trust Signals */
  --flag: hsl(24.6 95% 53.1%); 

  /* Typography */
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: 'Inter', -apple-system, sans-serif;
  --r: var(--radius);
}

:root[data-theme="dark"] {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  
  --popover: 240 10% 3.9%;
  --popover-foreground: 0 0% 98%;
  
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  
  --muted-bg: 240 3.7% 15.9%;
  --muted-fg: 240 5% 64.9%;
  
  --accent-bg: 240 3.7% 15.9%;
  --accent-fg: 0 0% 98%;
  
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
  
  /* Banny Hills specific mapping */
  --bg: hsl(var(--background));
  --panel: hsl(var(--card));
  --line: hsl(var(--border));
  --fg: hsl(var(--foreground));
  --muted: hsl(var(--muted-fg));
  --accent: hsl(var(--primary));
  --neg: hsl(var(--destructive));
  --pos: hsl(142.1 70% 45%);
  --mixed: hsl(38 92% 50%);
  --neutral: hsl(var(--muted-fg));
  --flag: hsl(24.6 95% 53.1%);
}

/* -------------------------------------------------------------------------- */
/* Base & Typography */
/* -------------------------------------------------------------------------- */

* { box-sizing: border-box; border-color: var(--line); }

body.cc-app {
  margin: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 0.875rem; /* 14px */
  line-height: 1.25rem; /* 20px */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: hsl(var(--primary));
  text-decoration: none;
  font-weight: 500;
}
a:hover {
  text-decoration: underline;
}

.cc-name-local { font-family: 'Noto Sans SC', var(--sans); }

.cc-h1 {
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  color: var(--fg);
}
.cc-h2 {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  margin: 2rem 0 1rem;
  color: var(--fg);
}
.cc-h3 {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 0.75rem;
}
.cc-sub {
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: var(--muted);
  max-width: 42rem;
  margin-bottom: 1.5rem;
}

/* -------------------------------------------------------------------------- */
/* Chrome (Header, Main, Footer) */
/* -------------------------------------------------------------------------- */

.cc-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background-color: hsl(var(--background) / 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  height: 3.5rem;
  padding: 0 1.5rem;
}
.cc-brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.025em;
  color: var(--fg);
  text-decoration: none;
  margin-right: 2rem;
}
.cc-brand:hover { text-decoration: none; }
.cc-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.cc-nav a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 150ms;
  text-decoration: none;
}
.cc-nav a:hover { color: var(--fg); }

.cc-main { max-width: 1200px; margin: 0 auto; padding: 2.5rem 1.5rem; }

.cc-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* -------------------------------------------------------------------------- */
/* Dashboard (Home) */
/* -------------------------------------------------------------------------- */

.cc-dash { margin-bottom: 3rem; }

.cc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.cc-stat {
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 150ms ease;
}
a.cc-stat:hover { 
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); 
  text-decoration: none; 
}
.cc-stat-n {
  font-family: var(--mono);
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.05em;
  margin-bottom: 0.5rem;
  color: var(--fg);
}
.cc-stat-l {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.cc-dash-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.cc-dash-col { 
  display: flex; flex-direction: column;
  background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); padding: 1.25rem 0 0; overflow: hidden;
}
.cc-dash-col .cc-h2, .cc-dash-col .cc-h3 {
  margin: 0 1.25rem 0.5rem; border-bottom: 1px solid var(--line); padding-bottom: 0.75rem;
  font-size: 1.125rem; border-top: none;
}
.cc-dash-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0;
  max-height: 380px; overflow-y: auto;
}
.cc-dash-list::-webkit-scrollbar, .cc-stock-list::-webkit-scrollbar { width: 6px; }
.cc-dash-list::-webkit-scrollbar-track, .cc-stock-list::-webkit-scrollbar-track { background: transparent; }
.cc-dash-list::-webkit-scrollbar-thumb, .cc-stock-list::-webkit-scrollbar-thumb { background-color: var(--line); border-radius: 10px; }
.cc-dash-list::-webkit-scrollbar-thumb:hover, .cc-stock-list::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }

.cc-dash-item {
  background-color: transparent; border: none; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none; transition: background-color 150ms ease;
}
.cc-dash-item:last-child { border-bottom: none; }
.cc-dash-item:hover {
  background-color: hsl(var(--muted-bg) / 0.5); box-shadow: none;
}
.cc-dash-link {
  display: flex; flex-direction: column; padding: 0.75rem 1.25rem;
  color: inherit; text-decoration: none; height: 100%;
}
.cc-dash-link:hover { text-decoration: none; }
.cc-dash-badges { margin-bottom: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cc-item-badges { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
.cc-dash-title {
  font-size: 0.875rem; font-weight: 500; line-height: 1.25rem;
  margin-bottom: 0.75rem; color: var(--fg);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cc-dash-meta {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-top: auto;
}
.cc-seeall {
  font-size: 0.875rem; font-weight: 500;
  float: right; margin-top: 0.25rem; color: hsl(var(--primary));
  text-transform: none; letter-spacing: normal;
}

/* -------------------------------------------------------------------------- */
/* Feed & Filters */
/* -------------------------------------------------------------------------- */

.cc-filters {
  display: flex; flex-wrap: nowrap; gap: 0.375rem; align-items: center;
  margin-bottom: 1.5rem; overflow-x: auto; padding-bottom: 0.25rem;
  scrollbar-width: none; -ms-overflow-style: none;
}
.cc-filters::-webkit-scrollbar { display: none; }
.cc-search { flex: 1 1 120px; min-width: 120px; }
.cc-filters input[type="search"], .cc-filters select {
  background-color: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 0.25rem 0.5rem;
  font: inherit; font-size: 0.8125rem;
  border-radius: calc(var(--r) - 2px); 
  transition: border-color 150ms ease, box-shadow 150ms ease;
  height: 2rem;
}
.cc-filters input[type="search"]:focus, .cc-filters select:focus {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
  border-color: hsl(var(--primary));
}
.cc-check {
  display: flex; align-items: center; gap: 0.375rem; cursor: pointer; height: 2rem;
  color: var(--fg); font-size: 0.8125rem; white-space: nowrap;
}
.cc-check input[type="checkbox"] {
  width: 1rem; height: 1rem; margin: 0; cursor: pointer;
  accent-color: hsl(var(--primary));
}
.cc-count {
  margin-left: auto; font-family: var(--mono); color: var(--muted); font-size: 0.875rem;
}
.cc-count::before { content: "Results: "; font-family: var(--sans); }

.cc-feed { 
  list-style: none; margin: 0; padding: 0; 
  display: flex; flex-direction: column; gap: 0;
  background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); overflow: hidden;
}
.cc-item { 
  background-color: transparent; border: none; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none; transition: background-color 150ms ease;
}
.cc-item:last-child { border-bottom: none; }
.cc-item:hover { background-color: hsl(var(--muted-bg) / 0.5); }
.cc-item-link {
  display: grid; grid-template-columns: 1fr; gap: 0.75rem; padding: 1rem 1.25rem; color: var(--fg); text-decoration: none;
}
.cc-item-link:hover { text-decoration: none; }
.cc-feed-header {
  display: none;
  justify-content: space-between;
  padding: 0.5rem 1.25rem 0.75rem;
  font-size: 0.875rem; font-weight: 500; color: var(--muted);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.5rem;
}
.cc-item-title { font-weight: 500; font-size: 0.875rem; margin: 0; line-height: 1.25rem; }
.cc-item-meta {
  display: flex; flex-wrap: wrap; gap: 1rem; color: var(--muted); font-size: 0.75rem;
  font-family: var(--mono); align-items: center;
}
.cc-item-domain { text-transform: uppercase; font-size: 0.6875rem; font-family: var(--sans); font-weight: 600; color: var(--fg); }
.cc-fh-domain, .cc-item-domain, .cc-fh-stage, .cc-item-stage, .cc-fh-pass, .cc-item-pass, .cc-fh-flag { text-align: center; justify-content: center; }
.cc-item-flags-stack { display: flex; flex-direction: column; gap: 0.25rem; align-items: center; }
.cc-item-flags-stack .cc-flag { margin-left: 0; }
@media (min-width: 768px) {
  .cc-item-meta { display: contents; }
  .cc-item-link { grid-template-columns: 155px minmax(200px, 1fr) auto; align-items: center; gap: 1rem; }
  .cc-feed-header,
  #cc-feed .cc-item-link { grid-template-columns: 155px minmax(200px, 1fr) 60px 120px 65px 110px; }
  .cc-feed-header { display: grid; gap: 1rem; align-items: center; }
}

/* -------------------------------------------------------------------------- */
/* Badges & Chips (Shadcn Badge) */
/* -------------------------------------------------------------------------- */

.cc-chip, .cc-type, .cc-flag {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px; /* full rounded for badges */
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem; font-weight: 600;
  white-space: nowrap; transition: color 150ms ease, background-color 150ms ease;
  border: 1px solid transparent;
}
.cc-type {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cc-relevance { 
  background-color: hsl(var(--secondary)); 
  color: hsl(var(--secondary-foreground));
}
.cc-asset-impact.ai-high { 
  background-color: hsl(var(--destructive)); 
  color: hsl(var(--destructive-foreground)); 
}
.cc-asset-impact.ai-mid { 
  background-color: var(--mixed); 
  color: hsl(var(--primary-foreground)); 
}
.cc-asset-impact.ai-low { 
  background-color: hsl(var(--secondary)); 
  color: hsl(var(--secondary-foreground)); 
}

.cc-type {
  border-color: var(--line);
  background-color: transparent;
  color: var(--fg);
}

.cc-flag {
  background-color: var(--flag); 
  color: hsl(var(--primary-foreground)); 
  font-family: var(--mono);
  margin-left: 0.25rem;
  cursor: help;
}
.cc-flag:focus { outline: none; box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring)); }

.cc-dir--negative { color: var(--neg); font-weight: 600; }
.cc-dir--positive { color: var(--pos); font-weight: 600; }
.cc-dir--mixed { color: var(--mixed); font-weight: 600; }
.cc-dir--neutral { color: var(--neutral); font-weight: 600; }

/* -------------------------------------------------------------------------- */
/* Calendar */
/* -------------------------------------------------------------------------- */

.cc-cal-month { margin-bottom: 3rem; }
.cc-cal-month-label { 
  font-family: var(--mono); font-size: 1.25rem; font-weight: 600; color: var(--fg); 
  border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; margin-bottom: 1.5rem; 
}
.cc-cal-list {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem;
}
@media (min-width: 768px) {
  .cc-calendar .cc-cal-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
.cc-cal-event { 
  background-color: var(--panel); 
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  transition: box-shadow 150ms ease; 
}
.cc-cal-event:hover { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.cc-cal-link { display: flex; flex-direction: column; padding: 1rem; color: inherit; text-decoration: none; height: 100%; }
.cc-cal-link:hover { text-decoration: none; }

.cc-dash-cal .cc-cal-event {
  background-color: transparent; border: none; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none; transition: background-color 150ms ease;
}
.cc-dash-cal .cc-cal-event:last-child { border-bottom: none; }
.cc-dash-cal .cc-cal-event:hover { background-color: hsl(var(--muted-bg) / 0.5); box-shadow: none; }
.cc-dash-cal .cc-cal-link { padding: 0.75rem 1.25rem; }
.cc-cal-date { font-family: var(--mono); font-size: 0.875rem; color: var(--fg); font-weight: 600; margin-bottom: 0.25rem; }
.cc-cal-milestone { font-size: 0.75rem; font-weight: 600; color: hsl(var(--primary)); text-transform: uppercase; }
.cc-cal-title { font-size: 0.875rem; font-weight: 500; color: var(--fg); margin-top: 0.25rem; margin-bottom: 1rem; }
.cc-cal-badges { margin-top: auto; display: flex; gap: 0.5rem; }

/* Dynamic Calendar Widget (Home) */
.cc-cal-widget {
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.cc-dash-col .cc-cal-widget {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  margin-bottom: 0;
}
.cc-cal-w-head {
  padding: 0.75rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}
.cc-cal-w-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
}
.cc-cal-w-days span {
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.cc-cal-w-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--line);
}
.cc-cal-w-cell {
  background-color: var(--panel);
  min-height: 3rem;
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
}
.cc-cal-w-cell.empty { background-color: hsl(var(--muted-bg) / 0.3); }
.cc-cal-w-cell .day-num { font-size: 0.75rem; color: var(--muted); padding: 0.125rem; }
.cc-cal-w-cell.has-events .day-num { color: var(--fg); font-weight: 600; }
.ev-dots { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: auto; padding-top: 0.25rem; }
.ev-dot { width: 0.375rem; height: 0.375rem; border-radius: 50%; background-color: hsl(var(--primary)); display: block; }
.cc-dash-cal { display: none; }

/* -------------------------------------------------------------------------- */
/* Card Views (Bill / Amendment / Sector) */
/* -------------------------------------------------------------------------- */

.cc-card, .cc-prose, .cc-sector-page, .cc-stock-page {
  background-color: var(--panel); border: 1px solid var(--line); padding: 1.5rem;
  margin-bottom: 1.5rem; border-radius: var(--r);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  line-height: 1.6;
}

.cc-card-title { font-size: 1.875rem; font-weight: 700; margin: 1rem 0 1.5rem; line-height: 2.25rem; letter-spacing: -0.025em; }
.cc-card-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; color: var(--muted); margin-bottom: 1.5rem; }
.cc-domain { font-family: var(--sans); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; color: var(--fg); }
.cc-why {
  color: var(--fg); font-size: 0.875rem; margin: 1.5rem 0; padding: 1rem;
  background-color: hsl(var(--muted-bg)); 
  border-left: 4px solid hsl(var(--primary)); 
  border-radius: 0 var(--r) var(--r) 0;
}
.cc-sponsor, .cc-parent, .cc-sub { color: var(--muted); font-size: 0.875rem; margin-top: 0.75rem; }
.cc-bipartisan { color: var(--pos); font-weight: 600; font-size: 0.75rem; margin-left: 0.5rem; }

/* Timeline */
.cc-timeline { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cc-timeline .cc-event {
  display: flex; gap: 1.5rem; padding: 1rem; font-size: 0.875rem; border-bottom: 1px solid var(--line); background-color: var(--panel);
}
.cc-timeline .cc-event:last-child { border-bottom: none; }
.cc-event-date { font-family: var(--mono); color: var(--fg); font-weight: 500; min-width: 6rem; }
.cc-event-label { flex: 1; color: var(--fg); font-weight: 500; }
.cc-event-chamber { color: var(--muted); font-family: var(--mono); }
.cc-event-scope {
  color: hsl(var(--primary-foreground)); font-size: 0.625rem; font-weight: 600;
  background-color: hsl(var(--primary)); padding: 0.125rem 0.375rem; border-radius: 9999px;
  margin-left: 0.5rem; vertical-align: middle;
}

/* Outlook / Prognosis */
.cc-outlook {
  border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem; margin: 2rem 0;
  background-color: hsl(var(--muted-bg) / 0.5);
}
.cc-stage { font-weight: 600; margin-bottom: 1rem; font-size: 0.875rem; color: var(--fg); }
.cc-prob { margin-bottom: 1.5rem; }
.cc-prob-main { font-size: 3rem; font-weight: 700; font-family: var(--mono); color: var(--fg); letter-spacing: -0.05em; line-height: 1; margin-right: 0.75rem; }
.cc-prob--resolved .cc-prob-main { color: var(--muted); }
.cc-factors { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
@media (min-width: 640px) { .cc-factors { grid-template-columns: 1fr 1fr; } }
.cc-factors ul { margin: 0.5rem 0 0 0; padding-left: 1.25rem; font-size: 0.875rem; }
.cc-factors-pos li::marker { color: var(--pos); }
.cc-factors-neg li::marker { color: var(--neg); }
.cc-note, .cc-muted { color: var(--muted); font-size: 0.875rem; margin-top: 1rem; }

/* -------------------------------------------------------------------------- */
/* Roster & Shares */
/* -------------------------------------------------------------------------- */

.cc-sector { border: 1px solid var(--line); border-radius: var(--r); margin: 1.5rem 0; background-color: var(--panel); overflow: hidden; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.cc-sector-head {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  padding: 1rem 1.25rem; background-color: hsl(var(--muted-bg)); border-bottom: 1px solid var(--line);
}
.cc-sector-name { font-weight: 600; font-size: 1rem; color: var(--fg); }
.cc-prov { font-size: 0.75rem; color: var(--muted); font-family: var(--mono); margin-left: auto; text-transform: uppercase; }
.cc-sector-why { font-size: 0.875rem; color: var(--muted); padding: 1rem 1.25rem 0; }
.cc-roster-count { font-family: var(--mono); font-size: 0.875rem; color: var(--muted); }

.cc-roster {
  display: block; width: 100%; overflow-x: auto; border-collapse: collapse;
  font-size: 0.875rem; padding: 0 1.25rem 1.25rem;
}
.cc-roster th {
  text-align: left; padding: 0.75rem 1rem 0.75rem 0; border-bottom: 1px solid var(--line);
  color: var(--muted); font-weight: 500; white-space: nowrap;
}
.cc-roster td {
  text-align: left; padding: 0.75rem 1rem 0.75rem 0; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.cc-roster tr:last-child td { border-bottom: none; }
.cc-ticker { font-family: var(--mono); font-weight: 500; text-align: right; }
.cc-name-en { color: var(--muted); }
.cc-name-local { margin-left: 0.5rem; font-weight: 500; }
.cc-name-flags { margin-left: 0.5rem; }
.cc-more { 
  display: block; padding: 0.75rem 1.25rem; font-size: 0.875rem; font-weight: 500; 
  text-align: center; background-color: hsl(var(--muted-bg)); border-top: 1px solid var(--line); 
  color: var(--fg); text-decoration: none;
}
.cc-more:hover { background-color: hsl(var(--secondary)); text-decoration: none; }

.cc-private { margin-top: 2rem; border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem; background-color: hsl(var(--muted-bg) / 0.5); }
.cc-private-name { font-weight: 600; font-size: 1rem; }
.cc-private-type { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; margin-left: 0.5rem; font-weight: 600; }
.cc-proxy { margin-right: 1rem; display: inline-block; margin-top: 0.75rem; }
.cc-proxy em { color: var(--muted); font-style: normal; }

/* -------------------------------------------------------------------------- */
/* Stock & Sector Pages */
/* -------------------------------------------------------------------------- */

.cc-stock-meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center;
  margin-bottom: 2rem; font-family: var(--mono); font-size: 0.875rem;
  padding: 1rem; background-color: hsl(var(--muted-bg) / 0.5); border: 1px solid var(--line); border-radius: var(--r);
}
.cc-exch, .cc-isin, .cc-listing { color: var(--muted); }

.cc-empty { color: var(--muted); font-style: italic; }
.cc-prose p { margin-bottom: 1.25rem; color: var(--fg); }

/* Popover Tooltip (Shadcn Popover styling) */
.cc-tooltip-el {
  position: absolute;
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  padding: 0.75rem 1rem;
  border-radius: var(--r);
  border: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.875rem;
  width: max-content;
  max-width: 320px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  z-index: 50;
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* NEW V3 STYLES (Pagination, Sectors Grid, Stepper, Dash Stocks, Cal Colors) */
/* -------------------------------------------------------------------------- */

/* 1. Pagination */
.cc-pager {
  display: flex; align-items: center; justify-content: space-between; margin: 2rem 0;
}
.cc-page-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 2.25rem; padding: 0 1rem;
  border-radius: calc(var(--r) - 2px); font-weight: 500; font-size: 0.875rem;
  background-color: transparent; border: 1px solid var(--line); color: var(--fg);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  cursor: pointer; transition: background-color 150ms ease, color 150ms ease;
}
.cc-page-btn:hover:not([disabled]) { background-color: hsl(var(--muted-bg)); }
.cc-page-btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.cc-page-info { flex: 1; text-align: center; font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 2. Sectors Index */
.cc-sector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.cc-sector-card {
  background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); padding: 1.5rem; display: flex; flex-direction: column;
  transition: box-shadow 150ms ease, transform 150ms ease;
  text-decoration: none; color: inherit;
}
a.cc-sector-card:hover {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  transform: translateY(-2px);
  text-decoration: none;
}
.cc-sector-card-title { font-size: 1.25rem; font-weight: 600; margin: 0 0 1rem; color: var(--fg); }
.cc-sector-card-stats { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.cc-sc-stat { font-size: 0.875rem; color: var(--muted); display: flex; flex-direction: column; }
.cc-sc-stat span { font-weight: 700; font-size: 1.25rem; color: var(--fg); font-family: var(--mono); }
.cc-sc-stat.cc-sc-flagged span { color: var(--flag); }
.cc-sc-names { display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.cc-sc-name { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.875rem; }
.cc-sc-name-label {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 75%;
  color: var(--fg); font-weight: 500;
}
.cc-sc-ticker { font-family: var(--mono); color: var(--muted); font-size: 0.75rem; }
.cc-sector-card .cc-sc-more { margin-top: auto; padding-top: 1rem; font-size: 0.875rem; color: hsl(var(--primary)); font-weight: 500; }

/* 3. Pathway Stepper */
.cc-pathway { display: flex; flex-direction: column; padding: 1.5rem; background-color: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.cc-step { display: flex; position: relative; padding-bottom: 1.5rem; }
.cc-step:last-child { padding-bottom: 0; }
.cc-step-rail {
  position: absolute; left: 11px; top: 24px; bottom: -8px; width: 2px;
  background-color: var(--line);
}
.cc-step:last-child .cc-step-rail { display: none; }
.cc-step-marker {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background-color: var(--panel); border: 2px solid var(--line); margin-right: 1rem; z-index: 1;
  color: var(--muted); flex-shrink: 0;
}
.cc-step-marker svg.cc-ic { width: 14px; height: 14px; fill: currentColor; }
.cc-step-body { flex: 1; padding-top: 2px; }
.cc-step-label { font-weight: 600; font-size: 0.875rem; color: var(--fg); margin-bottom: 0.25rem; }
.cc-step-date { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-bottom: 0.25rem; }
.cc-step-tag {
  display: inline-block; font-size: 0.625rem; text-transform: uppercase; font-weight: 700;
  padding: 0.125rem 0.375rem; border-radius: 4px; background-color: var(--line); color: var(--muted);
}
.cc-pathway-legend { display: flex; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); font-size: 0.875rem; color: var(--muted); }
.cc-lg { display: flex; align-items: center; gap: 0.375rem; }
.cc-lg svg.cc-ic { width: 14px; height: 14px; fill: currentColor; }
.cc-lg--done svg.cc-ic { color: var(--pos); }
.cc-lg--current svg.cc-ic { color: hsl(221 83% 53%); }
.cc-lg--upcoming svg.cc-ic { color: var(--muted); }
.cc-lg--failed svg.cc-ic { color: var(--neg); }

/* States */
.cc-step--done .cc-step-marker { border-color: var(--pos); color: var(--pos); background-color: var(--panel); }
.cc-step--done .cc-step-rail { background-color: var(--pos); }

.cc-step--current .cc-step-marker { border-color: hsl(221 83% 53%); color: hsl(var(--background)); background-color: hsl(221 83% 53%); }
.cc-step--current .cc-step-rail { background-color: var(--line); }
.cc-step--current .cc-step-label { color: hsl(221 83% 53%); }
.cc-step--current .cc-step-tag { background-color: hsl(221 83% 53% / 0.1); color: hsl(221 83% 53%); }

.cc-step--upcoming .cc-step-marker { border-color: var(--line); color: var(--muted); }
.cc-step--upcoming .cc-step-label { color: var(--muted); }

.cc-step--failed .cc-step-marker { border-color: var(--neg); color: hsl(var(--background)); background-color: var(--neg); }
.cc-step--failed .cc-step-rail { background-color: var(--line); }
.cc-step--failed .cc-step-label { color: var(--neg); }

/* 4. Calendar Colors */
.ev-dot.ai-high { background-color: hsl(var(--destructive)); }
.cc-cal-w-cell.has-events.ai-high { background-color: hsl(var(--destructive) / 0.05); border-left: 2px solid hsl(var(--destructive)); }
.cc-cal-event.ai-high { border-left: 3px solid hsl(var(--destructive)); }

.ev-dot.ai-mid { background-color: var(--mixed); }
.cc-cal-w-cell.has-events.ai-mid { background-color: hsl(38 92% 50% / 0.05); border-left: 2px solid var(--mixed); }
.cc-cal-event.ai-mid { border-left: 3px solid var(--mixed); }

.ev-dot.ai-low { background-color: hsl(var(--secondary-foreground)); }
.cc-cal-w-cell.has-events.ai-low { background-color: hsl(var(--secondary) / 0.5); border-left: 2px solid hsl(var(--secondary-foreground)); }
.cc-cal-event.ai-low { border-left: 3px solid hsl(var(--secondary-foreground)); }

/* 5. Home China names in focus stock panel */
.cc-dash-stocks { display: flex; flex-direction: column; }
.cc-stock-list { 
  list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; 
  max-height: 380px; overflow-y: auto;
}
.cc-stock-item { border-bottom: 1px solid var(--line); }
.cc-stock-item:last-child { border-bottom: none; }
.cc-stock-link {
  display: flex; flex-direction: column; padding: 0.75rem 1.25rem; color: var(--fg); text-decoration: none;
  transition: background-color 150ms ease;
}
.cc-stock-link:hover { text-decoration: none; background-color: hsl(var(--muted-bg) / 0.5); }
.cc-stock-ticker { font-family: var(--mono); font-weight: 600; font-size: 0.875rem; color: var(--fg); margin-bottom: 0.25rem; display: flex; justify-content: space-between; align-items: center; }
.cc-stock-name { font-size: 0.875rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: baseline; }
.cc-name-local { font-weight: 500; color: var(--fg); margin-right: 0.5rem; font-family: 'Noto Sans SC', var(--sans); }
.cc-name-en { color: var(--muted); }
.cc-stock-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }
.cc-stock-list .cc-stock-meta { background: transparent; border: none; padding: 0; margin-bottom: 0; border-radius: 0; }
.cc-stock-sector { font-size: 0.75rem; color: var(--muted); }
.cc-stock-flags { display: flex; gap: 0.25rem; margin-left: auto; }
