/* ============================================================
   TradingView replica — main.css
   Hand-written native styles, zero external dependency
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --tv-bg: #ffffff;
  --tv-bg-soft: #f0f3fa;
  --tv-ink: #131722;
  --tv-ink-soft: #434651;
  --tv-muted: #787b86;
  --tv-line: #e0e3eb;
  --tv-blue: #2962ff;
  --tv-blue-dark: #1e53e5;
  --tv-blue-soft: #e3ecff;
  --tv-up: #26a69a;
  --tv-down: #ef5350;
  --tv-dark-bg: #131722;
  --tv-dark-soft: #1c2030;
  --tv-dark-line: #2a2e39;

  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(19, 23, 34, 0.06);
  --shadow-md: 0 8px 24px rgba(19, 23, 34, 0.10);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 52px;
  --container: 1200px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--tv-ink);
  background: var(--tv-bg);
  font-size: clamp(15px, 0.9vw + 12px, 17px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

ul { list-style: none; }

input { font: inherit; }

.num { font-variant-numeric: tabular-nums; }

.up { color: var(--tv-up); }
.down { color: var(--tv-down); }
.text-blue { color: var(--tv-blue); }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--soft { background: var(--tv-bg-soft); }
.section--dark { background: var(--tv-dark-bg); color: #fff; }

.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.section__head--center { flex-direction: column; align-items: center; text-align: center; }
.section__head--center .section__sub { max-width: 620px; }

.section__title { font-size: clamp(28px, 3.4vw, 34px); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.section__sub { margin-top: 14px; color: var(--tv-ink-soft); font-size: 16px; }
.section--dark .section__sub { color: #b2b5be; }

.kicker { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tv-blue); margin-bottom: 14px; }
.kicker--blue { color: #6f9bff; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--tv-blue-soft); color: var(--tv-blue);
  font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 6px; margin-bottom: 22px;
}

.link-more { display: inline-flex; align-items: center; gap: 6px; color: var(--tv-blue); font-weight: 600; font-size: 15px; white-space: nowrap; }
.link-more svg { width: 16px; height: 16px; }
.link-more:hover { color: var(--tv-blue-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 8px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background-color 200ms var(--ease), color 200ms var(--ease),
    border-color 200ms var(--ease), transform 200ms var(--ease);
}
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--tv-blue); color: #fff; }
.btn--primary:hover { background: var(--tv-blue-dark); }
.btn--ghost { background: #fff; color: var(--tv-blue); border: 1px solid var(--tv-blue); }
.btn--ghost:hover { background: var(--tv-blue-soft); }
.btn--white { background: #fff; color: var(--tv-ink); }
.btn--white:hover { background: #eef1f7; }

/* ============================================================
   Top navigation
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}
.nav.is-scrolled { box-shadow: var(--shadow-sm); border-bottom-color: var(--tv-line); }

.nav__inner { max-width: 1280px; height: 100%; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; }

.nav__logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; color: var(--tv-ink); flex-shrink: 0; }
.nav__logo-text { letter-spacing: -0.01em; }

.nav__menu { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav__item {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 10px; border-radius: 6px;
  font-size: 15px; font-weight: 500; color: var(--tv-ink-soft);
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.nav__item:hover { color: var(--tv-blue); background: var(--tv-blue-soft); }
.nav__item .caret { width: 14px; height: 14px; transform: rotate(90deg); }

.nav__dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 190px;
  background: #fff; border: 1px solid var(--tv-line); border-radius: 10px;
  box-shadow: var(--shadow-md); padding: 8px;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 180ms;
}
.nav__dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; font-size: 14px; color: var(--tv-ink-soft); }
.nav__dropdown a svg { width: 17px; height: 17px; color: var(--tv-blue); }
.nav__dropdown a:hover { background: var(--tv-bg-soft); color: var(--tv-ink); }
.nav__item:hover .nav__dropdown,
.nav__item:focus-within .nav__dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.nav__right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav__icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 6px; color: var(--tv-ink-soft); transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.nav__icon-btn svg { width: 19px; height: 19px; }
.nav__icon-btn:hover { background: var(--tv-bg-soft); color: var(--tv-blue); }
.nav__icon-btn--globe { width: auto; padding: 0 8px; gap: 6px; font-size: 13px; font-weight: 500; }

.nav__login { padding: 8px 12px; border-radius: 6px; font-size: 15px; font-weight: 600; color: var(--tv-ink-soft); transition: color 150ms var(--ease); }
.nav__login:hover { color: var(--tv-blue); }
.nav__cta { height: 36px; padding: 0 16px; }

.nav__burger { display: none; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 6px; color: var(--tv-ink); }
.nav__burger svg { width: 22px; height: 22px; }

/* Mobile drawer */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 200; width: min(82vw, 340px);
  background: #fff; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; padding: 16px;
  transform: translateX(100%); transition: transform 240ms var(--ease);
}
.drawer.is-open { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--tv-line); }
.drawer__nav { display: flex; flex-direction: column; padding: 12px 0; }
.drawer__nav a { padding: 13px 10px; border-radius: 8px; font-size: 16px; font-weight: 500; color: var(--tv-ink); }
.drawer__nav a:hover { background: var(--tv-bg-soft); color: var(--tv-blue); }
.drawer__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.drawer__foot .btn { width: 100%; height: 44px; }

