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

:root {
  /* Light theme */
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6c757d;
  --border: #e2e8f0;
  --accent: #f7931a;
  --accent-hover: #e8850f;
  --accent-light: rgba(247, 147, 26, 0.1);
  --success: #22c55e;
  --danger: #ef4444;
  --info: #3b82f6;
  --sidebar-bg: #f1f5f9;
  --nav-bg: #1a1a2e;
  --nav-text: #ffffff;
  --gauge-bg: #e2e8f0;
  --bar-positive: #22c55e;
  --bar-negative: #ef4444;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --border: #334155;
  --accent-light: rgba(247, 147, 26, 0.15);
  --sidebar-bg: #1e293b;
  --nav-bg: #0b1120;
  --gauge-bg: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

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

/* ===== Top Navigation ===== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--nav-text);
  text-decoration: none;
}

.nav-brand .btc-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem; color: #fff;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: rgba(255,255,255,0.7);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}

.nav-links a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-links a.active {
  background: rgba(247, 147, 26, 0.2);
  color: var(--accent);
}

.nav-links .nav-en {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  margin-left: 2px;
}

.nav-links a.active .nav-en {
  color: rgba(247, 147, 26, 0.6);
}

.nav-updated {
  color: rgba(255,255,255,0.55);
  font-size: 0.78rem;
  padding: 0 12px;
  white-space: nowrap;
}

.data-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  font-size: 0.9rem;
}
.data-alert-partial {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  color: var(--text);
}
.data-alert-all {
  border-left-color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  color: var(--text);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.no-data {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-style: italic;
}
.no-data::before {
  content: "—";
  margin-right: 6px;
  opacity: 0.6;
}

.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, var(--gauge-bg) 25%, var(--bg-secondary) 50%, var(--gauge-bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
  border-radius: 4px;
  min-height: 1em;
  min-width: 60px;
  vertical-align: middle;
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.theme-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--nav-text);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  margin-left: 8px;
}

.theme-toggle:hover { background: rgba(255,255,255,0.1); }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--nav-text);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .has-sidebar .nav-hamburger { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    padding: 12px 16px;
    gap: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; }
}

/* ===== Left Sidebar (pages with has-sidebar class) ===== */
:root {
  --sidenav-width: 230px;
}

.sidenav {
  display: none; /* hidden by default, shown only on .has-sidebar */
}

.has-sidebar .sidenav {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: var(--sidenav-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  z-index: 90;
  overflow-y: auto;
}

.sidenav-links {
  flex: 1;
  padding: 20px 16px;
  overflow-y: auto;
}

.sidenav-group {
  margin-bottom: 8px;
}

.sidenav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 8px;
  border: none;
  background: none;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: color 0.15s;
}

.sidenav-toggle:hover {
  color: var(--accent);
}

.sidenav-link {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 8px;
  margin-bottom: 4px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.sidenav-link:hover {
  color: var(--text);
}

.sidenav-link.active {
  color: var(--accent);
  font-weight: 600;
}

.sidenav-group.open > .sidenav-toggle {
  color: var(--text);
}

.sidenav-arrow {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.sidenav-group.open > .sidenav-toggle .sidenav-arrow {
  transform: rotate(45deg);
}

.sidenav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.sidenav-group.open > .sidenav-submenu {
  max-height: 500px;
}

.sidenav-item {
  display: flex;
  align-items: center;
  padding: 9px 8px 9px 20px;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.sidenav-item:hover {
  color: var(--text);
}

.sidenav-item.active {
  color: var(--accent);
  font-weight: 600;
}

.sidenav-section-label {
  padding: 10px 8px 4px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

/* ===== Main Content offset when sidebar present ===== */
.has-sidebar .main-content {
  margin-left: var(--sidenav-width);
  min-height: calc(100vh - 56px);
}

/* ===== Sidebar Overlay (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 80;
}

/* ===== Mobile: sidebar dropdown ===== */
@media (max-width: 768px) {
  .has-sidebar .sidenav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: max-height 0.3s ease;
    z-index: 100;
  }
  .has-sidebar .sidenav.open {
    max-height: 80vh;
    overflow-y: auto;
  }
  .sidebar-overlay.open {
    display: block;
  }
  .has-sidebar .main-content {
    margin-left: 0;
  }
}

/* ===== Page Container ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== Layout: Full Width ===== */
.full-width {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ===== Layout: Document (global sidenav handles section navigation) ===== */
.doc-layout {
  max-width: 900px;
  margin: 0 auto;
  min-height: calc(100vh - 80px);
}

.doc-content {
  flex: 1;
  padding: 40px 24px;
  min-width: 0;
}

/* ===== Section Title ===== */
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

.section-divider {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  padding-left: 0;
  margin: 40px 0 20px;
  display: block;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-clickable:hover {
  transform: translateY(-2px);
  cursor: pointer;
}

.card-grid {
  display: grid;
  gap: 16px;
}

.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .card-grid-2, .card-grid-3, .card-grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.card-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.card-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.card-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== Dual Currency Display ===== */
.price-sub {
  font-size: 0.78em;
  color: var(--text-secondary);
  font-weight: 400;
}

td .price-sub, .stat-value .price-sub {
  display: block;
  margin-top: 1px;
}

.card-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent);
}

/* ===== Stats Row ===== */
.stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  flex: 1;
  min-width: 140px;
  text-align: center;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== Progress Bar ===== */
.progress-bar {
  background: var(--gauge-bg);
  border-radius: 20px;
  height: 20px;
  overflow: hidden;
  position: relative;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f59e0b);
  border-radius: 20px;
  transition: width 1s ease;
  position: relative;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ===== Gauge ===== */
.gauge-container {
  text-align: center;
  padding: 16px 0;
}

.gauge {
  width: 200px;
  height: 110px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.gauge-bg, .gauge-fill {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 18px solid var(--gauge-bg);
  position: absolute;
  top: 0;
  border-bottom-color: transparent;
  border-left-color: transparent;
  transform: rotate(-45deg);
}

.gauge-fill {
  border-color: transparent;
  border-top-color: var(--success);
  border-right-color: var(--success);
  transition: transform 1s ease;
}

.gauge-value {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 8px;
}

.gauge-label-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--success);
  padding: 4px 12px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 20px;
  display: inline-block;
  margin-top: 4px;
}

/* ===== Table ===== */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .data-table {
    min-width: 480px;
  }
  .data-table thead th,
  .data-table tbody td {
    padding: 8px 10px;
    font-size: 0.78rem;
  }
}

.data-table thead th {
  background: var(--bg-secondary);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.data-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover { background: var(--accent-light); }

/* ===== Horizontal Bar Chart ===== */
.h-bar {
  margin: 6px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}

.h-bar-label {
  width: 100px;
  text-align: right;
  font-weight: 500;
  flex-shrink: 0;
}

.h-bar-track {
  flex: 1;
  background: var(--gauge-bg);
  border-radius: 6px;
  height: 22px;
  overflow: hidden;
}

.h-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s ease;
}

.h-bar-value {
  width: 60px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ===== Chart Placeholder ===== */
.chart-placeholder {
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.chart-canvas {
  width: 100%;
  height: 250px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-light); }

/* Outline button on dark backgrounds (e.g. hero) */
.btn-on-dark {
  color: #fff;
  border-color: rgba(255,255,255,0.45);
}
.btn-on-dark:hover {
  background: rgba(255,255,255,0.12);
  border-color: #fff;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tab.active, .btn-tab:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 60px 24px 48px;
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--bg) 100%);
  color: var(--nav-text);
}

.hero .btc-logo {
  font-size: 4rem;
  width: 80px; height: 80px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-weight: 900; color: #fff;
  box-shadow: 0 0 40px rgba(247, 147, 26, 0.3);
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.8;
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero .price-ticker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: rgba(255,255,255,0.08);
  border-radius: 30px;
  font-size: 1rem;
  margin-top: 24px;
}

.entry-cards {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.entry-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 36px;
  min-width: 180px;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
}

.entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  color: var(--text);
}

