/* ═══════════════════════════════════════════════════════════════
   BTC Price Now — Design System & Styles
   Dark-mode-first, Bloomberg-terminal aesthetic
   Theme toggle via .light-mode class on <body>
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables (Dark — default) ── */
:root {
  --bg-root: #0a0c10;
  --bg-surface: #0d0f14;
  --bg-elevated: #13161d;
  --bg-hover: #1a1d26;
  --bg-active: #22262f;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0ab;
  --text-muted: #5f6672;
  --green: #00e676;
  --green-dim: rgba(0, 230, 118, 0.12);
  --green-flash: rgba(0, 230, 118, 0.18);
  --red: #ff1744;
  --red-dim: rgba(255, 23, 68, 0.12);
  --red-flash: rgba(255, 23, 68, 0.18);
  --accent: #448aff;
  --accent-dim: rgba(68, 138, 255, 0.12);
  --gold: #ffd740;
  --gold-dim: rgba(255, 215, 64, 0.15);
  --border: #1e2028;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 100px;
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 40px;
  --gap-2xl: 64px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-bg: rgba(10, 12, 16, 0.82);
  --overlay-bg: rgba(0, 0, 0, 0.6);
}

/* ── Light mode (class-based toggle) ── */
body.light-mode {
  --bg-root: #f4f5f7;
  --bg-surface: #ffffff;
  --bg-elevated: #f0f1f3;
  --bg-hover: #e8e9ec;
  --bg-active: #dddee2;
  --text-primary: #1a1c20;
  --text-secondary: #5f6672;
  --text-muted: #9aa0ab;
  --border: #d8dae0;
  --green-dim: rgba(0, 200, 83, 0.10);
  --green-flash: rgba(0, 200, 83, 0.15);
  --red-dim: rgba(255, 23, 68, 0.08);
  --red-flash: rgba(255, 23, 68, 0.12);
  --accent-dim: rgba(68, 138, 255, 0.08);
  --gold-dim: rgba(255, 193, 7, 0.12);
  --header-bg: rgba(255, 255, 255, 0.82);
  --overlay-bg: rgba(0, 0, 0, 0.35);
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

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

table {
  border-collapse: collapse;
  width: 100%;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-root);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-active);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Utility ── */
.hidden {
  display: none !important;
}

.seo-fallback {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}

/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(1.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--gap-lg);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f7931a, #f2a900);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
}

.logo-accent {
  color: var(--accent);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.2s var(--ease-out);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: scale(1.1);
}

.theme-toggle svg {
  pointer-events: none;
}

.theme-icon-sun,
.theme-icon-moon {
  display: none;
}

/* Dark mode: show sun (to switch to light) */
body:not(.light-mode) .theme-icon-sun {
  display: block;
}

body.light-mode .theme-icon-moon {
  display: block;
}

/* Connection status badge */
.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-connecting {
  background: var(--accent-dim);
  color: var(--accent);
}

.status-connecting .status-dot {
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}

.status-live {
  background: var(--green-dim);
  color: var(--green);
}

.status-live .status-dot {
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

.status-error {
  background: var(--red-dim);
  color: var(--red);
}

.status-error .status-dot {
  background: var(--red);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }
}

/* ══════════════════════════════════════════════════════════════
   HERO — Big BTC Ticker
   ══════════════════════════════════════════════════════════════ */
#hero {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--gap-xl) var(--gap-lg) var(--gap-lg);
  text-align: center;
}

.hero-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--gap-sm);
}

.hero-symbol {
  color: var(--text-muted);
  font-weight: 500;
}

.hero-price {
  font-family: var(--font-mono);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  padding: var(--gap-md) var(--gap-lg);
  border-radius: var(--radius-lg);
  transition: background 0.3s ease, color 0.3s ease;
  position: relative;
}

.hero-price.flash-green {
  animation: flashGreen 400ms ease-out;
}

.hero-price.flash-red {
  animation: flashRed 400ms ease-out;
}

@keyframes flashGreen {
  0% {
    background: var(--green-flash);
    color: var(--green);
  }

  100% {
    background: transparent;
    color: var(--text-primary);
  }
}

@keyframes flashRed {
  0% {
    background: var(--red-flash);
    color: var(--red);
  }

  100% {
    background: transparent;
    color: var(--text-primary);
  }
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap-sm);
  margin-top: var(--gap-md);
}

.stat-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.stat-badge.up {
  background: var(--green-dim);
  color: var(--green);
  border-color: transparent;
}

.stat-badge.down {
  background: var(--red-dim);
  color: var(--red);
  border-color: transparent;
}

.stat-muted {
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════
   MARKET OVERVIEW
   ══════════════════════════════════════════════════════════════ */
#market-overview {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--gap-lg) var(--gap-lg);
}

