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

:root {
  --bg-primary:       #0d1117;
  --bg-secondary:     #161b22;
  --bg-tertiary:      #21262d;
  --bg-hover:         #1c2128;
  --border:           #30363d;
  --border-subtle:    #21262d;
  --text-primary:     #e6edf3;
  --text-secondary:   #8b949e;
  --text-muted:       #484f58;
  --accent:           #58a6ff;
  --accent-hover:     #79b8ff;
  --positive:         #3fb950;
  --negative:         #f85149;
  --positive-bg:      rgba(63, 185, 80, 0.1);
  --negative-bg:      rgba(248, 81, 73, 0.1);
  --positive-border:  rgba(63, 185, 80, 0.25);
  --negative-border:  rgba(248, 81, 73, 0.25);
  --neutral:          #8b949e;
  --neutral-bg:       rgba(139, 148, 158, 0.08);
  --warning:          #e3b341;
  --shadow-sm:        0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:        0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:        0 8px 24px rgba(0,0,0,0.5);
  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        14px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ===== Layout ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.main {
  flex: 1;
  padding: 28px 0 56px;
}

/* ===== Ticker Strip (marquee) ===== */
.ticker-strip {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
}

.ticker-inner {
  display: flex;
  gap: 0;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
}

.ticker-strip:hover .ticker-inner {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  font-size: 0.78rem;
  border-right: 1px solid var(--border);
}

.ticker-symbol {
  font-weight: 600;
  color: var(--text-primary);
}

.ticker-price {
  color: var(--text-secondary);
}

.ticker-change-up   { color: var(--positive); font-weight: 500; }
.ticker-change-down { color: var(--negative); font-weight: 500; }

/* ===== Header ===== */
.header {
  background: rgba(13, 17, 23, 0.9);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}


.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #f7931a, #ffb347);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  box-shadow: 0 2px 8px rgba(247,147,26,0.4);
}

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

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.15s;
  font-weight: 500;
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-rate {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.header-rate strong {
  color: var(--warning);
  font-weight: 600;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
  transform-origin: center;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav dropdown */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 8px 0;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav-link {
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.mobile-nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.mobile-nav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(88, 166, 255, 0.06);
}

/* Live indicator */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--positive);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--positive);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--positive);
  opacity: 0.3;
  animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

.meta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 5px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.meta-badge strong {
  color: var(--accent);
  font-weight: 600;
}

/* Refresh countdown */
.refresh-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.refresh-progress {
  width: 80px;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.refresh-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 1s linear;
}

/* ===== Table ===== */
.table-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.table-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.coin-count-badge {
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 20px;
  padding: 1px 8px;
  font-weight: 600;
}

.coin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.coin-table thead {
  background: var(--bg-primary);
}

.coin-table th {
  padding: 10px 16px;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  cursor: default;
  user-select: none;
}

.th-rank, .th-coin { text-align: left; }

.coin-table td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.td-rank, .td-coin { text-align: left; }

.coin-row:last-child td { border-bottom: none; }

.coin-row {
  transition: background 0.1s;
}

.coin-row:hover {
  background: var(--bg-hover);
}

/* Flash animation for data updates */
@keyframes flash-update {
  0%   { background: rgba(88,166,255,0.08); }
  100% { background: transparent; }
}

.coin-row.updated {
  animation: flash-update 0.6s ease-out;
}

.td-rank {
  color: var(--text-muted);
  font-size: 0.78rem;
  width: 40px;
  font-weight: 500;
}

/* Coin Info */
.coin-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coin-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.coin-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.coin-icon-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  border-radius: 50%;
}