.entry-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.entry-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

[data-theme="dark"] .hero {
  background: linear-gradient(180deg, #0b1120 0%, var(--bg) 100%);
}

/* ===== Feature Grid (Landing) ===== */
.feature-card {
  padding: 24px;
  cursor: pointer;
}

.feature-card .card-icon { font-size: 1.8rem; }
.feature-card h3 { font-size: 1rem; font-weight: 600; margin: 8px 0 6px; }
.feature-card p { font-size: 0.85rem; color: var(--text-secondary); }

.feature-card .feature-stat {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

/* ===== Info Box ===== */
.info-box {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
}

.info-box h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .info-grid { grid-template-columns: 1fr; }
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.info-item .icon { font-size: 1.2rem; }
.info-item h5 { font-size: 0.9rem; font-weight: 600; }
.info-item p { font-size: 0.82rem; color: var(--text-secondary); }

/* ===== Key-Value Table ===== */
.kv-table {
  width: 100%;
}

.kv-table tr { border-bottom: 1px solid var(--border); }
.kv-table td {
  padding: 10px 0;
  font-size: 0.9rem;
}
.kv-table td:first-child {
  color: var(--text-secondary);
  width: 40%;
}
.kv-table td:last-child { font-weight: 600; }

/* ===== Flow Diagram ===== */
.flow-diagram {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.flow-arrow {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.2rem;
}

/* ===== Prev/Next Navigation ===== */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  margin-top: 40px;
  border-top: 1px solid var(--border);
}

.page-progress {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.page-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.page-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.footer p { margin: 4px 0; }

/* ===== Form Controls ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.radio-group {
  display: flex;
  gap: 16px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.radio-group input[type="radio"] { accent-color: var(--accent); }

/* ===== Toggle Button Group ===== */
.btn-toggle-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.btn-toggle {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-toggle:last-child { border-right: none; }
.btn-toggle:hover { background: var(--bg-hover); }
.btn-toggle.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.btn-row {
  display: flex;
  gap: 8px;
}
.btn-row .btn { flex: 1; }
.btn-row .btn.btn-outline {
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-row .btn.btn-outline:hover {
  color: var(--text);
  border-color: var(--text-secondary);
  background: var(--bg-secondary);
}

/* ===== Range Slider ===== */
.range-slider {
  width: 100%;
  margin: 12px 0;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--gauge-bg);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(247, 147, 26, 0.3);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ===== Color Helpers ===== */
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-orange { color: var(--accent); }
.text-blue { color: var(--info); }
.text-muted { color: var(--text-secondary); }
.fw-bold { font-weight: 700; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* ===== Ticker Strip ===== */
.ticker-strip {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 12px 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.ticker-strip span { white-space: nowrap; }

/* ===== Dashboard Specific ===== */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.dashboard-header .price { font-size: 1.5rem; font-weight: 700; }
.dashboard-header .separator { color: var(--border); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ===== Comparison Table ===== */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.comparison-table th, .comparison-table td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.comparison-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ===== Animation ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
}

.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.2s; }
.animate-in:nth-child(4) { animation-delay: 0.3s; }

/* ===== Macro indicator card ===== */
.macro-card {
  text-align: center;
}

.macro-card .trend-arrow {
  font-size: 1.2rem;
  margin-top: 4px;
}

/* ===== Fear Greed Meter ===== */
.fear-greed-bar {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #ef4444, #f97316, #eab308, #84cc16, #22c55e);
  position: relative;
  margin: 16px 0 8px;
}

.fear-greed-marker {
  width: 4px;
  height: 20px;
  background: var(--text);
  border-radius: 2px;
  position: absolute;
  top: -4px;
  transition: left 1s ease;
}

.fear-greed-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ===== Technical Chart (Overview) ===== */
.tech-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.tech-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
}

/* RSI Gauge */
.rsi-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.rsi-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.rsi-value {
  font-size: 1.05rem;
  font-weight: 600;
}

.rsi-gauge {
  position: relative;
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
}

.rsi-zone {
  height: 100%;
}

.rsi-oversold  { width: 30%; background: rgba(34,197,94,0.55); }
.rsi-neutral   { width: 40%; background: rgba(148,163,184,0.35); }
.rsi-overbought{ width: 30%; background: rgba(239,68,68,0.55); }

.rsi-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 20px;
  background: var(--text);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.6s ease;
}

.rsi-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ===== Investment Calculator Result Highlight ===== */
.result-highlight {
  background: linear-gradient(135deg, var(--accent-light), transparent);
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
}

/* ===== Help tooltip ===== */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--text-secondary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  font-style: normal;
  cursor: help;
  position: relative;
  vertical-align: middle;
  line-height: 1;
}

.help-tip::before {
  content: "?";
}

.help-tip:hover::after,
.help-tip:focus::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: normal;
  width: max-content;
  max-width: 240px;
  text-align: left;
  line-height: 1.4;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.help-tip:hover {
  background: var(--accent);
}