/* ============================================================
   Quote ticker
   ============================================================ */
.ticker {
  position: relative; margin-top: var(--nav-h);
  height: 40px; overflow: hidden;
  background: var(--tv-dark-bg);
  border-bottom: 1px solid var(--tv-dark-line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.ticker__track { display: inline-flex; align-items: center; height: 100%; white-space: nowrap; will-change: transform; animation: tickerScroll 40s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { display: inline-flex; align-items: center; gap: 8px; padding: 0 22px; font-size: 13.5px; color: #d1d4dc; }
.ticker__item b { color: #fff; font-weight: 600; }
.ticker__item .t-up { color: var(--tv-up); font-variant-numeric: tabular-nums; }
.ticker__item .t-down { color: var(--tv-down); font-variant-numeric: tabular-nums; }
.ticker__item + .ticker__item { border-left: 1px solid var(--tv-dark-line); }

@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: clamp(56px, 8vw, 88px) 0 clamp(48px, 6vw, 72px); background: linear-gradient(180deg, #f7f9fd 0%, #ffffff 100%); }
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(36px, 5vw, 64px); align-items: center; }

.hero__title { font-size: clamp(38px, 4.6vw, 56px); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 20px; }
.hero__sub { color: var(--tv-ink-soft); font-size: clamp(16px, 1.1vw, 18px); margin-bottom: 30px; max-width: 520px; }

.hero__search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--tv-line); border-radius: 10px; padding: 7px 7px 7px 16px; box-shadow: var(--shadow-sm); max-width: 540px; transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease); }
.hero__search:focus-within { border-color: var(--tv-blue); box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.12); }
.hero__search-icon { width: 19px; height: 19px; color: var(--tv-muted); flex-shrink: 0; }
.hero__search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 15px; color: var(--tv-ink); }
.hero__search .btn { flex-shrink: 0; }

.hero__stats { display: flex; gap: clamp(24px, 4vw, 44px); margin-top: 38px; }
.hero__stats strong { display: block; font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; color: var(--tv-ink); font-variant-numeric: tabular-nums; }
.hero__stats span { font-size: 14px; color: var(--tv-muted); }

/* Hero chart card */
.hero__chart { position: relative; }
.chart-card { background: var(--tv-dark-bg); border: 1px solid var(--tv-dark-line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-md); }
.chart-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; flex-wrap: wrap; }
.chart-card__sym { display: flex; flex-direction: column; gap: 2px; }
.chart-card__name { font-size: 13px; color: var(--tv-muted); font-weight: 600; letter-spacing: 0.02em; }
.chart-card__price { font-size: 24px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.2; }
.chart-card__chg { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-card__tf { display: flex; gap: 4px; background: var(--tv-dark-soft); padding: 3px; border-radius: 7px; }
.chart-card__tf button { padding: 4px 10px; border-radius: 5px; font-size: 12.5px; font-weight: 500; color: var(--tv-muted); transition: all 150ms var(--ease); }
.chart-card__tf button.active { background: #2a2e39; color: #fff; }
.chart-card__tf button:hover:not(.active) { color: #d1d4dc; }
#heroCanvas { width: 100%; height: 280px; display: block; }

/* ============================================================
   Market data
   ============================================================ */
.markets__tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--tv-line); padding-bottom: 0; }
.mtab { position: relative; padding: 10px 18px; font-size: 15px; font-weight: 600; color: var(--tv-muted); border-radius: 8px 8px 0 0; transition: color 160ms var(--ease); }
.mtab:hover { color: var(--tv-ink); }
.mtab.active { color: var(--tv-blue); }
.mtab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--tv-blue); border-radius: 2px; }

