:root {
  /* Financial light theme palette */
  --bg-page: #f4f7fb;
  --bg-surface: #ffffff;
  --bg-muted: #eef2f7;
  --border-soft: #dbe3ee;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --brand-navy: #1e3a5f;
  --brand-blue: #2563eb;
  --brand-blue-soft: #dbeafe;

  --header-height: 68px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);

  /* Card tones — HSL(R 100% 95%) bg, HSL(R 100% 80%) border */
  --tone-up-bg: hsl(142 100% 95%);
  --tone-up-border: hsl(142 100% 80%);
  --tone-up-text: hsl(142 55% 28%);

  --tone-flat-bg: hsl(45 100% 95%);
  --tone-flat-border: hsl(45 100% 80%);
  --tone-flat-text: hsl(38 55% 30%);

  --tone-down-bg: hsl(0 100% 95%);
  --tone-down-border: hsl(0 100% 80%);
  --tone-down-text: hsl(0 55% 34%);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: grid;
  grid-template-columns: auto minmax(240px, 420px) 1fr;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}

.search-form {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
  pointer-events: none;
}

.search-form input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0 16px 0 42px;
  background: var(--bg-muted);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.search-form input:focus {
  background: #fff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.main-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.nav-item.has-dropdown {
  position: relative;
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

.dropdown-trigger .caret {
  width: 14px;
  height: 14px;
  color: currentColor;
  transition: transform 0.15s ease;
}

.nav-item.is-open .dropdown-trigger .caret {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  z-index: 50;
}

.nav-item.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.dropdown-item:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.dropdown-item.is-active {
  background: var(--brand-blue-soft);
  color: var(--brand-navy);
  font-weight: 600;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.nav-link.is-active {
  background: var(--brand-blue-soft);
  color: var(--brand-navy);
}

/* Main layout */
.site-main {
  flex: 1 0 auto;   /* auto basis = theo content, không co nhỏ hơn content */
  display: flex;
  flex-direction: column;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

/* Symbol grid — table-like N x N responsive */
.symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.symbol-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, var(--border-soft));
  border-radius: 0;
  padding: 14px 14px 12px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.symbol-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.symbol-card.tone-up {
  --card-bg: var(--tone-up-bg);
  --card-border: var(--tone-up-border);
  color: var(--tone-up-text);
}

.symbol-card.tone-flat {
  --card-bg: var(--tone-flat-bg);
  --card-border: var(--tone-flat-border);
  color: var(--tone-flat-text);
}

.symbol-card.tone-down {
  --card-bg: var(--tone-down-bg);
  --card-border: var(--tone-down-border);
  color: var(--tone-down-text);
}

.symbol-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.symbol-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.symbol-code {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.symbol-name {
  font-size: 12px;
  line-height: 1.35;
  color: inherit;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.symbol-price {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.symbol-change {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.symbol-date {
  margin-top: auto;
  font-size: 11px;
  opacity: 0.65;
}

/* Symbol badges: margin (M) + restriction warning (W) */
.symbol-badge,
.restricted-badge,
.warning-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: help;
  position: relative;
  flex-shrink: 0;
}

.restricted-badge {
  background: hsl(0 0% 90%);
  color: hsl(0 0% 30%);
}

.warning-badge {
  background: hsl(48 92% 88%);
  color: hsl(0 72% 42%);
  border: 1px solid hsl(48 80% 78%);
}

.symbol-badge::after,
.restricted-badge::after,
.warning-badge::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  pointer-events: none;
  z-index: 20;
}

.symbol-badge:hover::after,
.symbol-badge:focus::after,
.restricted-badge:hover::after,
.restricted-badge:focus::after,
.warning-badge:hover::after,
.warning-badge:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Equal weight index chart page */
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.chart-container {
  width: 100%;
  min-height: 440px;
}

.chart-error {
  margin: 0;
  padding: 60px 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.empty-state {
  background: #fff;
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.empty-state p {
  margin: 0;
  color: var(--text-secondary);
}

.site-footer {
  border-top: 1px solid var(--border-soft);
  background: #fff;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.footer-muted {
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 960px) {
  .header-inner {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand {
    grid-column: 1;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .search-form {
    grid-column: 2;
  }
}

@media (max-width: 640px) {
  .header-inner {
    grid-template-columns: 1fr;
  }

  .search-form {
    grid-column: 1;
  }

  .symbol-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .footer-inner {
    flex-direction: column;
  }
}


/* Added */
.brand {
  gap: 8px;
}
.brand-badge {
  background: #eff6ff;
  color: var(--brand-blue);
  border: 1px solid #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
/* End added */
/* Modified */
/*
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: #fff;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}
.footer-muted {
  color: var(--text-muted);
}
*/
.site-footer {
  background-color: #0b132b;
  color: #94a3b8;
  border-top: 1px solid #1c2541;
  padding-top: 56px;
  font-size: 13px;
  margin-top: auto;
}
.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}
.footer-nav-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand h4 {
  color: #f8fafc;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-brand p {
  line-height: 1.65;
  margin: 0 0 14px;
  font-size: 13px;
  max-width: 360px;
  color: #94a3b8;
}
.footer-system-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: monospace;
}
.footer-tech-note {
  font-size: 11px;
  color: #64748b;
}
.footer-col h5 {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0 0 18px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col li {
  margin-bottom: 10px;
}
.footer-col a {
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
}
.footer-col a:hover {
  color: #38bdf8;
}
/* Disclaimer Box */
.footer-disclaimer-box {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 36px;
}
.disclaimer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fef08a;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.disclaimer-body {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.6;
}
.disclaimer-body p {
  margin: 0;
}
/* Bottom Bar */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
  color: #64748b;
}
.footer-bottom-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.dev-badge {
  background: #334155;
  color: #f1f5f9;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.footer-bottom-right a {
  color: #64748b;
}
.footer-bottom-right a:hover {
  color: #e2e8f0;
}
@media (max-width: 960px) {
  .footer-nav-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
}
@media (max-width: 640px) {
  .footer-nav-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================================
   LEGAL / DISCLAIMER PAGE STYLES
   ======================================================== */

/* Added */
.legal-page-wrapper {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.legal-page-header {
  margin-bottom: 36px;
  text-align: center;
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.legal-page-header h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0 0 12px;
}

.legal-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

/* Highlight warning box */
.legal-highlight-box {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 40px;
}

.legal-highlight-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b45309;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.legal-highlight-box p {
  color: #78350f;
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

/* Clause sections */
.legal-article {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.legal-clause {
  margin-bottom: 36px;
}

.legal-clause:last-child {
  margin-bottom: 0;
}

.legal-clause h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.legal-clause p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 12px;
}

.legal-clause ul {
  padding-left: 20px;
  margin: 0 0 12px;
}

.legal-clause li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 8px;
}

/* Bottom navigation */
.legal-page-footer {
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-back-home {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-blue);
}

.btn-back-home:hover {
  text-decoration: underline;
}

.btn-link-secondary {
  font-size: 13px;
  color: var(--text-muted);
}

.btn-link-secondary:hover {
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .legal-page-header h1 {
    font-size: 24px;
  }

  .legal-article {
    padding: 24px 20px;
  }
}
/* End added */