:root {
  --accent: #2aabee;
  --accent-dark: #1a8fc5;
  --accent-glow: rgba(42, 171, 238, 0.18);

  --bg: #ffffff;
  --bg-secondary: #f4f4f5;
  --surface: #ffffff;
  --surface-hover: #f0f0f1;
  --border: #e4e4e7;
  --text: #111111;
  --text-secondary: #71717a;
  --text-muted: #a1a1aa;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.10);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #17212b;
  --bg-secondary: #0f1923;
  --surface: #1e2c3a;
  --surface-hover: #243344;
  --border: #2b3e50;
  --text: #e8f0f7;
  --text-secondary: #8da5b8;
  --text-muted: #5a7a96;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.2s, color 0.2s;
  -webkit-font-smoothing: antialiased;
}

body > main { flex: 1; }

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

/* ── Header ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s, border-color 0.2s;
}

.logo {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.4px;
  color: var(--text);
}

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

/* ── Language switcher ── */
.lang-wrap {
  position: relative;
}

.lang-toggle {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s, color 0.15s;
}
.lang-toggle:hover { background: var(--surface-hover); color: var(--text); }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-width: 172px;
  z-index: 200;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.lang-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-option {
  display: block;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s, color 0.1s;
}
.lang-option:hover { background: var(--surface-hover); color: var(--text); }
.lang-option.active { color: var(--accent); font-weight: 600; }

/* ── Theme toggle ── */
.theme-toggle {
  width: 36px; height: 36px;
  border: none;
  background: var(--surface);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  transition: background 0.15s, color 0.15s;
  border: 1px solid var(--border);
  position: relative;
}
.theme-toggle:hover { background: var(--surface-hover); color: var(--text); }

/* ── Hero ── */
.hero {
  padding: 120px 24px 64px;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero-title span { color: var(--accent); }

.hero-sub {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 36px;
  line-height: 1.5;
}

/* ── Search ── */
.search-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 auto 48px;
}

.search-input {
  width: 100%;
  padding: 14px 52px 14px 20px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-btn {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.search-btn:hover { background: var(--accent-dark); }
.search-btn:active { transform: translateY(-50%) scale(0.93); }
.search-btn svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; }

/* ── Featured grid ── */
.featured {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.channel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-decoration: none;
  color: inherit;
}
.channel-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.card-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary);
  flex-shrink: 0;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--border);
}
.card-avatar img { width: 100%; height: 100%; object-fit: cover; }

.card-info { flex: 1; min-width: 0; }
.card-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-count {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.card-count.loading { color: var(--text-muted); }

/* ── Channel page ── */
.channel-page {
  min-height: 100vh;
}

/* Above fold */
.counter-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
  position: relative;
}

.channel-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.channel-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg-secondary);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.channel-avatar img { width: 100%; height: 100%; object-fit: cover; }

