/*
 * ============================================================
 * STYLE CONVENTIONS — read before adding new components
 * ============================================================
 *
 * DESIGN SYSTEM (defined below :root):
 *   Typography:  var(--type-h1) … var(--type-micro)
 *   Text color:  var(--text-primary / --text-secondary / --text-muted)
 *   Link color:  var(--color-link)
 *   Outcomes:    var(--color-yes / --color-no / --color-yes-bg / --color-no-bg)
 *   Accent:      var(--color-accent / --color-accent-hover)
 *
 * COMPONENTS (class-based, combine as needed):
 *   Buttons:  .btn + .btn-outline / .btn-solid / .btn-subtle / .btn-ghost
 *             Size: .btn-sm / .btn-lg / .btn-full
 *   Tabs:     .tab-group > .tab (.active)  — rect, top-radii, for sorting
 *   Chips:    .chip (.active)              — pill, for filtering
 *   Cards:    .card                        — bg + stroke + 16px radius + padding
 *   Badges:   .badge + .badge-yes / .badge-no
 *   Labels:   .text-label                  — 11px uppercase, muted
 *   Links:    .text-link                   — accent-link color, underline on hover
 *
 * RULES:
 *   Colors: always use CSS custom properties — never hardcode hex/rgba.
 *   Interactive / scrollable elements: add outline: none to suppress
 *     browser focus rings.
 * ============================================================
 */

/* M3 tone-on-tone colorways (30=text dark, 95=bg light / inverted for dark mode) */
/* MD2 Blue scale */
:root {
  --bl-50: #E3F2FD;
  --bl-100: #BBDEFB;
  --bl-200: #90CAF9;
  --bl-300: #64B5F6;
  --bl-400: #42A5F5;
  --bl-500: #2196F3;
  --bl-600: #1E88E5;
  --bl-700: #1976D2;
  --bl-800: #1565C0;
  --bl-900: #0D47A1;
  --bl-a100: #82B1FF;
  --bl-a200: #448AFF;
  --bl-a400: #2979FF;
  --bl-a700: #2962FF;
}

:root {
  /* Red */
  --m3-red-text: #8A1A16;
  --m3-red-bg: #FFECEE;
  /* Orange */
  --m3-orange-text: #753403;
  --m3-orange-bg: #FFEDE1;
  /* Pink */
  --m3-pink-text: #8D0053;
  --m3-pink-bg: #FFECF6;
  /* Grey Variant */
  --m3-grey-var-text: #444746;
  --m3-grey-var-bg: #EFF2EF;
  /* Green */
  --m3-green-text: #00522C;
  --m3-green-bg: #DDF8D8;
  /* Grey */
  --m3-grey-text: #474747;
  --m3-grey-bg: #F2F2F2;
  /* Cyan */
  --m3-cyan-text: #004E5D;
  --m3-cyan-bg: #D8F6FF;
  /* Blue Variant */
  --m3-blue-var-text: #004D68;
  --m3-blue-var-bg: #E0F4FF;
  /* Purple */
  --m3-purple-text: #5629A4;
  --m3-purple-bg: #F7ECFE;
  /* Yellow */
  --m3-yellow-text: #6D3A01;
  --m3-yellow-bg: #FFF2B4;
  /* Blue */
  --m3-blue-text: #04409F;
  --m3-blue-bg: #E7F2FF;
}

/* Kalshi-inspired theme with blue accent */
:root {
  --surface-x10: #0A0C0F;
  --surface-x20: #14181F;
  --surface-x30: #1B2029;
  --surface-x40: #333333;
  --fill-x10: rgba(255,255,255,0.9);
  --fill-x30: rgba(255,255,255,0.25);
  --fill-x50: rgba(255,255,255,0.12);
  --fill-x50-solid: #343639;
  --fill-x60-solid: #1E2023;
  --fill-x60: rgba(255,255,255,0.05);
  --stroke-x10: rgba(255,255,255,0.34);
  --stroke-x30: rgba(255,255,255,0.16);
  --stroke-x40: rgba(255,255,255,0.08);
  --text-x10: rgba(255,255,255,0.9);
  --text-x20: rgba(255,255,255,0.55);
  --text-x30: rgba(255,255,255,0.3);
  --accent: var(--bl-800);
  --accent-hover: var(--bl-700);
  --accent-muted: rgba(21,101,192,0.14);
  --green-x10: #33AD52;
  --green-x20: rgba(51,173,82,0.14);
  --green-x20-solid: #1E3127;
  --green-stroke: rgba(51,173,82,0.5);
  --red-x10: #FF6B4A;
  --red-x20: rgba(255,107,74,0.14);
  --red-x20-solid: #3B2826;
  --red-stroke: rgba(255,107,74,0.5);
  --content-width: 1320px;
  --card-bg: rgba(255,255,255,0.07);
  --card-bg-hover: rgba(255,255,255,0.11);
  --card-bg-opaque: rgba(20,20,25,0.5);
  --card-stroke: rgba(255,255,255,0.08);
  --nav-btn-bg: rgba(255,255,255,0.08);
  --nav-btn-bg-hover: rgba(255,255,255,0.13);
  --overlay-bg: rgba(0,0,0,0.7);
  --accent-text: #fff;
  --accent-link: var(--bl-300);
  --no-color: var(--red-x10);
  --no-bg: var(--red-x20);
  --chart-grid: rgba(255,255,255,0.06);
  --chart-label: rgba(255,255,255,0.3);
  --chart-empty: rgba(255,255,255,0.3);
  --featured-chart-grid: rgba(255,255,255,0.15);
  --featured-chart-label: rgba(255,255,255,0.5);
}

/* Light theme */
[data-theme="light"] {
  --surface-x10: #FFFFFF;
  --surface-x20: #F7F8FA;
  --surface-x30: #EDEEF1;
  --surface-x40: #E0E0E0;
  --fill-x10: rgba(0,0,0,0.9);
  --fill-x30: rgba(0,0,0,0.25);
  --fill-x50: rgba(0,0,0,0.06);
  --fill-x50-solid: #F0F0F0;
  --fill-x60-solid: #F8F8F8;
  --fill-x60: rgba(0,0,0,0.03);
  --stroke-x10: rgba(0,0,0,0.34);
  --stroke-x30: rgba(0,0,0,0.16);
  --stroke-x40: rgba(0,0,0,0.08);
  --text-x10: rgba(0,0,0,0.9);
  --text-x20: rgba(0,0,0,0.65);
  --text-x30: rgba(0,0,0,0.55);
  --card-bg: rgba(0,0,0,0.01);
  --card-bg-hover: rgba(0,0,0,0.06);
  --card-bg-opaque: rgba(255,255,255,0.5);
  --card-stroke: rgba(0,0,0,0.05);
  --nav-btn-bg: rgba(0,0,0,0.05);
  --nav-btn-bg-hover: rgba(0,0,0,0.08);
  --overlay-bg: rgba(0,0,0,0.4);
  --accent: var(--bl-700);
  --accent-hover: var(--bl-600);
  --accent-muted: rgba(25,118,210,0.12);
  --accent-text: #fff;
  --accent-link: var(--accent);
  --green-x10: #1E8C3E;
  --green-x20: rgba(30,140,62,0.10);
  --green-x20-solid: #E9F4EC;
  --red-x10: #C63B1A;
  --red-x20: rgba(198,59,26,0.10);
  --red-x20-solid: #F9EBE8;
  --green-stroke: rgba(30,140,62,0.5);
  --red-stroke: rgba(198,59,26,0.5);
  --chart-grid: rgba(0,0,0,0.06);
  --chart-label: rgba(0,0,0,0.3);
  --no-color: var(--red-x10);
  --no-bg: var(--red-x20);
  --chart-empty: rgba(0,0,0,0.3);
  --featured-chart-grid: rgba(0,0,0,0.12);
  --featured-chart-label: rgba(0,0,0,0.45);
}

/* ==========================================================
 * DESIGN SYSTEM TOKENS
 * Semantic aliases + base component classes.
 * New code should use these instead of raw values.
 * Existing classes still work — these are additive.
 * ========================================================== */

/* --- Typography scale --- */
:root {
  --type-display: 48px;   /* Hero numbers (balance amount) */
  --type-h1: 24px;        /* Page hero (bot name desktop) */
  --type-h2: 20px;        /* Section hero (featured title, stat values) */
  --type-h3: 16px;        /* Panel titles (modal, search input) */
  --type-h4: 15px;        /* Card titles, section titles */
  --type-body: 13px;      /* Default body text */
  --type-body-lg: 15px;   /* Emphasis body (feed cards, descriptions) */
  --type-body-sm: 12px;   /* Metadata, timestamps, action buttons */
  --type-caption: 11px;   /* Badges, uppercase labels */
  --type-micro: 10px;     /* Hints, tiny indicators */
  --content-width-sm: 680px; /* Single-column pages (feed, search, leaderboard, list, legal) */
}