.markets__panels { position: relative; }
.mgrid { display: none; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mgrid.active { display: grid; animation: fadeUp 280ms var(--ease); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.qrow {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--tv-line); border-radius: 10px; padding: 16px 18px;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}
.qrow:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #cfd5e3; }
.qrow__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qrow__main strong { font-size: 15px; font-weight: 600; }
.qrow__main span { font-size: 12.5px; color: var(--tv-muted); }
.qrow__val { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.qrow__pct { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 62px; text-align: right; }

/* ============================================================
   Core feature cards
   ============================================================ */
.features__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.fcard {
  background: #fff; border: 1px solid var(--tv-line); border-radius: var(--radius);
  padding: 28px 24px; transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
.fcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.fcard__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 10px;
  background: var(--tv-blue-soft); color: var(--tv-blue); margin-bottom: 18px;
}
.fcard__icon svg { width: 24px; height: 24px; }
.fcard h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.fcard p { font-size: 14.5px; color: var(--tv-ink-soft); line-height: 1.6; }

/* ============================================================
   Dark spotlight
   ============================================================ */
.spotlight__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(36px, 5vw, 64px); align-items: center; }
.spotlight__grid--rev { direction: ltr; }
.spotlight__list { margin: 26px 0 30px; display: flex; flex-direction: column; gap: 14px; }
.spotlight__list li { display: flex; align-items: center; gap: 12px; font-size: 15.5px; color: #d1d4dc; }
.spotlight__list li svg { width: 20px; height: 20px; color: var(--tv-up); flex-shrink: 0; }

.terminal { background: var(--tv-dark-soft); border: 1px solid var(--tv-dark-line); border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4); }
.terminal__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--tv-dark-line); }
.terminal__bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a3f4c; }
.terminal__bar span:nth-child(1) { background: #ff5f57; }
.terminal__bar span:nth-child(2) { background: #febc2e; }
.terminal__bar span:nth-child(3) { background: #28c840; }
.terminal__bar em { margin-left: 10px; font-size: 12.5px; color: var(--tv-muted); font-style: normal; }
#bigCanvas { width: 100%; height: 340px; display: block; }

/* ============================================================
   Product matrix
   ============================================================ */
.products__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.pcard { text-align: center; padding: 32px 22px; border: 1px solid var(--tv-line); border-radius: var(--radius); transition: transform 200ms var(--ease), box-shadow 200ms var(--ease); }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pcard__icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 14px; background: var(--tv-blue-soft); color: var(--tv-blue); margin-bottom: 16px; }
.pcard__icon svg { width: 28px; height: 28px; }
.pcard h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.pcard p { font-size: 14px; color: var(--tv-ink-soft); }

/* ============================================================
   Community idea card
   ============================================================ */
.idea-card { background: #fff; border: 1px solid var(--tv-line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-md); }
.idea-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--tv-blue); color: #fff; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.idea-card__head strong { display: block; font-size: 15px; font-weight: 700; }
.verified { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--tv-muted); font-style: normal; }
.verified svg { width: 13px; height: 13px; color: var(--tv-blue); }
.idea-card__text { font-size: 15px; color: var(--tv-ink-soft); line-height: 1.65; margin-bottom: 16px; }
.idea-card__tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tag { background: var(--tv-blue-soft); color: var(--tv-blue); font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 6px; }
.tag--up { background: rgba(38, 166, 154, 0.12); color: var(--tv-up); }
.idea-card__foot { display: flex; gap: 20px; padding-top: 16px; border-top: 1px solid var(--tv-line); }
.idea-card__foot span { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--tv-muted); }
.idea-card__foot svg { width: 16px; height: 16px; }

/* ============================================================
   Economic calendar
   ============================================================ */