.overview-inner {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg) var(--gap-xl);
}

.overview-heading {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: var(--gap-sm);
  letter-spacing: -0.01em;
}

.overview-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.overview-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   TRADINGVIEW CHART
   ══════════════════════════════════════════════════════════════ */
#chart-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--gap-lg) var(--gap-lg);
}

#tradingview-widget-container {
  width: 100%;
  height: 520px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

#tradingview-widget {
  width: 100%;
  height: 100%;
}

/* ══════════════════════════════════════════════════════════════
   PRICE ALERTS
   ══════════════════════════════════════════════════════════════ */
#alerts-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--gap-lg) var(--gap-lg);
}

.alerts-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
}

.alerts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap-md);
}

.alerts-title {
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.alerts-title svg {
  color: var(--gold);
}

.alert-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  align-items: flex-end;
}

.alert-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alert-field label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.alert-field select,
.alert-field input[type="number"] {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease;
  min-width: 140px;
}

.alert-field select:focus,
.alert-field input[type="number"]:focus {
  border-color: var(--accent);
}

.alert-field select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6672' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.alert-add-btn {
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f7931a, #f2a900);
  color: #fff;
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
}

.alert-add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

/* Active alerts list */
.alerts-list {
  margin-top: var(--gap-md);
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
}

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.84rem;
}

.alert-item-info {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  font-weight: 600;
}

.alert-item-info .alert-coin {
  color: var(--text-primary);
}

.alert-item-info .alert-condition {
  color: var(--text-muted);
  font-weight: 500;
}

.alert-item-info .alert-target {
  font-family: var(--font-mono);
  color: var(--accent);
}

.alert-remove-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.2s var(--ease-out);
}

.alert-remove-btn:hover {
  background: var(--red-dim);
  color: var(--red);
}

.alerts-empty {
  text-align: center;
  padding: var(--gap-md);
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* ══════════════════════════════════════════════════════════════
   TABLE SECTION
   ══════════════════════════════════════════════════════════════ */
#table-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--gap-lg);
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--gap-md);
  margin-bottom: var(--gap-lg);
}

.table-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.table-controls {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

.table-tabs {
  display: flex;
  gap: var(--gap-xs);
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  padding: 3px;
  border: 1px solid var(--border);
}

/* Search bar */
.crypto-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  transition: border-color 0.2s var(--ease-out);
}

.crypto-search:focus-within {
  border-color: var(--accent);
}

.crypto-search svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

#crypto-search-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--ff-sans);
  font-size: 0.82rem;
  width: 140px;
}

#crypto-search-input::placeholder {
  color: var(--text-muted);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  transition: all 0.2s var(--ease-out);
  color: var(--text-muted);
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

.tab-btn.active {
  background: var(--bg-active);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 620px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

#crypto-table th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.th-star {
  width: 42px;
}

.th-rank {
  width: 44px;
  text-align: center;
}

.th-price,
.th-change,
.th-volume,
.th-mcap {
  text-align: right;
}

#crypto-table td {
  padding: 12px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

#crypto-table tbody tr {
  transition: background 0.15s ease;
}

#crypto-table tbody tr:hover {
  background: var(--bg-hover);
}

#crypto-table tbody tr:last-child td {
  border-bottom: none;
}

.td-star {
  text-align: center;
}

.td-rank {
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.td-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.td-name img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
}

.coin-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.coin-symbol {
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-left: 6px;
}

.td-price {
  text-align: right;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.td-change {
  text-align: right;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.td-change.up {
  color: var(--green);
}

.td-change.down {
  color: var(--red);
}

.td-volume,
.td-mcap {
  text-align: right;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.star-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.2s var(--ease-out);
}

.star-btn:hover {
  background: var(--gold-dim);
  color: var(--gold);
  transform: scale(1.15);
}

.star-btn.starred {
  color: var(--gold);
  filter: drop-shadow(0 0 4px rgba(255, 215, 64, 0.35));
}

.star-btn svg {
  pointer-events: none;
}

.empty-state {
  text-align: center;
  padding: var(--gap-2xl) var(--gap-lg);
  color: var(--text-muted);
}

.empty-state svg {
  margin: 0 auto var(--gap-md);
  opacity: 0.25;
}

.empty-state p {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-sub {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: var(--gap-xs);
}

.skeleton-row td {
  position: relative;
  overflow: hidden;
}

.skeleton-bar {
  display: inline-block;
  height: 14px;
  border-radius: 4px;
  background: var(--bg-active);
  animation: shimmer 1.6s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.5;
  }
}

/* ══════════════════════════════════════════════════════════════
   MARKET GUIDE (SEO Article)
   ══════════════════════════════════════════════════════════════ */
#market-guide {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--gap-lg);
}

.guide-article {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-xl);
}