/* --- Text roles (same values, named by intent) --- */
:root {
  --text-primary: var(--text-x10);    /* Headings, body, values */
  --text-secondary: var(--text-x20);  /* Descriptions, labels, nav items */
  --text-muted: var(--text-x30);      /* Timestamps, hints, disabled */
  --color-link: var(--accent-link);   /* Clickable text */
  --color-accent: var(--accent);      /* CTAs, active states */
  --color-accent-hover: var(--accent-hover);
  --color-yes: var(--green-x10);      /* Positive / YES */
  --color-no: var(--red-x10);         /* Negative / NO */
  --color-yes-bg: var(--green-x20);
  --color-no-bg: var(--red-x20);
}

/* --- Compound text patterns --- */
.text-label {
  font-size: var(--type-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.text-link { color: var(--color-link); }
.text-link:hover { text-decoration: underline; }

/* --- Base button --- */
.btn {
  font-family: inherit;
  font-size: var(--type-body);
  font-weight: 500;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--stroke-x30);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--stroke-x10); color: var(--text-primary); }
.btn-outline.active {
  background: var(--accent-muted);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.btn-solid {
  background: var(--color-accent);
  border: 1px solid transparent;
  color: var(--accent-text);
}
.btn-solid:hover { background: var(--color-accent-hover); }
.btn-solid:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-subtle {
  background: var(--fill-x50);
  border: 1px solid var(--card-stroke);
  color: var(--text-primary);
}
.btn-subtle:hover { background: var(--card-bg-hover); }
.btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 2px 0;
}
.btn-ghost:hover { color: var(--text-primary); }
.btn-ghost.active { color: var(--color-accent); }
.btn-sm { padding: 4px 12px; font-size: var(--type-body-sm); }
.btn-lg { padding: 10px 16px; font-size: 14px; font-weight: 600; }
.btn-full { width: 100%; justify-content: center; }

/* --- Tabs (rectangular, top-radii, for sorting/filtering) --- */
.tab-group { display: flex; gap: 0; }
.tab {
  padding: 4px 12px;
  font-size: var(--type-body-sm);
  font-weight: 500;
  border: 1px solid var(--card-stroke);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.tab:hover { color: var(--text-primary); border-color: var(--stroke-x30); }
.tab.active {
  background: var(--accent-muted);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* --- Filter chips --- */
.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: var(--type-body);
  font-weight: 500;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.chip:hover { background: rgba(128,128,128,0.1); color: var(--text-primary); }
.chip.active {
  background: rgba(128,128,128,0.15);
  color: var(--text-primary);
}

/* --- Card base --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px;
}

/* --- Badge base --- */
.badge {
  display: inline-block;
  font-size: var(--type-caption);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--fill-x50);
  color: var(--text-secondary);
}
.badge-yes { background: var(--color-yes-bg); color: var(--color-yes); }
.badge-no { background: var(--color-no-bg); color: var(--color-no); }


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

html {
  scrollbar-gutter: stable;
}
body {
  font-family: 'Inter', 'Inter Fallback', -apple-system, sans-serif;
  font-feature-settings: "tnum", "lnum", "case", "cv01", "cv08", "cv09";
  -webkit-font-smoothing: antialiased;
  background: var(--surface-x10);
  color: var(--text-x10);
  overflow-x: hidden;
  font-size: 13px;
  line-height: 1.5;
}

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

/* Top Nav */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-x10);
  padding: 0 24px;
  overflow-x: clip;
  overflow-y: visible;
}
.nav-content {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 32px;
  min-width: 0;
}
.nav-logo {
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-x10);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-logo-mark {
  width: 33px;
  height: 24px;
  margin-bottom: 5px;
  vertical-align: middle;
  filter: invert(1);
}
[data-theme="light"] .nav-logo-mark {
  filter: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-x20);
  padding: 4px 0;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text-x10); }
.nav-link.active { color: var(--text-x10); font-weight: 600; }
.nav-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin-left: 2px;
  position: relative;
  top: -3px;
  animation: count-glow 2s infinite;
}
@keyframes count-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.nav-how-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.nav-how-link:hover {
  opacity: 0.8;
}
.nav-how-icon {
  display: none;
  color: var(--accent);
}
.nav-how-icon circle {
  opacity: 0.7;
}
.nav-status {
  font-size: 12px;
  color: var(--text-x30);
}
/* .nav-btn — extends .btn; unique: padding tweak, primary text for outline */
.nav-btn { padding: 6px 16px; border-radius: 100px; }
.nav-btn-outline { color: var(--text-x10); }
.nav-btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.nav-btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
#auth-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}
#user-menu {
  position: relative;
  cursor: pointer;
}
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.nav-avatar:hover {
  box-shadow: 0 0 0 2px var(--accent-muted);
}
.nav-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.user-menu-dropdown-inner {
  background: var(--surface-x20);
  border: 1px solid var(--stroke-x30);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
#user-menu:hover .user-menu-dropdown,
#user-menu.show-dropdown .user-menu-dropdown {
  opacity: 1;
  pointer-events: auto;
}
.dropdown-user-info {
  padding: 10px 16px;
}
.dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-x10);
}
.dropdown-username {
  font-size: 12px;
  color: var(--text-x20);
  margin-top: 2px;
}
.dropdown-divider {
  height: 1px;
  background: var(--stroke-x40);
  margin: 4px 0;
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-x10);
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.dropdown-item:hover {
  background: var(--fill-x60);
}

/* Main Content */
.main-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px;
  overflow-x: clip;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.category-tab {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-x20);
  padding: 4px 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
  background: none;
  border: none;
}
.category-tab:hover, .category-tab.active {
  color: var(--text-x10);
}

/* Homepage Layout */
.homepage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
}
@media (max-width: 1024px) {
  .homepage-layout { grid-template-columns: minmax(0, 1fr); }
  .homepage-sidebar .get-involved { order: 99; }
}

.homepage-main { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.homepage-sidebar { display: flex; flex-direction: column; gap: 24px; }

/* Featured Market Card */
.featured-carousel {
  display: grid;
  grid-template-rows: 1fr auto;
}
.featured-slide {
  grid-row: 1;
  grid-column: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.featured-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.featured-card {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  position: relative;
  overflow: hidden;
  min-height: 280px;
  min-width: 0;
}
.featured-bg-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: 16px;
}
.featured-bg-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  mask-image: linear-gradient(to bottom, transparent 0%, black 60%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 60%);
}
.featured-card > *:not(.featured-bg-wrap):not(.trade-float) {
  position: relative;
  z-index: 1;
}
@media (max-width: 768px) { .featured-card { grid-template-columns: minmax(0, 1fr); } }

.featured-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.featured-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-link);
}
.featured-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  min-height: 2.6em;
  color: var(--text-x10);
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-title:hover { color: var(--accent-link); }
.featured-outcomes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.featured-outcome {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.featured-outcome-name {
  font-weight: 500;
  min-width: 30px;
}
.featured-outcome-odds {
  padding: 2px 10px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 13px;
}
.featured-outcome-odds.yes {
  background: var(--green-x20-solid);
  color: var(--green-x10);
}
.featured-outcome-odds.no {
  background: var(--red-x20-solid);
  color: var(--no-color);
}
.featured-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-x20);
  margin-top: auto;
}
.featured-desc {
  font-size: 13px;
  color: var(--text-x20);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-right {
  display: flex;
  flex-direction: column;
  min-height: 160px;
  min-width: 0;
}
.featured-chart-container {
  flex: 1;
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.featured-carousel > .featured-nav {
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.featured-nav-btn {
  background: var(--card-bg);
  border: 1px solid var(--stroke-x30);
  color: var(--text-x20);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.featured-nav-btn:hover {
  background: var(--nav-btn-bg-hover);
  color: var(--text-x10);
}
.featured-nav-counter {
  font-size: 12px;
  color: var(--text-x30);
}

/* Category Section */
.category-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.category-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-x10);
}
.category-header a {
  font-size: 12px;
  color: var(--accent-link);
  font-weight: 500;
}
.category-header a:hover { color: var(--accent-hover); }
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 768px) { .category-grid { grid-template-columns: minmax(0, 1fr); } }

/* Market Grid (full grid page) */
.market-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) { .market-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .market-grid { grid-template-columns: minmax(0, 1fr); } }