.cal-table { border: 1px solid var(--tv-line); border-radius: var(--radius); overflow: hidden; }
.cal-row { display: grid; grid-template-columns: 1fr 0.7fr 2.2fr 1fr 0.8fr 0.8fr; align-items: center; gap: 12px; padding: 16px 20px; font-size: 14.5px; }
.cal-row + .cal-row { border-top: 1px solid var(--tv-line); }
.cal-row:not(.cal-row--head):hover { background: var(--tv-bg-soft); }
.cal-row--head { background: var(--tv-bg-soft); font-size: 13px; font-weight: 600; color: var(--tv-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.cal-row > span:first-child { font-variant-numeric: tabular-nums; color: var(--tv-ink-soft); }
.cur { font-weight: 700; font-size: 13px; color: var(--tv-blue); }
.ev { font-weight: 500; }
.imp { display: inline-flex; gap: 4px; }
.imp i { width: 14px; height: 14px; border-radius: 3px; background: var(--tv-line); display: block; }
.imp .b2 { background: #ffb74d; }
.imp .b3 { background: var(--tv-down); }
.cal-row > span:nth-child(5) { font-variant-numeric: tabular-nums; color: var(--tv-muted); }
.cal-row > span:nth-child(6) { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================
   Exchanges wall
   ============================================================ */
.exchanges__title { text-align: center; font-size: 15px; color: var(--tv-muted); margin-bottom: 32px; }
.exchanges__wall { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.exchanges__wall span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 118px; padding: 14px 22px; background: #fff; border: 1px solid var(--tv-line);
  border-radius: 10px; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; color: var(--tv-ink-soft);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), color 180ms var(--ease);
}
.exchanges__wall span:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--tv-blue); }

/* ============================================================
   Pricing
   ============================================================ */
.pricing__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--tv-line); border-radius: var(--radius); padding: 30px 26px; transition: transform 200ms var(--ease), box-shadow 200ms var(--ease); }
.plan:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.plan--featured { border: 2px solid var(--tv-blue); box-shadow: 0 12px 32px rgba(41, 98, 255, 0.14); }
.plan__ribbon { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--tv-blue); color: #fff; font-size: 12.5px; font-weight: 600; padding: 4px 14px; border-radius: 20px; white-space: nowrap; }
.plan h3 { font-size: 19px; font-weight: 700; }
.plan__price { margin: 14px 0 4px; display: flex; align-items: baseline; gap: 4px; }
.plan__price strong { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.plan__price span { color: var(--tv-muted); font-size: 14px; }
.plan__desc { font-size: 14px; color: var(--tv-muted); margin-bottom: 22px; }
.plan ul { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; flex: 1; }
.plan ul li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--tv-ink-soft); }
.plan ul li svg { width: 18px; height: 18px; color: var(--tv-up); flex-shrink: 0; }
.plan__btn { width: 100%; height: 44px; }

/* ============================================================
   CTA
   ============================================================ */