.channel-info {}
.channel-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.channel-username {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Live badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* ── Counter (odometer) ── */
.counter-wrap {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1px;
  margin-bottom: 16px;
  max-width: 100%;
  padding: 0 8px;
  /* font properties cascade to digit-slot and digit-column span */
  font-size: clamp(42px, 11vw, 120px);
  font-weight: 800;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  color: var(--text);
}

.digit-slot {
  display: inline-flex;
  align-items: flex-start;
  overflow: hidden;
  height: 1.15em;
}

.digit-column {
  display: flex;
  flex-direction: column;
  transition: transform 1s cubic-bezier(0.34, 1.4, 0.64, 1);
  will-change: transform;
  flex-shrink: 0;
}
.counter-wrap.no-transition .digit-column { transition: none; }

@keyframes flash-up {
  0%   { color: var(--text); }
  25%  { color: #4ade80; }
  100% { color: var(--text); }
}
@keyframes flash-down {
  0%   { color: var(--text); }
  25%  { color: #f87171; }
  100% { color: var(--text); }
}
.counter-wrap.flash-up   { animation: flash-up   0.8s ease; }
.counter-wrap.flash-down { animation: flash-down 0.8s ease; }
.embed-count.flash-up    { animation: flash-up   0.8s ease; }
.embed-count.flash-down  { animation: flash-down 0.8s ease; }
.compare-counter.flash-up   { animation: flash-up   0.8s ease; }
.compare-counter.flash-down { animation: flash-down 0.8s ease; }

.digit-column span {
  height: 1.15em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.15em;
}

.digit-slot.separator {
  align-items: center;
  opacity: 0.35;
  margin: 0 1px;
}

/* Delta */
.counter-delta {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  min-height: 22px;
  transition: color 0.3s;
}
.counter-delta.up { color: #4ade80; }
.counter-delta.down { color: #f87171; }
.counter-delta.zero { color: var(--text-muted); }

/* Sparkline */
.sparkline-wrap {
  width: 200px;
  height: 36px;
  margin-bottom: 48px;
  opacity: 0.7;
}
.sparkline-wrap canvas { width: 100%; height: 100%; display: block; }

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  animation: bounceY 2s ease-in-out infinite;
  cursor: pointer;
  user-select: none;
}
@keyframes bounceY {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}
.scroll-hint svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── Detail section ── */
.detail-section {
  padding: 64px 24px;
  max-width: 860px;
  margin: 0 auto;
}

.detail-section + .detail-section {
  padding-top: 0;
}

.detail-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

/* Chart */
.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.chart-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.chart-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.chart-btn:hover { border-color: var(--accent); color: var(--accent); }
.chart-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chart-canvas-wrap {
  position: relative;
  height: 200px;
}
.chart-canvas-wrap canvas { width: 100%; height: 100%; display: block; }

.chart-tooltip {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  display: none;
  z-index: 10;
}
.chart-tooltip strong { display: block; font-size: 14px; color: var(--accent); }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.stat-value.positive { color: #4ade80; }
.stat-value.negative { color: #f87171; }

/* ── Error / fallback ── */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}
.error-icon { font-size: 64px; margin-bottom: 24px; }
.error-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.error-sub { color: var(--text-secondary); margin-bottom: 32px; line-height: 1.5; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-dark); }

/* ── Not a channel notice ── */
.type-notice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer a {
  color: var(--accent);
  font-weight: 500;
  transition: opacity 0.15s;
}
.site-footer a:hover { opacity: 0.75; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .compare-inputs { grid-template-columns: 1fr auto; }
  .compare-vs { display: none; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-page { padding: 80px 16px 48px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 26px; }
  .header { padding: 0 16px; }
  .hero { padding-top: 96px; }
  .channel-meta { gap: 12px; }
  .channel-name { font-size: 17px; }
  .detail-section { padding: 40px 16px; }
}

/* ── Animations ── */
.fade-in { animation: fadeIn 0.5s ease both; }

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

/* staggered delays for channel page */
.anim-d1 { animation-delay: 0.05s; }
.anim-d2 { animation-delay: 0.12s; }
.anim-d3 { animation-delay: 0.20s; }
.anim-d4 { animation-delay: 0.28s; }
.anim-d5 { animation-delay: 0.36s; }
.anim-d6 { animation-delay: 0.44s; }

/* ── Scroll reveal ── */
.reveal-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal-section.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll hint click feedback */
.scroll-hint-clicked {
  transform: translateX(-50%) scale(0.88) !important;
  animation: none !important;
  opacity: 0.6;
  transition: transform 0.15s, opacity 0.15s;
}

/* ── RTL support ── */
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
[dir="rtl"] .lang-option { text-align: right; }
[dir="rtl"] .card-info { text-align: right; }
[dir="rtl"] .channel-info { text-align: right; }
[dir="rtl"] .search-input { padding: 14px 20px 14px 52px; }
[dir="rtl"] .search-btn { right: auto; left: 8px; }
[dir="rtl"] .hero-title { direction: rtl; }
[dir="rtl"] .counter-wrap { direction: ltr; }

/* ── Search overlay ── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.search-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.search-overlay-box {
  width: min(520px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  transform: translateY(-8px);
  transition: transform 0.18s ease;
}
.search-overlay.open .search-overlay-box {
  transform: translateY(0);
}
.search-overlay-icon {
  width: 18px; height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-overlay-input {
  flex: 1;
  padding: 16px 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}
.search-overlay-input::placeholder { color: var(--text-muted); }
.search-overlay-esc {
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

/* ── Milestone bar ── */
.milestone-wrap {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
  width: min(320px, 90vw);
}
.milestone-wrap.visible { display: flex; }
.milestone-label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.milestone-bar-track {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.milestone-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 1s ease;
}
.milestone-target-input {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  outline: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s;
  width: 120px;
}
.milestone-target-input:hover,
.milestone-target-input:focus { background: var(--bg-secondary); color: var(--text); }


/* ── Compare page ── */
.compare-page {
  padding: 80px 24px 64px;
  max-width: 1000px;
  margin: 0 auto;
}
.compare-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 48px;
}
.compare-vs {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}
.compare-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: center;
}
.compare-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
.compare-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  position: relative;
}
.compare-card-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.compare-card-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--accent);
  overflow: hidden;
}
.compare-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.compare-card-name { font-size: 15px; font-weight: 700; }
.compare-card-user { font-size: 12px; color: var(--text-secondary); }
.compare-counter {
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  margin-bottom: 6px;
}
.compare-delta {
  font-size: 13px;
  font-weight: 600;
  min-height: 18px;
}
.compare-delta.up { color: #4ade80; }
.compare-delta.down { color: #f87171; }

.compare-chart-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.compare-chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ── Embed widget ── */
.embed-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 12px 28px;
  background: var(--bg);
  position: relative;
}
.embed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  min-width: 180px;
}
.embed-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--accent);
  overflow: hidden;
  margin-bottom: 4px;
}
.embed-avatar img { width: 100%; height: 100%; object-fit: cover; }
.embed-name { font-size: 13px; font-weight: 700; }
.embed-count {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  line-height: 1;
}
.embed-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}
.embed-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
.embed-attribution {
  position: absolute;
  bottom: 7px;
  right: 10px;
  font-size: 9px;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.45;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.embed-attribution:hover { opacity: 0.9; }

/* ── Compare & share tools section ── */
.tools-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tool-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tool-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* ── Search shortcut in header ── */
.search-shortcut-btn {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center;
  gap: 5px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.search-shortcut-btn:hover { background: var(--surface-hover); color: var(--text); }
.search-shortcut-btn kbd {
  font-size: 12px;
  font-family: inherit;
  font-weight: 700;
  color: inherit;
  opacity: 0.55;
}

/* ── Milestone hero bar (in counter section) ── */
.milestone-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: min(280px, 80vw);
  margin-bottom: 8px;
}
.milestone-hero > span {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  min-height: 14px;
}

/* ── Embed code modal ── */
.embed-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  place-items: center;
  z-index: 1000;
  padding: 24px;
}
.embed-modal.open { display: grid; }
.embed-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.embed-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.embed-modal-title {
  font-size: 15px;
  font-weight: 700;
}
.embed-modal-close {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 18px; padding: 0 4px;
  transition: color 0.15s;
}
.embed-modal-close:hover { color: var(--text); }
.embed-theme-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}
.embed-theme-row label {
  display: flex; align-items: center; gap: 4px;
  cursor: pointer;
  color: var(--text);
}
.embed-theme-row input[type="radio"] { accent-color: var(--accent); cursor: pointer; }
.embed-code-area {
  width: 100%;
  font-family: "SFMono-Regular", "Fira Code", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  resize: none;
  outline: none;
  box-sizing: border-box;
  height: 80px;
}
.embed-copy-btn {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.embed-copy-btn:hover { opacity: 0.85; }
.embed-preview-note {
  font-size: 11px;
  color: var(--text-muted);
}