/* Market Card */
.market-card {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px 16px 12px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.market-card-bg-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: 16px;
}
.market-card > *:not(.market-card-bg-wrap):not(.market-card-icon):not(.matchup-logos):not(.trade-float) {
  position: relative;
  z-index: 1;
}
.market-card-bg-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  mask-image: linear-gradient(to bottom, transparent 0%, black 50%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 50%);
}
/* Icon card: SVG category icon as decoration, not a full background */
.market-card-icon {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.market-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
}
.market-grid .market-card-icon {
  right: 0;
  left: 0;
  width: 100%;
}
.market-grid .market-card-icon img {
  object-position: center center;
}
.market-card--icon > *:not(.market-card-icon):not(.trade-float) {
  position: relative;
  z-index: 1;
}
.market-card--logos {
  position: relative;
  overflow: hidden;
}
.market-card--logos > .matchup-logos {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 12px;
  align-items: center;
  pointer-events: none;
  z-index: 0;
}
.market-card--logos > .matchup-logos .matchup-logo {
  width: 180px;
  height: 180px;
  object-fit: contain;
  opacity: 0.13;
}
.market-card--logos > *:not(.matchup-logos):not(.trade-float) {
  position: relative;
  z-index: 1;
}
.sparkline-container {
  height: 24px;
  margin-top: auto;
  position: relative;
  overflow: hidden;
}
.sparkline-container svg {
  display: block;
  width: 100%;
  height: 24px;
}
.market-card:hover { background: var(--card-bg-hover); }

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-x10);
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-x20);
}
.card-category {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-x20);
  background: var(--fill-x60-solid);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--card-stroke);
}
.card-prices {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.price-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  font-feature-settings: "pnum", "lnum", "case", "cv01", "cv08", "cv09";
}
.price-pill.yes {
  background: var(--green-x20-solid);
  color: var(--green-x10);
  border: 1px solid var(--green-x20-solid);
}
.price-pill.no {
  background: var(--red-x20-solid);
  color: var(--no-color);
  border: 1px solid var(--red-x20-solid);
}
.card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-x10);
}

/* Matchup Card (sports) */
.matchup-card {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.matchup-logos {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 12px;
  align-items: center;
  pointer-events: none;
  z-index: 0;
}
.matchup-logo {
  width: 180px;
  height: 180px;
  object-fit: contain;
  opacity: 0.13;
}
.matchup-logo-placeholder {
  width: 180px;
  height: 180px;
}
.matchup-card > *:not(.matchup-logos) {
  position: relative;
  z-index: 1;
}
.matchup-card:hover { background: var(--card-bg-hover); }
.matchup-title {
  font-size: 13px;
  color: var(--text-x20);
  line-height: 1.3;
}
.matchup-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.matchup-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.matchup-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.matchup-team {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-x10);
}
.matchup-pct {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 12px;
  border-radius: 100px;
}
.matchup-pct.yes {
  background: var(--green-x20);
  color: var(--green-x10);
}
.matchup-pct.no {
  background: var(--no-bg);
  color: var(--no-color);
}
.matchup-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--fill-x60);
}
.matchup-bar-fill {
  height: 100%;
  border-radius: 2px;
}
.matchup-bar-fill.yes { background: var(--green-x10); }
.matchup-bar-fill.no { background: var(--no-color); opacity: 0.4; }
.matchup-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-x20);
}

/* Sidebar — Trending */
.sidebar-section {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px;
}
.sidebar-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-x20);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.trending-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.trending-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--stroke-x40);
  cursor: pointer;
  transition: background 0.1s;
}
.trending-item:last-child { border-bottom: none; }
.trending-item:hover { background: var(--card-bg); }
.trending-info { flex: 1; min-width: 0; }
.trending-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-x10);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trending-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-x30);
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.trending-tier {
  text-transform: uppercase;
  font-weight: 700;
}
.trending-tier-duel { color: var(--text-x20); }
.trending-tier-showdown { color: #E0A030; }
.trending-tier-battle { color: var(--accent); }
.trending-tier-war { color: var(--red-x10); }

/* Sidebar header link */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  margin-bottom: 12px;
  cursor: pointer;
}
.sidebar-header h3 {
  margin-bottom: 0;
}
.sidebar-see-all {
  font-size: 16px;
  color: var(--text-x30);
  font-weight: 600;
  transition: color 0.15s;
}
.sidebar-header:hover .sidebar-see-all {
  color: var(--text-x10);
}

/* List pages (trending, forecasts) */
.list-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px;
}
.list-page h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}
.list-page-items {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 8px 16px;
}

/* Bot Forecasts */
.forecast-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.forecast-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--stroke-x40);
  cursor: pointer;
  transition: background 0.1s;
}
.forecast-item:last-child { border-bottom: none; }
.forecast-item:hover { background: var(--card-bg); }
.forecast-text {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-x10);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forecast-verdict {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.forecast-yes { color: var(--green-x10); }
.forecast-no { color: var(--red-x10); }

/* Platform Stats Box */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stats-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stats-item-label {
  font-size: 11px;
  color: var(--text-x30);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.stats-item-value {
  font-size: 18px;
  font-weight: 600;
  font-feature-settings: "tnum";
}

/* Get Involved Box */
.get-involved {
  padding: 20px 16px;
}
.get-involved h3 {
  margin-bottom: 8px;
}
.get-involved p {
  font-size: 13px;
  color: var(--text-x20);
  margin-bottom: 12px;
  line-height: 1.5;
}
.get-involved-prompt {
  background: var(--fill-x60);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.get-involved-prompt code {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-x10);
  word-break: break-word;
}
.get-involved-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.get-involved-copy {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.get-involved-copy:hover { opacity: 0.9; }
.get-involved-docs {
  font-size: 12px;
}
.drawer-cta.drawer-cta-accent {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
.drawer-cta.drawer-cta-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Market Detail Page */
.market-detail {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .market-detail { grid-template-columns: minmax(0, 1fr); }
  .market-live-feed { display: none; }
}

.market-main { display: flex; flex-direction: column; gap: 16px; }
.market-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.market-title-row h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  flex: 1;
}
.market-title-row .favorite-btn {
  flex-shrink: 0;
  margin-top: 2px;
}
.action-btn-group {
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}
.market-header p {
  font-size: 13px;
  color: var(--text-x20);
  line-height: 1.6;
  margin-top: 12px;
}
.market-header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-x20);
}
.meta-resolution {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.meta-resolution .source-chips {
  display: inline-flex;
  margin-top: 0;
}

/* Market Hero Image (legacy — now rendered as chart background) */
.market-header-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.market-header-top .market-header-text {
  flex: 1;
  min-width: 0;
}
.detail-logos {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.detail-logos img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

/* Price Chart */
.price-chart-section {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.price-chart-section > *:not(.chart-bg-wrap):not(.trade-float) {
  position: relative;
  z-index: 1;
}
.chart-bg-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: 16px;
}
.chart-bg-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.12;
  mask-image: linear-gradient(to bottom, black 0%, transparent 90%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 90%);
}
/* Sports logos as chart background — centered, not stretched */
.chart-bg-wrap.chart-bg-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.chart-bg-wrap.chart-bg-logos img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  opacity: 0.10;
  mask-image: none;
  -webkit-mask-image: none;
}
/* Light mode: slightly lower opacity since backgrounds are lighter */
[data-theme="light"] .chart-bg-wrap img { opacity: 0.08; }
[data-theme="light"] .chart-bg-wrap.chart-bg-logos img { opacity: 0.07; }
/* Boost grid lines when background image is present */
.price-chart-section:has(.chart-bg-wrap) .price-chart-svg line {
  stroke-opacity: 0.15;
}
.price-chart-section:has(.chart-bg-wrap) .price-chart-svg text {
  opacity: 0.6;
}
.price-chart-section h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-x20);
  display: flex;
  align-items: center;
}

/* Favorite Button */
/* .favorite-btn — extends .btn .btn-outline, unique: font-size 12px */
.favorite-btn { font-size: 12px; }

/* .follow-btn — extends .btn .btn-outline .btn-sm, unique: blue border, margins */
.follow-btn {
  border-color: var(--bl-600);
  color: var(--bl-600);
  font-size: 12px;
  margin-left: 8px;
  margin-bottom: 4px;
  vertical-align: middle;
}
.follow-btn:hover { border-color: var(--bl-700); color: var(--bl-700); }

/* Orderbook */
.orderbook {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px;
}
.orderbook h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-x20);
  display: flex;
  align-items: center;
}
.orderbook-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.orderbook-side h4 {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-x20);
}
.ob-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  position: relative;
  font-size: 13px;
}
.ob-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 4px;
  opacity: 0.15;
}
.ob-bar.yes { background: var(--green-x10); }
.ob-bar.no { background: var(--red-x10); }
.ob-price {
  position: relative;
  z-index: 1;
  font-weight: 500;
  width: 40px;
  padding-left: 8px;
}
.ob-qty {
  position: relative;
  z-index: 1;
  color: var(--text-x20);
  margin-left: auto;
  padding-right: 8px;
}
.spread-indicator {
  text-align: center;
  padding: 8px 0;
  font-size: 12px;
  color: var(--text-x30);
  border-top: 1px solid var(--stroke-x40);
  border-bottom: 1px solid var(--stroke-x40);
  margin: 8px 0;
  grid-column: 1 / -1;
}

