:root {
  --bg: #FFFFFF;
  --bg-soft: #F6F6F4;
  --ink: #121212;
  --text: #1A1A1A;
  --text-muted: #6B6D70;
  --border: #E7E7E4;
  --accent: #4338CA;
  --accent-bright: #4F46E5;
  --accent-soft: #EEEDFC;
  --good: #1F7A4C;
  --good-soft: #E4F4EA;
  --warn: #B23A2E;
  --warn-soft: #F7E3DE;
}

:root[data-theme="dark"] {
  --bg: #121316;
  --bg-soft: #1B1D22;
  --ink: #F3F3F1;
  --text: #EDEDEC;
  --text-muted: #9A9CA3;
  --border: #2C2E34;
  --accent: #8B85F5;
  --accent-bright: #A29CFF;
  --accent-soft: #26243F;
  --good: #4ADE94;
  --good-soft: #16301F;
  --warn: #F0938A;
  --warn-soft: #3A2320;
}

:root[data-theme="dark"] .pill-btn { color: var(--ink); }
:root[data-theme="dark"] .pill-btn.accent,
:root[data-theme="dark"] .nav-cta { color: #12131A; }

.theme-toggle {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; margin: 0; }

a { color: inherit; }

/* ---------- Top nav + mega menu ---------- */

.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 40;
}