.cta__inner { text-align: center; }
.cta__inner h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 14px; }
.cta__inner p { color: #b2b5be; font-size: 17px; margin-bottom: 30px; }

/* ============================================================
   Footer
   ============================================================ */
.footer { background: var(--tv-dark-bg); color: #b2b5be; padding: 64px 0 32px; }
.footer__grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; padding-bottom: 40px; border-bottom: 1px solid var(--tv-dark-line); }
.footer__brand .nav__logo { color: #fff; margin-bottom: 16px; }
.footer__tag { font-size: 14px; margin-bottom: 20px; max-width: 240px; }
.footer__social { display: flex; gap: 10px; }
.footer__social span { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: var(--tv-dark-soft); color: #b2b5be; transition: color 160ms var(--ease), background 160ms var(--ease); }
.footer__social span:hover { color: #fff; background: var(--tv-blue); }
.footer__social svg { width: 18px; height: 18px; }
.footer__col h4 { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 16px; }
.footer__col a { display: block; font-size: 14px; padding: 5px 0; color: #9598a1; transition: color 150ms var(--ease); }
.footer__col a:hover { color: var(--tv-blue); }
.footer__bottom { padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__bottom p { font-size: 13px; color: #787b86; }
.footer__risk { color: #6a6d78; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; gap: 44px; }
  .hero__chart { max-width: 600px; }
  .spotlight__grid,
  .spotlight__grid--rev { grid-template-columns: 1fr; gap: 40px; }
  .products__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .features__grid { grid-template-columns: repeat(2, 1fr); }
  .mgrid { grid-template-columns: repeat(2, 1fr); }
  .pricing__grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; width: 100%; }
}

@media (max-width: 768px) {
  .nav__menu,
  .nav__login,
  .nav__cta,
  .nav__icon-btn--globe { display: none; }
  .nav__burger { display: inline-flex; }
  .section__head { flex-direction: column; align-items: flex-start; }
  .features__grid { grid-template-columns: 1fr; }
  .mgrid { grid-template-columns: 1fr; }
  .products__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .hero__stats { flex-wrap: wrap; gap: 20px; }
  .hero__search { flex-wrap: wrap; }
  .hero__search input { min-width: 140px; }
  .cal-table { overflow-x: auto; }
  .cal-row { grid-template-columns: repeat(6, minmax(90px, auto)); min-width: 560px; }
  #bigCanvas { height: 260px; }
  #heroCanvas { height: 240px; }
}

/* ============================================================
   Interactive components: modals, toasts, popover, likes, rows
   ============================================================ */

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.2s;
}
.modal.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(19, 23, 34, 0.5);
  backdrop-filter: blur(2px);
}
.modal__dialog {
  position: relative;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(19, 23, 34, 0.22);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal.is-open .modal__dialog { transform: translateY(0) scale(1); }
.modal__dialog--sm { max-width: 420px; }
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--tv-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal__close svg { width: 20px; height: 20px; }
.modal__close:hover { background: var(--tv-bg-soft); color: var(--tv-ink); }
.modal__title { font-size: 22px; font-weight: 700; color: var(--tv-ink); margin-bottom: 6px; }
.modal__sub { font-size: 14px; color: var(--tv-ink-soft); margin-bottom: 18px; line-height: 1.5; }

/* ---------- Auth tabs ---------- */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--tv-bg-soft);
  border-radius: 9px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  height: 34px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--tv-ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.auth-tab.is-active {
  background: #fff;
  color: var(--tv-ink);
  box-shadow: 0 1px 3px rgba(19, 23, 34, 0.12);
}

/* ---------- Form fields ---------- */
.auth-pane { display: none; }
.auth-pane.is-active { display: block; }
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--tv-ink);
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--tv-line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--tv-ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--tv-blue);
  box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.14);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--tv-ink-soft);
  margin-bottom: 16px;
  cursor: pointer;
}
.check input { margin-top: 2px; accent-color: var(--tv-blue); }
.auth-submit { width: 100%; margin-top: 2px; }
.form-error {
  display: none;
  margin-top: 10px;
  font-size: 13px;
  color: var(--tv-down);
  line-height: 1.45;
}
.link-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--tv-blue);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--tv-muted);
  font-size: 12px;
}
.divider::before,
.divider::after { content: ""; flex: 1; height: 1px; background: var(--tv-line); }
.social-row { display: flex; gap: 10px; }
.social-btn {
  flex: 1;
  height: 40px;
  border: 1px solid var(--tv-line);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--tv-ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.social-btn:hover { background: var(--tv-bg-soft); border-color: #c7ccd8; }

/* ---------- Event modal ---------- */
.event-desc { font-size: 14px; color: var(--tv-ink-soft); line-height: 1.6; margin-bottom: 18px; }
.event-values { display: flex; gap: 12px; margin-bottom: 20px; }
.event-values > div {
  flex: 1;
  background: var(--tv-bg-soft);
  border-radius: 10px;
  padding: 12px 14px;
}
.event-values span { display: block; font-size: 12px; color: var(--tv-muted); margin-bottom: 4px; }
.event-values strong { font-size: 18px; color: var(--tv-ink); font-variant-numeric: tabular-nums; }
.event-values strong.up { color: var(--tv-up); }
.event-values strong.down { color: var(--tv-down); }

/* ---------- Toast stack ---------- */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 10px;
  background: var(--tv-ink);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(19, 23, 34, 0.28);
  cursor: pointer;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.is-show { opacity: 1; transform: translateX(0); }
.toast--success { background: #1f7a6d; }
.toast--error { background: #c1443f; }

/* ---------- Language popover ---------- */
.nav__icon-btn { position: relative; }
.popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--tv-line);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(19, 23, 34, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
  z-index: 900;
}
.nav__icon-btn.is-open .popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.popover__item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 14px;
  color: var(--tv-ink);
  cursor: pointer;
  transition: background 0.15s ease;
}
.popover__item:hover { background: var(--tv-bg-soft); }
.popover__item.is-active { color: var(--tv-blue); font-weight: 600; }

/* ---------- Clickable quote & calendar rows ---------- */
.qrow { cursor: pointer; transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.qrow:hover { background: var(--tv-bg-soft); box-shadow: inset 2px 0 0 var(--tv-blue); }
.qrow:active { transform: scale(0.995); }

.cal-row:not(.cal-row--head) { cursor: pointer; transition: background 0.15s ease; }
.cal-row:not(.cal-row--head):hover { background: var(--tv-bg-soft); }

.ticker__item { cursor: pointer; transition: opacity 0.15s ease; }
.ticker__item:hover { opacity: 0.72; }

/* ---------- Like button ---------- */
.idea-stat { display: inline-flex; align-items: center; gap: 5px; color: var(--tv-muted); font-size: 13px; }
.idea-stat svg { width: 16px; height: 16px; }
.idea-like {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: var(--tv-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 7px;
  transition: color 0.15s ease, background 0.15s ease;
}
.idea-like svg { width: 16px; height: 16px; }
.idea-like:hover { background: rgba(239, 83, 80, 0.1); color: var(--tv-down); }
.idea-like.is-liked { color: var(--tv-down); }
.idea-like.is-liked svg use { } /* color inherits from parent */

@media (max-width: 768px) {
  .toast-stack { right: 16px; bottom: 16px; left: 16px; max-width: none; }
  .modal { padding: 14px; }
  .modal__dialog { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}