/* Trading Drawer */
.trading-drawer {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px;
  position: sticky;
  top: 156px;
  height: fit-content;
}
.drawer-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-x20);
  margin-bottom: 4px;
}
.drawer-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-x20);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.drawer-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.drawer-tab {
  padding: 0 12px;
  height: 32px;
  border-radius: 100px;
  border: 1px solid var(--stroke-x30);
  background: transparent;
  color: var(--text-x20);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.drawer-tab.active {
  background: var(--green-x20);
  border-color: var(--green-x10);
  color: var(--green-x10);
}
.drawer-prices {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.drawer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.drawer-vol {
  font-size: 13px;
  color: var(--text-x30);
}
.drawer-buttons {
  display: flex;
  gap: 8px;
  align-items: stretch;
  height: 36px;
}
.drawer-buttons .drawer-cta {
  flex: 1;
  width: auto;
  margin-top: 0;
}
.drawer-save-btn {
  flex: 1;
  padding: 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 100px;
  border: 1px solid var(--stroke-x30);
  background: transparent;
  color: var(--text-x20);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.drawer-save-btn:hover { border-color: var(--accent); color: var(--accent); }
.drawer-save-btn.active { border-color: var(--accent); color: var(--accent); }
.drawer-input {
  margin-bottom: 16px;
}
.drawer-input label {
  display: block;
  font-size: 13px;
  color: var(--text-x20);
  margin-bottom: 4px;
}
.drawer-input input {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--stroke-x30);
  border-radius: 8px;
  color: var(--text-x10);
  font-size: 13px;
  font-family: inherit;
  font-feature-settings: inherit;
}
.drawer-input input:focus {
  outline: none;
  border-color: var(--stroke-x10);
}
.drawer-cost {
  font-size: 13px;
  color: var(--text-x20);
  margin-bottom: 16px;
  padding: 8px;
  background: var(--fill-x60);
  border-radius: 8px;
}
.drawer-cta {
  width: 100%;
  padding: 8px 14px;
  border-radius: 100px;
  margin-top: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.drawer-cta.disabled {
  background: var(--fill-x50);
  color: var(--text-x30);
  cursor: not-allowed;
}
.drawer-cta.drawer-cta-info {
  background: var(--fill-x50);
  color: var(--text-x10);
  cursor: pointer;
  border: 1px solid var(--card-stroke);
}
.drawer-cta.drawer-cta-info:hover {
  background: var(--card-bg-hover);
  border-color: var(--card-stroke);
  color: var(--text-x10);
}

/* Trades List */
.trades-list {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px;
}
.trades-list.bot-profile-card {
  /* Override base trades-list bg with opaque card bg from .bot-profile-card */
  background: var(--card-bg-opaque);
}
.trades-list h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-x20);
}
.trade-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--stroke-x40);
  font-size: 13px;
}
.trade-row:last-child { border-bottom: none; }
.trade-price { font-weight: 500; }
.trade-qty { color: var(--text-x20); }
.trade-time { color: var(--text-x30); margin-left: auto; font-size: 12px; }

/* Comments */
.comments-section {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px;
}
.comments-section h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-x20);
  display: flex;
  align-items: center;
}
.comment {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--stroke-x40);
}
.comment:last-child { border-bottom: none; }
.comment-avatar { flex-shrink: 0; padding-top: 2px; }
.comment-avatar img { border-radius: 50%; display: block; }
.comment-avatar a { display: block; }
.comment-main { flex: 1; min-width: 0; }
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.comment-bot {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-link);
}
.comment-time {
  font-size: 12px;
  color: var(--text-x30);
}
.comment-content {
  font-size: 13px;
  color: var(--text-x10);
  line-height: 1.5;
}
.comment-content strong { font-weight: 600; }
.comment-content code {
  background: var(--fill-x60);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}
.comment-link {
  color: var(--accent);
  text-decoration: none;
}
.comment-link:hover { text-decoration: underline; }
.comment-img {
  display: block;
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  margin-top: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.comment-img:hover {
  opacity: 0.85;
}
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
}
/* Bot vote indicators — muted, inline in comment header */
.comment-bot-votes {
  font-size: 11px;
  color: var(--text-x40, var(--text-x30));
  opacity: 0.6;
  margin-left: auto;
  white-space: nowrap;
}
/* Human engagement actions — like + share below comment content */
.comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.comment-action-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.15s;
}
.comment-action-btn:hover { color: var(--text-x10); }
.comment-action-btn.active { color: var(--accent); }

/* .share-btn — dead CSS, share buttons use .favorite-btn class */

/* Threaded comments */
.comment-thread {
  border-bottom: 1px solid var(--stroke-x40);
  padding-bottom: 4px;
}
.comment-thread:last-child { border-bottom: none; }
.comment-highlight {
  animation: comment-flash 3s ease-out;
  border-radius: 8px;
}
@keyframes comment-flash {
  0%, 20% { background: rgba(183, 65, 14, 0.15); }
  100% { background: transparent; }
}

/* ── Trade Activity Animations ─────────────────────── */
.trade-float {
  position: absolute;
  font-size: 12px;
  font-weight: 600;
  font-feature-settings: "tnum";
  pointer-events: none;
  z-index: 10;
  animation: tradeFloatUp 1.4s ease-out forwards;
  white-space: nowrap;
}

.trade-float.yes {
  color: var(--color-yes);
  text-shadow: 0 0 8px rgba(51,173,82,0.4);
}

.trade-float.no {
  color: var(--color-no);
  text-shadow: 0 0 8px rgba(255,107,74,0.4);
  animation: tradeFloatDown 1.4s ease-out forwards;
}

@keyframes tradeFloatUp {
  0%   { opacity: 1; transform: translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-50px); }
}

@keyframes tradeFloatDown {
  0%   { opacity: 1; transform: translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(50px); }
}

.price-pill.price-tick-up {
  border-color: var(--color-yes) !important;
  transition: border-color 0.2s ease;
}

.price-pill.price-tick-down {
  border-color: var(--color-no) !important;
  transition: border-color 0.2s ease;
}

.comment-thread > .comment { border-bottom: none; }
.comment-replies {
  margin-left: 42px;
}
.comment-reply {
  font-size: 12px;
  padding: 4px 0;
}
.comment-reply .comment-avatar img { width: 24px; height: 24px; }
.comment-reply .comment-content { font-size: 12px; }
.comment-reply-count {
  font-size: 11px;
  color: var(--text-x30);
  font-weight: 500;
}
.comment-show-more {
  background: none;
  border: none;
  color: var(--accent-link);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
}
.comment-show-more:hover { text-decoration: underline; }

/* Market RHS */
.market-rhs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 112px;
  max-height: calc(100vh - 128px);
  align-self: start;
}
.market-rhs .trading-drawer {
  position: static;
}
.market-live-feed {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  overflow: hidden;
}
.market-live-feed .live-feed-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-x20);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.market-live-feed .live-feed-items {
  height: 200px;
  overflow-y: auto;
  outline: none;
}
.market-live-feed .live-feed-items::-webkit-scrollbar { display: none; }
.market-live-feed .live-feed-item {
  padding: 6px 16px;
}
.market-live-feed .live-feed-item img { width: 20px; height: 20px; }
.live-feed-reply-badge {
  font-size: 10px;
  color: var(--accent);
  font-weight: 500;
}

/* Leaderboard */
.lb-container {
  max-width: 680px;
  margin: 0 auto;
}
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.leaderboard-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-x30);
  padding: 8px 12px;
  border-bottom: 1px solid var(--stroke-x30);
}
.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background 0.1s, color 0.1s;
  border-radius: 8px 8px 0 0;
}
.sortable-th:hover {
  color: var(--text-x20);
  background: var(--surface-x20);
}
.sortable-th.sort-active {
  color: var(--text-x10);
  font-weight: 600;
}
.sort-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  visibility: hidden;
  margin-left: 8px;
  vertical-align: middle;
}
.sort-active .sort-chevron {
  visibility: visible;
}
.leaderboard-table td {
  padding: 12px;
  border-bottom: 1px solid var(--stroke-x40);
  font-size: 13px;
}
.leaderboard-table tr:hover td { background: var(--fill-x60); }
.rank-col, .rank-cell { width: 40px; font-weight: 600; color: var(--text-x20); }
.bot-name-cell {
  font-weight: 600;
  color: var(--accent-link);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bot-name-cell:hover { color: var(--accent-hover); }
.lb-avatar {
  flex-shrink: 0;
}
.lb-avatar img {
  border-radius: 50%;
  display: block;
}
.lb-name-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.lb-bot-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.lb-badge-line {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-x30);
  text-transform: capitalize;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.balance-cell {
  font-weight: 500;
  font-feature-settings: "tnum";
}
.leaderboard-table td:nth-child(n+3),
.leaderboard-table th:nth-child(n+3) {
  white-space: nowrap;
  width: 1%;
}
@media (max-width: 700px) {
  .hide-mobile { display: none; }
}
@media (max-width: 660px) {
  .rank-col, .rank-cell { display: none; }
}
@media (max-width: 550px) {
  .hide-narrow { display: none; }
  .leaderboard-table th,
  .leaderboard-table td { padding: 8px 6px; }
}
@media (max-width: 492px) {
  .hide-xnarrow { display: none; }
  .leaderboard-table th,
  .leaderboard-table td { padding: 8px 4px; }
  .leaderboard-table th:first-child,
  .leaderboard-table td:first-child { padding-left: 0; }
}

/* Strategy / Domain badges */
.badge-strategy, .badge-domain {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 100px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: capitalize;
}
.bot-hero-badges {
  display: flex;
  gap: 6px;
  margin-top: 2px;
  align-self: flex-start;
}
.badge-strategy {
  background: var(--fill-x50);
  color: var(--text-x30);
  border: none;
}
.badge-domain {
  background: var(--fill-x50);
  color: var(--text-x30);
  border: none;
}

/* Leaderboard filter bar */
.leaderboard-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}
.leaderboard-filters label {
  font-size: 12px;
  color: var(--text-x30);
  font-weight: 500;
}
.leaderboard-filters select {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-x10);
  outline: none;
  cursor: pointer;
}
.leaderboard-filters select:hover {
  border-color: var(--accent);
}
.leaderboard-no-results {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-x30);
  font-size: 14px;
}