.guide-article h2 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: var(--gap-lg);
  letter-spacing: -0.02em;
}

.guide-article h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-top: var(--gap-xl);
  margin-bottom: var(--gap-sm);
}

.guide-article p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--gap-md);
}

.guide-article strong {
  color: var(--text-primary);
  font-weight: 600;
}

.guide-article ul {
  margin: 0 0 var(--gap-md) var(--gap-lg);
  padding: 0;
}

.guide-article li {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--gap-sm);
}

.guide-article li strong {
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════════
   FAQ SECTION
   ══════════════════════════════════════════════════════════════ */
#faq-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--gap-lg);
}

.faq-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: var(--gap-lg);
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--gap-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item:hover {
  border-color: var(--bg-active);
}

.faq-item[open] {
  border-color: var(--accent);
}

.faq-item summary {
  padding: var(--gap-md) var(--gap-lg);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease;
  user-select: none;
}

.faq-item summary:hover {
  background: var(--bg-hover);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform 0.2s var(--ease-out);
  flex-shrink: 0;
  margin-left: var(--gap-md);
}

.faq-item[open] summary::after {
  content: '\2212';
  color: var(--accent);
}

.faq-answer {
  padding: 0 var(--gap-lg) var(--gap-lg);
}

.faq-answer p {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.faq-answer strong {
  color: var(--text-primary);
  font-weight: 600;
}

.faq-answer code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════
   LEGAL / POLICY PAGES
   ══════════════════════════════════════════════════════════════ */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--gap-xl) var(--gap-lg) var(--gap-2xl);
}

.legal-page h1 {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: var(--gap-xs);
  letter-spacing: -0.02em;
}

.legal-updated {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: var(--gap-xl);
}

.legal-page h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-top: var(--gap-xl);
  margin-bottom: var(--gap-sm);
}

.legal-page p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--gap-md);
}

.legal-page ul {
  margin: 0 0 var(--gap-md) var(--gap-lg);
  padding: 0;
}

.legal-page li {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--gap-sm);
}

.legal-page strong {
  color: var(--text-primary);
  font-weight: 600;
}

.back-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease-out);
}

.back-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
  border-color: var(--bg-active);
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
#site-footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--gap-xl) var(--gap-lg) var(--gap-lg);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

#site-footer a {
  color: var(--text-secondary);
}

.footer-data {
  margin-bottom: var(--gap-md);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap-sm) var(--gap-lg);
  margin-bottom: var(--gap-sm);
}

.footer-links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.footer-copy {
  margin-top: var(--gap-xs);
  opacity: 0.6;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 var(--gap-md);
  }

  #hero {
    padding: var(--gap-lg) var(--gap-md) var(--gap-md);
  }

  .hero-price {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
    padding: var(--gap-sm) var(--gap-md);
  }

  .hero-stats {
    gap: 6px;
  }

  .stat-badge {
    font-size: 0.72rem;
    padding: 4px 10px;
  }

  #chart-section {
    padding: 0 var(--gap-md) var(--gap-md);
  }

  #tradingview-widget-container {
    height: 380px;
  }

  #alerts-section {
    padding: 0 var(--gap-md) var(--gap-md);
  }

  .alert-form {
    flex-direction: column;
  }

  .alert-field {
    width: 100%;
  }

  .alert-field select,
  .alert-field input[type="number"] {
    width: 100%;
  }

  #table-section {
    padding: var(--gap-md);
  }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Mobile table: allow horizontal scroll to see all columns */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #crypto-table {
    min-width: 640px;
  }

  /* Hide coin symbol on mobile to save some width */
  .coin-symbol {
    display: none;
  }

  #crypto-table th {
    padding: 8px 8px;
    font-size: 0.62rem;
  }

  #crypto-table td {
    padding: 8px 8px;
    font-size: 0.78rem;
  }

  .td-name img {
    width: 20px;
    height: 20px;
  }

  .coin-name {
    font-size: 0.78rem;
  }

  .star-btn {
    width: 26px;
    height: 26px;
  }

  #market-guide {
    padding: var(--gap-md);
  }

  .guide-article {
    padding: var(--gap-lg);
  }

  #faq-section {
    padding: var(--gap-md);
  }

  #market-overview {
    padding: 0 var(--gap-md) var(--gap-md);
  }

  .overview-inner {
    padding: var(--gap-md);
  }
}

@media (max-width: 480px) {
  .hero-price {
    font-size: clamp(1.8rem, 12vw, 2.8rem);
  }

  #tradingview-widget-container {
    height: 300px;
    border-radius: var(--radius-md);
  }

  .table-wrapper {
    border-radius: var(--radius-md);
  }
}