/* on the homepage, let the wormhole show through behind the nav bar too */
body:has(.hero-dark) .topbar {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

body:has(.hero-dark) .topbar .logo,
body:has(.hero-dark) .topbar .nav-links > a,
body:has(.hero-dark) .topbar .nav-item > button {
  color: #fff;
}

body:has(.hero-dark) .topbar .theme-toggle,
body:has(.hero-dark) .topbar .hamburger-toggle {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* dark glass mega-menu on the homepage, so it doesn't flash a white card
   over the wormhole — every other page keeps the normal light dropdown */
body:has(.hero-dark) .mega {
  background: rgba(15, 15, 19, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

body:has(.hero-dark) .mega-col-title { color: rgba(244, 244, 245, 0.5); }
body:has(.hero-dark) .mega-link { color: #fff; }
body:has(.hero-dark) .mega-link span { color: rgba(244, 244, 245, 0.55); }
body:has(.hero-dark) .mega-icon { border-color: rgba(255, 255, 255, 0.22); color: #fff; }
body:has(.hero-dark) .mega-foot { color: #a6a0ff; border-top-color: rgba(255, 255, 255, 0.14); }

/* the mobile hamburger panel sits over the same transparent/wormhole topbar
   but is appended outside .nav-links, so the override above never reached
   it — in light theme var(--text) is near-black, unreadable over the
   always-dark hero. Force the same white treatment here too. */
body:has(.hero-dark) .mobile-panel a {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.logo::before {
  content: '✳';
  color: var(--accent);
  font-size: 16px;
}

.nav-links {
  display: flex;
  gap: 28px;
  flex: 1;
  font-size: 14.5px;
  font-weight: 600;
}

.nav-item { position: relative; }

.nav-item > button {
  background: none;
  border: none;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  padding: 8px 0;
  opacity: 0.82;
}

.nav-item > button:hover,
.nav-item.open > button,
.nav-links > a:hover {
  opacity: 1;
  color: var(--accent);
}

.nav-links > a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 0;
  display: inline-block;
  opacity: 0.82;
}

.nav-cta {
  /* removed from the top bar; markup is still present in each page until
     nav.js strips it, so hide it immediately via CSS to avoid any flash */
  display: none;
}

.nav-cta:hover { background: var(--accent); }

.mega {
  display: block;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  margin-top: 1px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  box-shadow: 0 20px 40px rgba(18, 18, 18, 0.08);
  border-radius: 0 0 16px 16px;
  padding: 28px;
  min-width: 560px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1), transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.38s;
}

.nav-item.open .mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1), transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.mega-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.mega-cols.one-col { grid-template-columns: 1fr; }
.mega.narrow { min-width: 320px; }

.mega-col-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.mega-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  padding: 8px 0;
}

.mega-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  color: var(--ink);
}

/* absolute + translate(-50%,-50%) instead of flex centering — flexbox
   centering on this element wasn't actually landing the icon in the
   middle (confirmed by the user in an incognito window, ruling out
   caching), for a reason that wasn't found by inspecting the CSS/SVG
   math alone. This technique pins the icon's own center to the circle's
   center directly via coordinates, so it can't drift regardless of
   whatever flex/inline-SVG interaction was causing the original offset. */
.mega-icon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  display: block;
}

.mega-link strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.mega-link span { display: block; font-size: 12.5px; color: var(--text-muted); }

.mega-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
}

.hamburger-toggle {
  display: none;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger-toggle svg { width: 18px; height: 18px; }

.mobile-panel {
  display: none;
  flex-direction: column;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.2s ease, padding 0.2s ease;
}

.mobile-panel a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.mobile-panel a:last-child { border-bottom: none; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .mega { display: none !important; }
  .hamburger-toggle { display: flex; margin-left: auto; }
  .mobile-panel { display: flex; }
  .mobile-panel.open { max-height: 240px; padding: 8px 24px 16px; }
}

/* ---------- Generic layout helpers ---------- */

.section { padding: 64px 24px; }
.section.soft { background: var(--bg-soft); }
.section-inner { max-width: 1180px; margin: 0 auto; }

.hairline { border: none; border-top: 1px solid var(--border); margin: 0; }

.eyebrow {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 13px 26px;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.pill-btn:hover { background: var(--accent); }

.pill-btn.outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border);
}

.pill-btn.outline:hover { border-color: var(--ink); background: var(--bg-soft); }

.pill-btn.accent { background: var(--accent); }
.pill-btn.accent:hover { background: var(--accent-bright); }

/* stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 40px;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

@media (max-width: 700px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* category card grid (homepage) */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.cat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.cat-card:hover { border-color: var(--ink); transform: translateY(-2px); }

.cat-card .mega-icon { width: 44px; height: 44px; margin-bottom: 18px; }
.cat-card .mega-icon svg { width: 20px; height: 20px; display: block; }

.cat-card h3 { font-size: 19px; margin-bottom: 8px; }
.cat-card p { font-size: 13.5px; color: var(--text-muted); margin: 0 0 16px; }
.cat-card .cat-links { font-size: 12.5px; color: var(--text-muted); }
.cat-card .cat-links li { margin-bottom: 4px; }

@media (max-width: 860px) {
  .cat-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* post grid (used by economy hub / list pages) */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.post-card:hover { border-color: var(--ink); transform: translateY(-2px); }

.post-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.post-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; line-height: 1.35; letter-spacing: -0.01em; }
.post-card p { font-size: 12.5px; color: var(--text-muted); margin: 0; flex: 1; }
.post-num { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-top: 14px; }

/* article page */
.article-wrap { max-width: 700px; margin: 0 auto; padding: 48px 24px 72px; }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-muted); }

.article-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.article-title { font-size: 30px; margin: 0 0 16px; line-height: 1.3; }
.article-meta { font-size: 12.5px; color: var(--text-muted); margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }

.article-body p { font-size: 16px; margin: 0 0 18px; color: var(--text); }
.article-body h2 { font-size: 19px; font-weight: 800; margin: 32px 0 12px; }
.article-body ul, .article-body ol { font-size: 15.5px; padding-left: 22px; margin: 0 0 18px; }
.article-body li { margin-bottom: 8px; }

.callout {
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 16px 20px;
  font-size: 13.5px;
  margin: 24px 0;
}
.callout strong { display: block; margin-bottom: 6px; }

.disclaimer {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 12.5px;
  margin-top: 36px;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 700;
}
.post-nav a { color: var(--text); text-decoration: none; }
.post-nav a:hover { color: var(--accent); }

/* tool cards (picker widgets etc.) reuse bg-soft surface */
.tool-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
}

/* ---------- picker tool widgets (life/menu.html, life/play.html) ---------- */

.picker-wrap { max-width: 640px; margin: 0 auto; }

.age-picker, .result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.age-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.age-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.tag {
  font-size: 10.5px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
}

.picker-result { text-align: center; margin-top: 24px; }