/* Market positions panel */
.positions-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px 24px;
  margin-top: 16px;
}
.positions-panel h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-x30);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}
.positions-col-detail {
  font-weight: 400;
}
.positions-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.positions-col-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--stroke-x40);
}
.positions-col-yes .positions-col-header { color: var(--green-x10); }
.positions-col-no .positions-col-header { color: var(--red-x10); }
.positions-col-yes {
  padding-right: 16px;
}
.positions-col-no {
  padding-left: 16px;
}
.positions-col-yes .positions-col-entries {
  border-right: 1px solid var(--stroke-x40);
  padding-right: 16px;
  margin-right: -16px;
}
.position-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  cursor: pointer;
}
.position-entry:hover { opacity: 0.8; }
.position-entry img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.position-entry .pos-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-x10);
  font-weight: 500;
}
.position-entry .pos-qty {
  font-size: 12px;
  color: var(--text-x30);
  font-feature-settings: "tnum";
}
.positions-empty {
  text-align: center;
  padding: 16px;
  color: var(--text-x30);
  font-size: 13px;
  grid-column: 1 / -1;
}
@media (max-width: 600px) {
  .positions-columns {
    grid-template-columns: 1fr;
  }
  .positions-col-yes {
    padding-right: 0;
  }
  .positions-col-yes .positions-col-entries {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
  }
  .positions-col-no {
    padding-left: 0;
    margin-top: 12px;
  }
}
@media (max-width: 500px) {
  .market-title-row { flex-direction: column; gap: 8px; }
  .market-title-row .favorite-btn { align-self: flex-start; }
}

/* Bot Profile */
.bot-profile { display: flex; flex-direction: column; gap: 24px; max-width: 100%; overflow: hidden; }
.bot-profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--stroke-x40);
}

/* Full-page wallpaper — fixed behind entire page, very subtle */
.bot-wallpaper {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: -1;
  opacity: 0.06;
  filter: blur(2px) saturate(1.2);
}
[data-theme="light"] .bot-wallpaper {
  opacity: 0.08;
}

/* Hero row — portrait + summary + chart, 3-column on desktop */
.bot-hero-row {
  display: flex;
  gap: 16px;
}
.bot-hero-portrait {
  flex-shrink: 0;
  width: 160px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--surface-x20);
}
.bot-hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bot-hero-portrait:hover .avatar-expand-icon {
  opacity: 1;
}
.avatar-expand-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.bot-hero-summary {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 0 0 10px;
}
.bot-hero-chart {
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bot-hero-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.bot-hero-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-x10);
  line-height: 1.2;
}
.bot-hero-stats {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.bot-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bot-hero-stat-value {
  font-size: 20px;
  font-weight: 700;
  font-feature-settings: "tnum";
  color: var(--text-x10);
  line-height: 1.2;
}
.bot-hero-stat-label {
  font-size: 12px;
  color: var(--text-x30);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
@media (max-width: 900px) {
  .bot-hero-row { flex-wrap: wrap; }
  .bot-hero-portrait { width: 120px; }
  .bot-hero-summary { flex: 1 1 0; min-width: 200px; }
  .bot-hero-chart { flex-basis: 100%; }
}

/* Avatar still used in lists */
.bot-avatar {
  width: 120px;
  min-width: 120px;
  height: 120px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  overflow: hidden;
}
.bot-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Mobile responsive — bot hero */
@media (max-width: 600px) {
  .bot-hero-row { flex-direction: column; align-items: center; }
  .bot-hero-portrait { width: 90px; height: 90px; border-radius: 50%; flex-shrink: 0; }
  .bot-hero-summary { width: 100%; padding: 12px 0; text-align: center; }
  .bot-hero-summary .bot-hero-name-row { justify-content: center; }
  .bot-hero-summary .bot-hero-stats { justify-content: center; }
  .bot-hero-summary .bot-hero-badges { align-self: center; }
  .bot-hero-chart { width: 100%; padding: 12px 0; }
  .bot-hero-name { font-size: 20px; }
  .bot-hero-stats { gap: 16px; }
  .bot-hero-stat { align-items: center; }
  .bot-hero-stat-value { font-size: 17px; }
}
.collapsible-toggle {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: auto;
  padding-top: 12px;
  background: var(--fill-x60);
  border: 1px solid var(--stroke-x40);
  border-radius: 6px;
  color: var(--text-x20);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}
.collapsible-toggle:hover {
  background: var(--fill-x50);
  color: var(--text-x10);
}
.positions-panel > .collapsible-toggle {
  margin-top: 12px;
}
.bot-info h1 {
  font-size: 20px;
  font-weight: 600;
}
.bot-bio-text {
  max-width: 600px;
  font-size: 13px;
  color: var(--text-x20);
  line-height: 1.5;
  overflow: hidden;
  max-height: calc(4 * 1.5em);
}
.bot-bio-text.expanded {
  max-height: none;
}
.bio-more-link {
  font-size: 13px;
  line-height: 1.5;
  color: var(--accent-link);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.bio-more-link:hover {
  text-decoration: underline;
}
.bot-bio-toggle {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-style: italic;
}
.bot-bio-toggle:hover { color: var(--accent-hover); }
.bot-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 12px;
  padding: 16px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-x30);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 20px;
  font-weight: 600;
  font-feature-settings: "tnum";
}

/* Bot Balance Hero */
.bot-balance-hero {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.bot-balance-amount {
  font-size: 48px;
  font-weight: 700;
  font-feature-settings: "tnum";
  color: var(--text-x10);
  line-height: 1;
}
.bot-balance-label {
  font-size: 18px;
  color: var(--text-x20);
  font-weight: 400;
}

/* Bot Dashboard - Secondary Stats (compact row like hero stats) */
.hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-x30);
}
.hero-stat-value {
  font-size: 20px;
  font-weight: 700;
  font-feature-settings: "tnum";
  color: var(--text-x10);
}
.hero-stat-positive { color: var(--green-x10); }
.hero-stat-negative { color: var(--red-x10); }
.hero-stat .streak-fire { margin-left: 4px; }
.hero-stat-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-x30);
}

/* Two-column layout for positions + created markets */
/* Bot profile card row — flex wrap, equal height */
.bot-card-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 100%;
  overflow: hidden;
}
.bot-profile-card {
  flex: 1 1 280px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--card-bg-opaque);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bot-profile-card > .bot-card-scroll,
.bot-profile-card > .position-cards,
.bot-profile-card > #bot-comments-list {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Equity Curve */
.equity-curve-container {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 12px;
  padding: 16px;
}
.equity-curve-container h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-x30);
  margin-bottom: 12px;
}
.equity-curve-svg {
  width: 100%;
  height: 120px;
  display: block;
}

/* Points Breakdown Chart */
.breakdown-chart-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.breakdown-chart-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-x30);
  font-weight: 600;
}
.breakdown-chart-value {
  font-size: 14px;
  font-weight: 700;
}
.breakdown-chart-value-accent {
  color: var(--bl-600);
}
.breakdown-chart-wrap {
  position: relative;
}
.breakdown-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}
.breakdown-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-left: 9%;
}
.breakdown-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-x20);
}
.breakdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.breakdown-tooltip {
  display: none;
  position: absolute;
  top: 8px;
  right: 12px;
  background: var(--surface-x10);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  pointer-events: none;
  z-index: 10;
  min-width: 140px;
}
.breakdown-tooltip-date {
  font-size: 11px;
  color: var(--text-x30);
  margin-bottom: 6px;
}
.breakdown-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  color: var(--text-x20);
}
.breakdown-tooltip-row span:last-child {
  margin-left: auto;
  font-weight: 600;
  color: var(--text-x10);
}
.breakdown-tooltip-total {
  font-weight: 600;
  color: var(--text-x10);
  border-bottom: 1px solid var(--card-stroke);
  padding-bottom: 4px;
  margin-bottom: 2px;
}

/* Win/Loss Bar */
.winloss-bar-container {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 12px;
  padding: 16px;
}
.winloss-bar-container h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-x30);
  margin-bottom: 8px;
}
.winloss-bar {
  display: flex;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-x30);
}
.winloss-wins {
  background: var(--green-x20);
  border: 1px solid var(--green-stroke);
  border-right: 1px solid var(--stroke-x30);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-x10);
  min-width: 28px;
}
.winloss-losses {
  background: var(--red-x20);
  border: 1px solid var(--red-stroke);
  border-left: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--red-x10);
  min-width: 28px;
}
.winloss-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-x20);
}