/* Coin icon colors */
.coin-icon-btc   { background: #f7931a18; }
.coin-icon-btc   .coin-icon-fallback { background: #f7931a18; color: #f7931a; }
.coin-icon-eth   { background: #627eea18; }
.coin-icon-eth   .coin-icon-fallback { background: #627eea18; color: #627eea; }
.coin-icon-xrp   { background: #00aae418; }
.coin-icon-xrp   .coin-icon-fallback { background: #00aae418; color: #00aae4; }
.coin-icon-sol   { background: #9945ff18; }
.coin-icon-sol   .coin-icon-fallback { background: #9945ff18; color: #9945ff; }
.coin-icon-doge  { background: #c2a63318; }
.coin-icon-doge  .coin-icon-fallback { background: #c2a63318; color: #c2a633; }
.coin-icon-ada   { background: #0033ad18; }
.coin-icon-ada   .coin-icon-fallback { background: #0033ad18; color: #4d7eff; }
.coin-icon-avax  { background: #e8414218; }
.coin-icon-avax  .coin-icon-fallback { background: #e8414218; color: #e84142; }
.coin-icon-dot   { background: #e6007a18; }
.coin-icon-dot   .coin-icon-fallback { background: #e6007a18; color: #e6007a; }
.coin-icon-link  { background: #2a5ada18; }
.coin-icon-link  .coin-icon-fallback { background: #2a5ada18; color: #2a5ada; }
.coin-icon-matic { background: #8247e518; }
.coin-icon-matic .coin-icon-fallback { background: #8247e518; color: #8247e5; }
.coin-icon-ltc   { background: #bfbbbb18; }
.coin-icon-ltc   .coin-icon-fallback { background: #bfbbbb18; color: #bfbbbb; }
.coin-icon-trx   { background: #ef002718; }
.coin-icon-trx   .coin-icon-fallback { background: #ef002718; color: #ef0027; }
.coin-icon-atom  { background: #2e314818; }
.coin-icon-atom  .coin-icon-fallback { background: #2e314818; color: #9496b5; }
.coin-icon-uni   { background: #ff007a18; }
.coin-icon-uni   .coin-icon-fallback { background: #ff007a18; color: #ff007a; }
.coin-icon-bch   { background: #8dc35118; }
.coin-icon-bch   .coin-icon-fallback { background: #8dc35118; color: #8dc351; }
.coin-icon-etc   { background: #32833218; }
.coin-icon-etc   .coin-icon-fallback { background: #32833218; color: #5fa55f; }
.coin-icon-near  { background: #00c1de18; }
.coin-icon-near  .coin-icon-fallback { background: #00c1de18; color: #00c1de; }
.coin-icon-apt   { background: #00c4a818; }
.coin-icon-apt   .coin-icon-fallback { background: #00c4a818; color: #00c4a8; }
.coin-icon-op    { background: #ff042018; }
.coin-icon-op    .coin-icon-fallback { background: #ff042018; color: #ff0420; }
.coin-icon-arb   { background: #28a0f018; }
.coin-icon-arb   .coin-icon-fallback { background: #28a0f018; color: #28a0f0; }
.coin-icon-sui   { background: #6fbcf018; }
.coin-icon-sui   .coin-icon-fallback { background: #6fbcf018; color: #6fbcf0; }
.coin-icon-ton   { background: #0088cc18; }
.coin-icon-ton   .coin-icon-fallback { background: #0088cc18; color: #0088cc; }
.coin-icon-hbar  { background: #22222218; }
.coin-icon-hbar  .coin-icon-fallback { background: #22222218; color: #8b949e; }
.coin-icon-fil   { background: #0090ff18; }
.coin-icon-fil   .coin-icon-fallback { background: #0090ff18; color: #0090ff; }
.coin-icon-algo  { background: #00000018; }
.coin-icon-algo  .coin-icon-fallback { background: #00000018; color: #e6edf3; }

.coin-names {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.coin-symbol {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.coin-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* Prices */
.price-krw {
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.price-krw small {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 2px;
  font-weight: 400;
}

.price-usdt {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.price-krw-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ===== Chart Panel ===== */
.chart-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

.chart-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.chart-coin-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-coin-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.chart-exchange-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 3px;
}

.chart-tab {
  padding: 5px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s;
}

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

.chart-container {
  height: 420px;
  background: #131722;
}

.chart-container > div {
  width: 100% !important;
  height: 100% !important;
}

.coin-row {
  cursor: pointer;
}

.coin-row.row-selected {
  background: rgba(88, 166, 255, 0.07) !important;
  outline: 1px solid rgba(88, 166, 255, 0.25);
  outline-offset: -1px;
}

/* ===== Load More ===== */
.row-hidden  { display: none; }
.card-hidden { display: none; }

.load-more-wrapper {
  display: flex;
  justify-content: center;
  padding: 20px 0 8px;
}

.load-more-btn {
  padding: 10px 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.load-more-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

/* Kimchi Premium Badge */
.kimp-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.kimp-positive {
  color: var(--positive);
  background: var(--positive-bg);
  border: 1px solid var(--positive-border);
}

.kimp-negative {
  color: var(--negative);
  background: var(--negative-bg);
  border: 1px solid var(--negative-border);
}

.kimp-neutral {
  color: var(--neutral);
  background: var(--neutral-bg);
  border: 1px solid var(--border);
}

/* 24h Change */
.change {
  font-weight: 600;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.change-up   { color: var(--positive); }
.change-down { color: var(--negative); }

/* Volume */
.volume {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* ===== Summary Stats Bar ===== */
.stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 160px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Info tooltip (ⓘ hover/tap) */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  outline: none;
}
.info-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
  line-height: 1;
}
.info-tip:hover .info-icon,
.info-tip:focus .info-icon {
  opacity: 1;
  color: var(--accent, #f0b90b);
}
.info-popup {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 260px;
  padding: 10px 12px;
  background: #1a1a1a;
  color: #e5e5e5;
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  pointer-events: none;
  text-align: left;
}
.info-popup::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 10px;
  border: 6px solid transparent;
  border-bottom-color: #1a1a1a;
}
.info-popup strong { color: #fff; }
.info-popup em { color: var(--text-muted, #8b8b8b); font-style: normal; font-size: 0.68rem; }
.info-tip:hover .info-popup,
.info-tip:focus .info-popup,
.info-tip:focus-within .info-popup {
  opacity: 1;
  visibility: visible;
}
@media (max-width: 768px) {
  .info-popup {
    width: 220px;
    left: auto;
    right: 0;
  }
  .info-popup::after {
    left: auto;
    right: 14px;
  }
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* 컬러풀한 stat-value (김프/신호/심리 등) */
.stat-value.change-up {
  background: linear-gradient(135deg, #0ecb81 0%, #2ee8a0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(14, 203, 129, 0.25);
}
.stat-value.change-down {
  background: linear-gradient(135deg, #f6465d 0%, #ff7a8c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(246, 70, 93, 0.25);
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* ===== Kimchi Premium Cards ===== */
.kimp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.kimp-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}

.kimp-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.card-positive::before { background: var(--positive); }
.card-negative::before { background: var(--negative); }
.card-neutral::before  { background: var(--neutral); }

.kimp-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--bg-hover);
}

.kimp-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.coin-name-small {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.kimp-value {
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kimp-detail {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.detail-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 500;
}

.detail-value {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Change indicator in card */
.card-change {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 20px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-link {
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

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

/* ===== Refresh Notice ===== */
.refresh-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.refresh-notice.refreshing {
  color: var(--accent);
  border-color: rgba(88,166,255,0.2);
}

/* Spinner */
.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.refreshing .spinner { display: block; }
.refreshing .refresh-icon { display: none; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .stats-bar .stat-card { min-width: 130px; }
}

@media (max-width: 768px) {
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .meta-bar { gap: 8px; }

  .coin-table th,
  .coin-table td { padding: 10px 12px; }

  .th-volume, .td-volume,
  .th-binance, .td-binance { display: none; }

  .price-krw { font-size: 0.85rem; }

  .kimp-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .kimp-value { font-size: 1.6rem; }

  .stats-bar { gap: 8px; }
  .stat-card { padding: 10px 14px; }
  .stat-value { font-size: 1rem; }

  .ticker-strip { display: none; }

  .header-right .header-rate { display: none; }
  .header-center { display: none; }
  .hamburger { display: flex; }
}

@media (max-width: 480px) {
  .th-rank, .td-rank { display: none; }
  .coin-table { font-size: 0.82rem; }
  .coin-icon { width: 30px; height: 30px; font-size: 0.72rem; }
  .coin-name { display: none; }
  .kimp-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { min-width: 120px; }
}

/* ── 뉴스 스트립 (코인 티커 하단, 1줄 스크롤) ── */
.news-strip {
  background: #0e1420;
  border-bottom: 1px solid var(--border);
  height: 38px;
  display: flex;
  align-items: center;
  overflow: hidden;
  gap: 0;
}

.news-strip-label {
  flex-shrink: 0;
  padding: 0 16px;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  border-right: 1px solid var(--border);
  height: 100%;
  display: flex;
  align-items: center;
  text-decoration: none;
  background: var(--accent);
  transition: background 0.15s;
  white-space: nowrap;
}

.news-strip-label:hover {
  background: var(--accent-hover);
}

.news-sentiment-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  margin: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev, #1b1b1b);
  color: var(--text, #ddd);
  white-space: nowrap;
  line-height: 1.3;
}
.news-sentiment-badge.sent-bullish {
  color: #0ecb81;
  border-color: rgba(14, 203, 129, 0.5);
  background: rgba(14, 203, 129, 0.08);
}
.news-sentiment-badge.sent-bearish {
  color: #f6465d;
  border-color: rgba(246, 70, 93, 0.5);
  background: rgba(246, 70, 93, 0.08);
}
.news-sentiment-badge.sent-neutral {
  color: var(--text-muted, #8b8b8b);
}
@media (max-width: 768px) {
  .news-sentiment-badge { display: none; }
}

.news-strip-track-wrap {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
}

.news-strip-track {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  animation: news-scroll 120s linear infinite;
}

.news-strip-track:hover {
  animation-play-state: paused;
}

@keyframes news-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.news-strip-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 32px 0 0;
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.15s;
}

.news-strip-item::before {
  content: '│';
  color: var(--border);
  margin-right: 24px;
  font-size: 0.9rem;
  opacity: 0.5;
}

.news-strip-item:hover .news-strip-title {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.3);
}

.news-strip-source {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.news-strip-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.news-strip-title {
  color: #c9d1d9;
  transition: color 0.15s;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 주요 뉴스 강조 */
.news-strip-item.news-hot .news-strip-source {
  color: var(--warning);
  background: rgba(227, 179, 65, 0.1);
  border-color: rgba(227, 179, 65, 0.3);
}

.news-strip-item.news-hot .news-strip-title {
  color: #e6edf3;
  font-weight: 500;
}

.news-strip-item.news-hot::after {
  content: '🔥';
  font-size: 0.75rem;
  margin-left: -4px;
}

.news-strip-more {
  flex-shrink: 0;
  padding: 0 16px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  border-left: 1px solid var(--border);
  height: 100%;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.news-strip-more:hover {
  color: var(--accent);
}

/* ── 뉴스 전체 페이지 (/news) ── */
.news-full-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.news-full-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 11px 20px;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}

.news-full-item:last-child {
  border-bottom: none;
}

.news-full-item:hover {
  background: var(--bg-hover);
}

.news-full-source {
  flex-shrink: 0;
  width: 88px;
  font-size: 0.69rem;
  font-weight: 700;
  border: 1px solid;
  border-radius: 4px;
  padding: 2px 0;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-align: center;
}

.news-abs-time {
  flex-shrink: 0;
  width: 46px;
  padding-left: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.news-rel-time {
  flex-shrink: 0;
  width: 62px;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}

.news-full-body {
  flex: 1;
  min-width: 0;
  padding: 0 10px 0 0;
}

.news-full-title {
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-empty-full {
  padding: 60px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* 데스크탑: meta wrapper를 투명하게 → 자식이 flex row에 직접 참여 */
.news-item-meta {
  display: contents;
}

/* 모바일: 시간+출처 한 줄 → 제목 한 줄 */
@media (max-width: 700px) {
  .news-strip-title { max-width: 220px; }

  .news-full-item {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 11px 14px;
  }

  .news-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .news-abs-time {
    width: auto;
    padding-left: 0;
    font-size: 0.73rem;
    color: var(--text-muted);
  }

  .news-full-source {
    width: auto;
    font-size: 0.66rem;
    padding: 1px 7px;
  }

  .news-full-body {
    padding: 0;
  }

  .news-rel-time { display: none; }

  .news-full-body { width: 100%; }

  .news-full-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
    line-height: 1.5;
  }
}