.result-name { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 14px 0 6px; min-height: 30px; }
.result-desc { color: var(--text-muted); font-size: 14px; min-height: 22px; padding: 0 12px; }

.result-body { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.35s ease, opacity 0.3s ease; }
.result-body.show { max-height: 900px; opacity: 1; margin-top: 20px; }

.detail-box {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.detail-title { font-size: 11px; font-weight: 800; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }
.detail-box p { margin: 0; font-size: 13.5px; color: var(--text); }

.ing-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid var(--bg-soft); font-size: 13px;
}
.ing-row:last-child { border-bottom: none; }
.ing-name { font-weight: 600; }
.ing-amount { color: var(--text-muted); margin-left: auto; }
.ing-buy {
  font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft);
  padding: 4px 12px; border-radius: 999px; text-decoration: none; white-space: nowrap;
}
.ing-buy:hover { background: var(--accent); color: #fff; }

.step-item { display: flex; gap: 10px; margin-bottom: 10px; font-size: 13.5px; align-items: flex-start; }
.step-item:last-child { margin-bottom: 0; }
.step-num {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px;
}

.youtube-link {
  display: flex; margin: 6px auto 0; font-size: 12.5px; font-weight: 700; color: var(--accent);
  text-decoration: underline; align-items: center; justify-content: center; gap: 5px;
}

.tabs {
  display: inline-flex; flex-wrap: wrap; background: var(--bg-soft); padding: 4px; border-radius: 999px; gap: 2px; margin-bottom: 18px;
}
.tab-btn { background: transparent; border: none; color: var(--text); font-size: 13.5px; font-weight: 700; padding: 9px 18px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.tab-btn.active { background: var(--bg); box-shadow: 0 2px 8px rgba(18,18,18,0.08); }
.tabs-category .tab-btn { font-size: 12.5px; padding: 7px 13px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

footer.pagefoot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
footer.pagefoot a { color: var(--text-muted); text-decoration: none; }
footer.pagefoot a:hover { color: var(--accent); }

/* hero: full-bleed wormhole background behind both the nav bar and the
   intro copy — #hero-orb is sized against .hero-wrap, not .hero-dark,
   so the canvas extends up behind the nav too */
.hero-wrap {
  position: relative;
  background: #050507; /* fallback if WebGL/JS never loads */
}

.hero-dark {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  display: flex;
  align-items: center;
}

.hero-dark .section-inner { position: relative; z-index: 1; }

.hero-dark .eyebrow { color: #a6a0ff; }
.hero-dark h1 { color: #fff; }
.hero-dark p { color: rgba(244,244,245,0.72); }
.hero-dark .stat-label { color: rgba(244,244,245,0.5); }
.hero-dark .stat-value { color: #fff; }

.hero-dark .pill-btn.outline {
  border-color: rgba(255,255,255,0.32);
  color: #fff;
}
.hero-dark .pill-btn.outline:hover {
  background: rgba(255,255,255,0.08);
  border-color: #fff;
}

/* same max-width/centering formula as .nav-inner, so this right-aligns to
   exactly the same edge as the theme toggle above it, at any viewport width */
.visitor-stats {
  position: absolute;
  top: 76px;
  left: 0;
  right: 0;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(244, 244, 245, 0.6);
}
.visitor-stats strong { color: #fff; font-weight: 700; }
.visitor-stats .visitor-sep { opacity: 0.4; }

@media (max-width: 640px) {
  .visitor-stats { top: 68px; font-size: 10.5px; }
}

#hero-orb {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#hero-orb canvas { display: block; width: 100% !important; height: 100% !important; }

@media (max-width: 860px) {
  .hero-dark { min-height: 480px; }
}

/* ---------- comment widget (assets/comments.js) ---------- */
.comment-field {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.comment-field:focus { outline: none; border-color: var(--accent); }
textarea.comment-field { resize: vertical; margin-top: 10px; }
.comment-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.comment-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 12px; }
.comment-msg { font-size: 12.5px; color: var(--text-muted); }
.comment-empty { color: var(--text-muted); font-size: 13.5px; }
.comment-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-item-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.comment-item-time { color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.comment-item-body { font-size: 14px; color: var(--text); white-space: pre-wrap; }

.comment-item-actions { display: flex; gap: 12px; margin-top: 6px; }
.comment-action-btn { background: none; border: none; padding: 0; font-size: 12px; color: var(--text-muted); cursor: pointer; font-weight: 600; }
.comment-action-btn:hover { color: var(--accent); }
.comment-reply { margin-left: 28px; padding-left: 14px; border-left: 2px solid var(--border); border-bottom: none; }
.comment-deleted-tag { font-weight: 500; color: var(--warn); font-size: 11.5px; margin-left: 6px; }
.comment-item-deleted { opacity: 0.6; }
.comment-reply-form-slot:not(:empty) { margin-top: 10px; }
.comment-reply-form .comment-field { margin-top: 8px; }
.comment-reply-form .comment-field:first-child { margin-top: 0; }

.comment-emoji-wrap { position: relative; display: inline-block; margin-top: 8px; }
.comment-emoji-toggle { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.comment-emoji-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.comment-emoji-panel[hidden] { display: none; }
.comment-emoji-item { background: none; border: none; font-size: 18px; padding: 4px; cursor: pointer; border-radius: 6px; line-height: 1; }
.comment-emoji-item:hover { background: var(--bg-soft); }
@media (max-width: 480px) { .comment-emoji-panel { grid-template-columns: repeat(6, 1fr); } }

/* ---------- crypto pages ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 700px) { .chart-grid { grid-template-columns: 1fr; } }

.chart-card { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.chart-card h4 { font-size: 13px; font-weight: 700; margin: 0 0 10px; color: var(--text-muted); }

.range-tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.range-tab {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; cursor: pointer;
}
.range-tab.active { background: var(--accent); color: #fff; }
.range-tab:hover:not(.active) { background: var(--bg-soft); }

.coin-price-now { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 10px; }
.coin-price-now .coin-price-usd { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-left: 4px; }
.coin-price-now .chg { font-size: 12.5px; font-weight: 700; margin-left: 8px; }
.coin-price-now .chg.up { color: var(--good); }
.coin-price-now .chg.down { color: var(--warn); }
.coin-range-stat { font-size: 11.5px; color: var(--text-muted); margin: -4px 0 10px; }
.stat-value .stat-sub { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-left: 4px; }

.chart-tooltip {
  position: absolute;
  display: none;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  line-height: 1.4;
  pointer-events: none;
  white-space: nowrap;
  z-index: 3;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.chart-tooltip-date { opacity: 0.7; font-size: 10.5px; }
.chart-tooltip-val { font-weight: 800; }
.rank-name .rank-vol { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }

.price-canvas { width: 100%; height: 190px; display: block; }
.bubble-canvas {
  width: 100%; height: 380px; display: block; border-radius: 12px;
  background: var(--bg-soft); touch-action: none; cursor: default;
}
@media (max-width: 700px) { .bubble-canvas { height: 300px; } }

.rank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .rank-grid { grid-template-columns: 1fr; } }

.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .stat-grid-3 { grid-template-columns: 1fr; } }
.rank-list { list-style: none; margin: 12px 0 0; padding: 0; }
.rank-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.rank-item:last-child { border-bottom: none; }
.rank-name { font-weight: 700; }
.rank-sym { color: var(--text-muted); font-weight: 500; margin-left: 6px; font-size: 12px; }
.rank-change.up { color: var(--good); font-weight: 700; }
.rank-change.down { color: var(--warn); font-weight: 700; }
.loading-note { font-size: 13px; color: var(--text-muted); padding: 12px 0; }

.coin-card { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 12px; }
.coin-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.coin-card-head img { width: 28px; height: 28px; border-radius: 50%; }
.coin-card-head strong { font-size: 15px; }
.coin-card-head .rank-sym { font-size: 12.5px; }
.coin-ath { font-size: 12.5px; color: var(--warn); font-weight: 700; margin-bottom: 10px; }
.coin-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 6px; }
.coin-meta-item { font-size: 12px; }
.coin-meta-label { color: var(--text-muted); display: block; margin-bottom: 2px; }
.coin-meta-value { font-weight: 700; font-size: 13.5px; }
.investor-note { margin-top: 12px; font-size: 12.5px; background: var(--bg-soft); border-radius: 10px; padding: 10px 12px; color: var(--text-muted); }
.coin-links { margin-top: 12px; font-size: 12.5px; }
.coin-links a { color: var(--accent); text-decoration: none; font-weight: 700; }

/* ---------- sortable data table (crypto scouting) ---------- */
.table-wrap { overflow-x: auto; margin-top: 20px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.data-table th {
  text-align: right; font-size: 11px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--text-muted); padding: 0 14px 10px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
}
.data-table th:first-child { text-align: left; }
.data-table th:hover { color: var(--accent); }
.data-table th.sorted { color: var(--accent); }
.data-table th .sort-arrow { font-size: 9px; margin-left: 2px; }
.data-table td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--border); text-align: right; vertical-align: middle; }
.data-table td:first-child { text-align: left; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .coin-cell { display: flex; align-items: center; gap: 8px; }
.data-table .coin-cell img { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; }
.data-table .coin-cell strong { font-size: 13px; }
.data-table .coin-cell span { color: var(--text-muted); font-size: 11.5px; margin-left: 4px; }
.data-table .cell-warn { color: var(--warn); font-weight: 700; }
.data-table .cell-muted { color: var(--text-muted); }
.data-table a.coin-link { color: var(--accent); text-decoration: none; }
.data-table a.news-link { color: var(--accent); text-decoration: none; font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* ---------- youtube trending pages ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 20px; }
.video-card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column; transition: border-color 0.15s ease, transform 0.15s ease; -webkit-user-drag: none; }
.video-card .video-title, .video-card .video-title-orig { -webkit-user-drag: none; user-select: text; }
.video-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.video-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-soft); display: block; -webkit-user-drag: none; }
.video-body { padding: 12px 14px; }
.video-rank { font-size: 11px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.video-title { font-size: 13.5px; font-weight: 700; line-height: 1.35; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { font-size: 11.5px; color: var(--text-muted); margin-bottom: 6px; }
.video-desc { font-size: 12px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-title-orig { font-size: 10.5px; color: var(--text-muted); margin: -3px 0 6px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.news-coin-badge { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 11.5px; }
.news-coin-badge .coin-tag { font-weight: 800; background: var(--bg-soft); border-radius: 6px; padding: 1px 6px; }
.news-coin-badge .badge-label { color: var(--text-muted); font-size: 10.5px; }
.news-coin-badge .badge-sep { color: var(--border); }

.highlight-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.highlight-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); background: var(--bg); transition: border-color 0.15s ease, transform 0.15s ease; }
.highlight-row:hover { border-color: var(--ink); transform: translateY(-1px); }
.highlight-row .coin-tag { font-weight: 800; background: var(--bg-soft); border-radius: 6px; padding: 2px 7px; font-size: 12px; }
.highlight-title { flex: 1 1 200px; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.35; user-select: text; -webkit-user-drag: none; }
.highlight-time { font-size: 11px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }

/* 게시 후 등락폭이 5% 이상인 "급등락" 뉴스 강조 — 방향(급등/급락) 상관없이
   동일하게 표시(둘 다 빠르게 대응해야 하는 신호라서 색을 굳이 안 나눔) */
.video-card.price-spike-up, .highlight-row.price-spike-up { border-color: var(--good); box-shadow: 0 0 0 1px var(--good); }
.video-card.price-spike-down, .highlight-row.price-spike-down { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.archive-title-link { color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 600; user-select: text; -webkit-user-drag: none; }
.archive-title-link:hover { color: var(--accent); }

/* sitemap directory page */
.sitemap-section { margin-bottom: 36px; }
.sitemap-section h2 { font-size: 18px; margin-bottom: 16px; }
.sitemap-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px; }
.sitemap-list li { border-bottom: 1px solid var(--border); }
.sitemap-list a {
  display: block; padding: 10px 0; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
}
.sitemap-list a:hover { color: var(--accent); }
@media (max-width: 600px) { .sitemap-list { grid-template-columns: 1fr; } }