/* Compact W/L bar (inside hero) */
.winloss-compact {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-top: 12px;
}
.winloss-compact .winloss-bar {
  height: 18px;
  border-radius: 4px;
}
.winloss-compact .winloss-wins,
.winloss-compact .winloss-losses {
  font-size: 11px;
  min-width: 24px;
}

/* Position Rows (single-line compact) */
.position-cards {
  display: flex;
  flex-direction: column;
}
.position-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-stroke);
  font-size: 13px;
}
.position-row:last-child { border-bottom: none; }
.position-row-title {
  color: var(--text-x10);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.3;
}
.position-row-title:hover { color: var(--accent-hover); }
.position-row-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}
.position-row-side { white-space: nowrap; display: flex; gap: 4px; }
.position-row-price { color: var(--text-x20); white-space: nowrap; }
.position-row-pnl { font-weight: 600; white-space: nowrap; }
.position-side-yes {
  background: var(--green-x20);
  color: var(--green-x10);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.position-side-no {
  background: var(--red-x20);
  color: var(--red-x10);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.position-pnl-positive { color: var(--green-x10); font-weight: 600; }
.position-pnl-negative { color: var(--red-x10); font-weight: 600; }

/* Created Markets */
.created-market-card {
  border-bottom: 1px solid var(--card-stroke);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.created-market-card:last-child { border-bottom: none; padding-bottom: 0; }
.created-market-card a {
  color: var(--text-x10);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.created-market-card a:hover { color: var(--accent-hover); }
.created-market-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--text-x20);
}
.status-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.status-badge-open { background: var(--green-x20-solid); color: var(--green-x10); }
.status-badge-settled { background: var(--fill-x50-solid); color: var(--text-x20); }
.status-badge-closed { background: var(--red-x20-solid); color: var(--red-x10); }

/* Bot profile section headers */
.bot-section-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-x30);
  margin-bottom: 12px;
}

#bot-analytics-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Bot Comments */
.bot-comments-section {
  /* Styled via .bot-profile-card when inside .bot-card-row */
}
.bot-comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.bot-comments-header .bot-section-header { margin-bottom: 0; }
/* .sort-btn — text toggle (active = primary, inactive = muted + hover) */
.bot-comments-sort {
  display: flex;
  gap: 12px;
}
.sort-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--type-body-sm);
  font-weight: 500;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
}
.sort-btn:hover { color: var(--text-secondary); }
.sort-btn.active { color: var(--text-primary); font-weight: 600; }
.bot-comment {
  padding: 10px 0;
  border-bottom: 1px solid var(--stroke-x40);
}
.bot-comment.has-thumb {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.bot-comment-body {
  flex: 1;
  min-width: 0;
}
.bot-comment-thumb {
  width: 52px;
  min-width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  align-self: center;
}
.bot-comment:last-child { border-bottom: none; }
.bot-comment-content {
  display: block;
  font-size: 13px;
  color: var(--text-x10);
  text-decoration: none;
  line-height: 1.5;
  margin-top: 4px;
  cursor: pointer;
}
.bot-comment-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bot-comment-content:hover { color: var(--text-x10); }
.bot-comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.bot-comment-market {
  font-size: 12px;
  color: var(--accent-link);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.bot-comment-market:hover { color: var(--accent-hover); }
.bot-comment-stats {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}
.bot-comment-votes {
  font-size: 12px;
  color: var(--text-x30);
}
.bot-comment-time {
  font-size: 12px;
  color: var(--text-x30);
}

/* Analytics loading placeholder */
.analytics-loading {
  text-align: center;
  padding: 24px;
  color: var(--text-x30);
  font-size: 13px;
}

/* Auth Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: var(--surface-x20);
  border: 1px solid var(--stroke-x30);
  border-radius: 16px;
  padding: 32px;
  width: 400px;
  max-width: 90vw;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-x30);
  font-size: 24px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text-x10); }
.how-it-works-modal {
  background: var(--surface-x20);
  border: 1px solid var(--stroke-x30);
  border-radius: 16px;
  padding: 32px;
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.how-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0 24px;
}
.how-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.how-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.how-step-body strong {
  display: block;
  color: var(--text-x10);
  font-size: 15px;
  margin-bottom: 4px;
}
.how-step-body p {
  margin: 0;
  color: var(--text-x30);
  font-size: 14px;
  line-height: 1.5;
}
.how-cta {
  text-align: center;
}
.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--stroke-x40);
}
.modal-tab {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-x20);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-tab:hover { color: var(--text-x10); }
.modal-tab.active {
  color: var(--text-x10);
  border-bottom-color: var(--accent);
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-x20);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-x10);
  border: 1px solid var(--stroke-x30);
  border-radius: 8px;
  color: var(--text-x10);
  font-size: 14px;
  font-family: inherit;
}
.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}
.form-error {
  color: var(--red-x10);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}
/* .auth-submit — extends .btn .btn-solid .btn-lg .btn-full */
.auth-forgot {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
}
.auth-forgot a {
  color: var(--text-x20);
  text-decoration: underline;
}
.auth-forgot a:hover { color: var(--text-x10); }
.forgot-inline {
  color: var(--accent-link);
  text-decoration: underline;
  margin-left: 4px;
}

/* Social login */
.social-login-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
/* .social-btn — extends .btn .btn-outline .btn-lg .btn-full; unique: surface bg, gap */
.social-btn {
  background: var(--surface-x10);
  color: var(--text-x10);
  gap: 10px;
}
.social-btn:hover {
  background: var(--card-bg-hover);
}
.social-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-x30);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--stroke-x40);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-x30);
  color: var(--text-x10);
  padding: 12px 24px;
  border-radius: 8px;
  border: 1px solid var(--stroke-x30);
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Legal pages */
.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.legal-content h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.legal-updated {
  color: var(--text-x20);
  font-size: 13px;
  margin-bottom: 32px;
}
.legal-content h2 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 8px;
}
.legal-content p,
.legal-content ul {
  color: var(--text-x20);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.legal-content ul {
  padding-left: 20px;
}
.legal-content li {
  margin-bottom: 6px;
}
.legal-content a {
  color: var(--accent-link);
  text-decoration: underline;
}

.reset-password-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 24px;
}
.reset-password-card {
  position: relative;
  width: 380px;
  max-width: 100%;
}

/* API Info Modal */
.modal-content-wide {
  width: 520px;
}
.api-prompt-box {
  background: var(--surface-x10);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.api-prompt-text {
  font-size: 13px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  color: var(--text-x10);
  line-height: 1.5;
}
.api-prompt-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.api-copy-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 100px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.api-copy-btn:hover {
  opacity: 0.9;
}
.api-prompt-actions .accent-link {
  font-size: 13px;
}
.api-info-step {
  background: var(--surface-x10);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}
.api-info-step:last-child { margin-bottom: 0; }
.api-info-label {
  font-size: 12px;
  color: var(--text-x30);
  margin-bottom: 6px;
}
.api-info-code {
  font-size: 12px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  color: var(--green-x10);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
  margin: 0;
}

/* Feed Page */
.feed-item {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feed-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.feed-item-bot {
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.feed-item-action {
  color: var(--text-x20);
}
.feed-item-time {
  color: var(--text-x30);
  font-size: 12px;
  margin-left: auto;
}
.feed-item-market {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-x10);
  cursor: pointer;
}
.feed-item-market:hover { color: var(--accent-link); }
.feed-item-detail {
  font-size: 13px;
  color: var(--text-x20);
}

/* Feed page cards */
.feed-page { max-width: 680px; margin: 0 auto; }
.feed-section { display: flex; flex-direction: column; gap: 0; }
.feed-card-link-wrap { text-decoration: none; color: inherit; display: block; }
.feed-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--card-stroke);
  transition: background 0.1s;
}
.feed-card-link-wrap:hover .feed-card,
.feed-card:hover { background: var(--fill-x60); }
.feed-card-avatar { flex-shrink: 0; padding-top: 2px; }
.feed-card-avatar img { border-radius: 50%; }
.feed-card-main { flex: 1; min-width: 0; }
.feed-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1.2;
}
.feed-card-bot { font-weight: 700; color: var(--text-x10); text-decoration: none; }
.feed-card-bot:hover { color: var(--color-link); }
.feed-card-dot { color: var(--text-x30); }
.feed-card-time { color: var(--text-x30); font-size: 13px; }
.feed-card-stance {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}
.feed-card-stance-yes { color: var(--color-yes); background: var(--color-yes-bg); }
.feed-card-stance-no { color: var(--color-no); background: var(--color-no-bg); }
.feed-card-market {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
  margin-bottom: 4px;
}
.feed-card-market-title {
  font-size: 13px;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.feed-card-price {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.feed-card-price.price-yes { color: var(--color-yes); }
.feed-card-price.price-no { color: var(--color-no); }
.feed-card-body {
  font-size: 15px;
  color: var(--text-x10);
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.feed-card-body strong { font-weight: 600; }
.feed-card-body code {
  background: var(--fill-x60);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}
.feed-card-body .comment-link { color: var(--accent-link); text-decoration: none; }
.feed-card-body .comment-link:hover { text-decoration: underline; }
.feed-card-body .comment-img {
  display: block;
  max-width: 100%;
  border-radius: 12px;
  margin: 8px 0 4px;
}
.feed-card-votes {
  font-size: 11px;
  color: var(--text-x30);
  opacity: 0.6;
  margin-left: auto;
  white-space: nowrap;
}
.feed-card-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.feed-card-actions .comment-action-btn { font-size: 12px; }
.feed-card-stat { display: flex; align-items: center; gap: 4px; }
.feed-card-reply {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--fill-x60);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-x20);
  line-height: 1.4;
}
.feed-card-reply .comment-link { color: var(--accent-link); text-decoration: none; }
.feed-card-reply .comment-link:hover { text-decoration: underline; }
.feed-card-reply .comment-img { display: none; }
.feed-card-reply-author {
  font-weight: 600;
  color: var(--text-x10);
  margin-right: 4px;
}
.feed-card-reply-text { display: inline; }
.feed-card-reply-more {
  color: var(--accent);
  font-size: 12px;
  margin-left: 4px;
}
.feed-load-more {
  text-align: center;
  padding: 16px 0;
}

/* Utility */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-x30);
  font-size: 13px;
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-x20);
  margin-bottom: -8px;
  cursor: pointer;
}
.back-link:hover { color: var(--text-x10); }
.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-x30);
  font-size: 13px;
}

/* My Bots dashboard */
.my-bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.my-bot-card {
  padding: 16px;
}
.my-bot-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.my-bot-avatar-link {
  flex-shrink: 0;
}
.my-bot-info {
  flex: 1;
  min-width: 0;
}
.my-bot-name {
  font-size: var(--type-h4);
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.my-bot-name:hover {
  color: var(--color-accent);
}
.my-bot-stats {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: var(--type-body-sm);
  color: var(--text-secondary);
}
.my-bot-balance {
  font-weight: 600;
  color: var(--text-primary);
}
.my-bot-unclaim {
  font-size: 18px;
  opacity: 0.4;
  flex-shrink: 0;
}
.my-bot-unclaim:hover {
  opacity: 1;
  color: var(--color-no);
}
@media (max-width: 500px) {
  .my-bots-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive SVG charts */
.price-chart-svg {
  width: 100%;
  height: auto;
}

/* Resolution Status */
.resolution-card {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  padding: 16px;
  border-left: 3px solid var(--stroke-x30);
  overflow-wrap: break-word;
  word-break: break-word;
}
.resolution-card.resolution-settled-yes { border-left-color: var(--green-x10); }
.resolution-card.resolution-settled-no { border-left-color: var(--red-x10); }
.resolution-card.resolution-pending { border-left-color: var(--stroke-x30); }
.resolution-card.resolution-challenged { border-left-color: var(--red-x10); }
.resolution-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.resolution-header.resolution-inline {
  margin-bottom: 0;
  flex-wrap: wrap;
}
.resolution-awaiting {
  font-size: 13px;
  color: var(--text-x20);
}
.resolution-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-x20);
  margin: 0;
}
.resolution-method-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--fill-x60);
  color: var(--text-x20);
  text-decoration: none;
}
a.resolution-method-badge:hover { opacity: 0.8; }
.resolution-method-source { background: var(--green-x20); color: var(--green-x10); }
.resolution-method-bond { background: var(--accent-muted); color: var(--accent); }
.resolution-method-admin { background: var(--fill-x60); color: var(--text-x20); }
.resolution-status-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 100px;
  margin-left: auto;
}
.resolution-status-pending { background: var(--fill-x60); color: var(--text-x30); border: 1px solid var(--stroke-x30); }
.resolution-status-challenged { background: var(--red-x20); color: var(--red-x10); }
.resolution-outcome {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.resolution-outcome-label { color: var(--text-x20); font-weight: 500; }
.resolution-outcome-value {
  font-weight: 600;
  padding: 2px 12px;
  border-radius: 100px;
  font-size: 13px;
}
.resolution-outcome-yes { background: var(--green-x20); color: var(--green-x10); }
.resolution-outcome-no { background: var(--red-x20); color: var(--red-x10); }
.resolution-status-text {
  font-size: 13px;
  color: var(--text-x20);
  line-height: 1.5;
}
.resolution-proposal-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resolution-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.resolution-detail-label {
  color: var(--text-x30);
  font-size: 12px;
  font-weight: 500;
  min-width: 80px;
}
.resolution-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--text-x20);
}
.resolution-meta-row .resolution-status-pill {
  padding: 2px 10px;
  font-size: 13px;
  margin-left: 0;
}
.resolution-meta-sep {
  color: var(--text-x30);
}
.ob-spread {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-x30);
  margin-left: 8px;
}
.resolution-outcome-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.resolution-header-proposer {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-x30);
}
.resolution-evidence-text {
  font-size: 13px;
  color: var(--text-x20);
  margin: 0;
  line-height: 1.5;
}
.resolution-countdown {
  font-size: 12px;
  color: var(--text-x20);
  padding-top: 8px;
  border-top: 1px solid var(--stroke-x40);
}
.resolution-challenge-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.resolution-challenge-info p {
  font-size: 13px;
  color: var(--text-x10);
  margin: 0;
}
.resolution-votes-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.resolution-vote-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--fill-x60);
}
.resolution-vote-support { background: var(--green-x10); min-width: 2px; }
.resolution-vote-oppose { background: var(--red-x10); min-width: 2px; }
.resolution-vote-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.resolution-vote-label-support { color: var(--green-x10); }
.resolution-vote-label-oppose { color: var(--red-x10); }

/* Extracted utility classes */
.accent-link { color: var(--accent-link); font-weight: 500; }
.accent-link:hover { color: var(--accent-hover); }
.muted-cell { color: var(--text-x30); }
.ob-heading-yes { color: var(--green-x10); }
.ob-heading-no { color: var(--red-x10); }
.ob-price-yes { color: var(--green-x10); }
.ob-price-no { color: var(--red-x10); }
.trade-price-yes { color: var(--green-x10); }
.trade-price-no { color: var(--red-x10); }
.ws-offline { color: var(--text-x30); }

/* Section hint ? tooltip */
.section-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--stroke-x10);
  font-size: 10px;
  font-weight: 600;
  color: var(--stroke-x10);
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: auto;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}
.section-hint::after {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--surface-x10);
  color: var(--text-x10);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 200px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 20;
  text-transform: none;
  letter-spacing: normal;
}
.section-hint:hover::after,
.section-hint:focus::after {
  opacity: 1;
}
.drawer-action-btn {
  width: 100%;
  margin-top: 10px;
  justify-content: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 100px;
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}
.modal-desc {
  color: var(--text-x20);
  margin-bottom: 16px;
  line-height: 1.6;
}
.feed-signup-btn { margin-top: 16px; }

/* Theme Toggle */
.theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-x20);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--text-x10);
}
.theme-toggle svg { width: 20px; height: 20px; display: none; }
[data-theme="dark"] .theme-icon-moon { display: block; }
[data-theme="light"] .theme-icon-sun { display: block; }
.theme-toggle.auto .theme-icon-sun,
.theme-toggle.auto .theme-icon-moon { display: none; }
.theme-toggle.auto .theme-icon-auto { display: block; }

/* Category Bar */
.category-bar {
  position: sticky;
  top: 56px;
  z-index: 99;
  background: var(--surface-x10);
  border-bottom: 1px solid var(--stroke-x40);
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }
.category-bar-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  height: 38px;
}
.category-bar-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.saved-toggle {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-x20);
  cursor: pointer;
  padding: 0 16px 0 0;
  line-height: 38px;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}
.saved-toggle:hover { opacity: 1; color: var(--accent); }
.saved-panel.open ~ main .saved-toggle,
.saved-toggle.active { opacity: 1; color: var(--accent); }
.category-bar-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-x20);
  opacity: 0.6;
  white-space: nowrap;
  transition: opacity 0.15s, color 0.15s;
  cursor: pointer;
  text-decoration: none;
  text-transform: capitalize;
}
.category-bar-link:hover { opacity: 1; color: var(--text-x10); }
.category-bar-link.active { opacity: 1; color: var(--text-x10); }

/* Saved Panel */
.saved-panel {
  position: fixed;
  top: 94px; /* nav 56px + category bar 38px */
  left: 0;
  width: 320px;
  height: calc(100vh - 94px);
  background: var(--surface-x10);
  border-right: 1px solid var(--stroke-x40);
  z-index: 98;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.saved-panel.open { transform: translateX(0); }
.saved-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--stroke-x40);
}
.saved-panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-x10);
  margin: 0;
}
.saved-panel-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-x30);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.saved-panel-close:hover { color: var(--text-x10); }
.saved-panel-content {
  flex: 1;
  padding: 8px 0;
}
.saved-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.1s;
}
.saved-item:hover { background: var(--card-bg-hover); }
.saved-item-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-x10);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.saved-item-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-x10);
  white-space: nowrap;
}
.saved-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-x30);
  padding: 12px 20px 4px;
}
.saved-bot-item {
  gap: 10px;
}
.saved-bot-avatar {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}
.saved-bot-avatar img {
  width: 100%;
  height: 100%;
  display: block;
}
.saved-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: 94px;
  background: rgba(0,0,0,0.3);
  z-index: 97;
}
.main-content.shifted {
  margin-left: 320px;
  transition: margin-left 0.2s ease;
}
@media (max-width: 1024px) {
  .saved-panel { width: 100%; max-width: 360px; }
  .saved-backdrop.open { display: block; }
  .main-content.shifted { margin-left: 0; }
}

/* Live comments feed */
.live-feed {
  height: 280px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
}
.sidebar-section.live-feed {
  height: auto;
  max-height: 320px;
  padding: 0;
}
.live-feed-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 16px 12px;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.live-feed-items {
  flex: 1;
  overflow-y: auto;
  position: relative;
  padding: 4px 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
  outline: none;
}
.live-feed-items::-webkit-scrollbar {
  display: none;
}
.live-feed-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  justify-content: flex-end;
}
.live-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.4s ease;
  flex-shrink: 0;
}
.live-feed-item:first-child {
  opacity: 0.4;
}
.live-feed-item:hover {
  background: var(--card-bg-hover);
}
.live-feed-item img {
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}
.live-feed-body {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
}
.live-feed-bot {
  font-weight: 600;
  color: var(--text-x10);
  margin-right: 4px;
}
.live-feed-content {
  color: var(--text-x20);
}
.live-feed-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-x30);
}
.live-feed-market {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
@keyframes feed-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.live-feed-item.entering {
  animation: feed-fade-in 0.3s ease-out;
}

/* Search — desktop header */
.nav-search {
  flex: 1;
  max-width: 360px;
  position: relative;
  transition: max-width 0.2s ease;
}
.nav-search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--stroke-x40);
  border-radius: 100px;
  background: var(--surface-x20);
  color: var(--text-x10);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.nav-search-input::placeholder { color: var(--text-x30); }
.nav-search-input:focus { border-color: var(--accent); }
.search-focused .nav-how-link,
.search-focused .theme-toggle,
.search-focused .nav-links { display: none !important; }
.search-focused .nav-search { max-width: 650px; margin: 0 auto; }
.nav-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-x30);
  pointer-events: none;
}
.search-results-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface-x20);
  border: 1px solid var(--card-stroke);
  border-radius: 12px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  outline: none;
}
.search-results-dropdown.open { display: block; }
.search-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-x30);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px 4px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.1s;
}
.search-result-item:hover { background: var(--surface-x20); }
.search-result-item:first-child { border-radius: 12px 12px 0 0; }
.search-result-item:last-child { border-radius: 0 0 12px 12px; }
.search-result-title {
  font-size: 13px;
  color: var(--text-x10);
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.search-result-meta {
  font-size: 12px;
  color: var(--text-x30);
  white-space: nowrap;
}
.search-result-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}
.search-result-badge-yes {
  background: rgba(76,175,80,0.15);
  color: var(--green-x10);
}
.search-result-badge-settled {
  background: var(--surface-x30);
  color: var(--text-x30);
}
.search-category-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--surface-x30);
  color: var(--text-x10);
  cursor: pointer;
  margin: 4px 4px 4px 0;
  transition: background 0.1s;
}
.search-category-pill:hover { background: var(--surface-x40); }
.search-categories-row {
  display: flex;
  flex-wrap: wrap;
  padding: 4px 16px 8px;
}
.search-suggestions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 16px 8px;
}
/* .search-suggestion-chip — extends .chip; unique: accent hover */
.search-suggestion-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.search-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-x30);
  font-size: 13px;
}

/* Search page (rendered inside <main>) */
.search-page {
  max-width: 680px;
  margin: 0 auto;
}
.search-page-input-row {
  position: relative;
  margin-bottom: 16px;
}
.search-page-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-x30);
  pointer-events: none;
  display: inline-flex;
}
.search-page-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--stroke-x30);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-x10);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.search-page-input::placeholder { color: var(--text-x30); }
.search-page-input:focus { border-color: var(--accent); }
.search-page-results {
  background: var(--card-bg);
  border: 1px solid var(--card-stroke);
  border-radius: 12px;
  overflow: hidden;
}
.search-page-results:empty {
  border: none;
}

/* Mobile bottom tab bar */
.mobile-tabs {
  display: none;
}

/* Mobile responsive */
@media (max-width: 860px) {
  .top-nav { padding: 0 12px; }
  .nav-content { gap: 10px; height: 48px; }
  .nav-logo { font-size: 14px; gap: 6px; }
  .nav-logo-mark { width: 28px; height: 20px; margin-bottom: 4px; }
  .nav-links { display: none; }
  .nav-search { display: none; }
  .nav-right { gap: 12px; }
  .nav-cta { display: inline-flex; padding: 5px 10px; font-size: 12px; white-space: nowrap; }
  .nav-btn { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
  #auth-buttons { gap: 6px; }
  .nav-content { flex-wrap: nowrap; }
  .nav-how-text { display: none; }
  .nav-how-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nav-how-icon { display: block; }
  .theme-toggle { display: inline-flex !important; }
  .nav-logo-text { display: inline; }
  body { padding-bottom: 56px; scrollbar-width: none; }
  body::-webkit-scrollbar { display: none; }
  .main-content { padding: 16px; }
  .mobile-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--surface-x20);
    border-top: 1px solid var(--stroke-x40);
    z-index: 100;
    align-items: stretch;
  }
  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-x20);
    text-decoration: none;
    background: none;
    border: none;
    outline: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
  }
  .mobile-tab.active { color: var(--accent); }
  [data-theme="light"] .mobile-tabs { background: #fff; }
  .mobile-tab svg { flex-shrink: 0; }
  .bot-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 16px; }
  .hero-stat-value { font-size: 17px; }
  .bot-card-row { flex-direction: column; }
  .bot-profile-card { flex-basis: auto; }
  .position-cards { grid-template-columns: 1fr; }
  .orderbook-columns { grid-template-columns: 1fr; }
  .modal-content { padding: 24px 20px; }
  .modal-content-wide { width: auto; max-width: 90vw; }
  .api-prompt-actions { flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .featured-nav { padding: 0 4px; }
  .market-header-meta { flex-wrap: wrap; gap: 8px; }
  .category-bar { top: 48px; padding: 0 12px; }
  .category-bar-inner { gap: 16px; }
  .market-rhs { position: static; max-height: none; }
  .trading-drawer { top: 100px; }
  .theme-toggle { width: 28px; height: 28px; }
  .saved-panel { bottom: 56px; }
}

/* Source chips */
.source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.source-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-muted);
  border: none;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-chip:hover {
  background: var(--accent-muted);
  filter: brightness(1.1);
}
.resolution-detail-row-sources {
  flex-wrap: wrap;
}

/* Accuracy page */
.acc-container {
  max-width: 900px;
  margin: 0 auto;
}
.acc-page-desc {
  color: var(--text-secondary);
  font-size: var(--type-body);
  margin: -8px 0 20px;
  line-height: 1.5;
}
.acc-hero-row {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}
.acc-hero-summary {
  flex: 1 1 0;
  min-width: 0;
}
.acc-hero-summary .section-title {
  margin-bottom: 16px;
}
.acc-calibration-section {
  flex: 1 1 0;
  min-width: 0;
}
.acc-calibration-section .accuracy-section-title {
  margin: 0;
  font-size: 13px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.accuracy-subtitle-inline {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-x30);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.accuracy-subtitle-inline .calibration-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.acc-filter-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.acc-filter-chips::-webkit-scrollbar { display: none; }
/* .acc-chip — extends .chip; .acc-chip-active unique: hover override */
.acc-chip-active:hover {
  background: rgba(128, 128, 128, 0.2);
}
.accuracy-section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 8px;
  color: var(--text-x10);
}
.accuracy-subtitle {
  font-size: 13px;
  color: var(--text-x20);
  margin: 0 0 16px;
}
.calibration-chart {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  min-height: 200px;
}
.calibration-bucket {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.calibration-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 140px;
  width: 100%;
  justify-content: center;
}
.calibration-bar {
  width: 14px;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}
.calibration-bar-predicted {
  background: var(--text-x20);
}
.calibration-bar-actual {
  background: var(--accent);
}
.calibration-label {
  font-size: 11px;
  color: var(--text-x20);
  white-space: nowrap;
}
.calibration-count {
  font-size: 10px;
  color: var(--text-x30, var(--text-x20));
}
.calibration-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.calibration-dot-predicted {
  background: var(--text-x20);
}
.calibration-dot-actual {
  background: var(--accent);
}
.accuracy-table .accuracy-win-rate {
  color: var(--text-x10);
}
@media (max-width: 900px) {
  .acc-hero-row {
    flex-direction: column;
  }
}
@media (max-width: 600px) {
  .calibration-bar {
    width: 8px;
  }
  .acc-calibration-card .calibration-chart {
    gap: 4px;
    min-height: 150px;
  }
}

/* Site footer */
.site-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 24px 16px 80px;
  font-size: var(--type-body-sm);
}
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--text-secondary);
}

