/* Polymarket Clone - Extracted from true-visual-sync React Design */
/* All styles converted from Tailwind to pure CSS */

/* === Global Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Color Variables – light theme === */
:root {
  /* Main Colors */
  --background: #ffffff;
  --foreground: #111827;

  /* Card Colors */
  --card: #ffffff;
  --card-foreground: #111827;

  /* Button Colors */
  --primary: #3b82f6;
  --primary-foreground: #ffffff;

  --secondary: #f3f4f6;
  --secondary-foreground: #374151;

  /* Status Colors */
  --success: #16a34a;
  --success-foreground: #ffffff;

  --destructive: #dc2626;
  --destructive-foreground: #ffffff;

  /* Text Colors */
  --muted: #f9fafb;
  --muted-foreground: #6b7280;

  /* Borders */
  --border: #e5e7eb;
  --input: #e5e7eb;

  /* Radius */
  --radius: 0.5rem;
}

/* === Base Styles === */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Header Styles === */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
}

.header-container {
  max-width: 1536px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Row 1: Top Bar */
.header-top-bar {
  border-bottom: 1px solid var(--border);
}

.header-top-bar .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.logo-section {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-icon {
  height: 8rem;
  width: auto;
  display: block;
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.usa-flag {
  display: flex;
  height: 1.25rem;
  width: 1.875rem;
  overflow: hidden;
  border-radius: 0.1875rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Main Search */
.main-search-container {
  flex: 1;
  max-width: 28rem;
  margin: 0 2rem;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
}

.main-search-input {
  width: 100%;
  height: 2.25rem;
  padding: 0 2.5rem 0 2.5rem;
  background-color: rgba(var(--secondary-rgb, 49, 60, 72), 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.main-search-input:focus {
  border-color: var(--primary);
}

.main-search-input::placeholder {
  color: var(--muted-foreground);
}

.search-kbd {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  background-color: rgba(var(--muted-rgb, 49, 60, 72), 0.5);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  color: var(--muted-foreground);
  font-family: monospace;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === Button Styles === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  outline: none;
}

.btn-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  background-color: var(--secondary);
  color: var(--foreground);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background-color: #2563eb;
}

.btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
}

.btn-icon-sm {
  padding: 0;
  width: 2rem;
  height: 2rem;
  background: transparent;
  color: var(--muted-foreground);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.btn-icon-sm:hover {
  background-color: var(--secondary);
  color: var(--foreground);
}

.btn-icon-left {
  margin-right: 0.375rem;
}

/* Row 2: Categories */
.categories-row {
  border-top: 1px solid var(--border);
}

.categories-row .header-container {
  height: 2.75rem;
}

.categories-list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.categories-list::-webkit-scrollbar {
  display: none;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}

.category-btn:hover {
  color: var(--foreground);
}

.category-btn-active {
  font-weight: 500;
  color: var(--foreground);
}

.category-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Row 3: All markets bar */
.all-markets-row {
  border-top: 1px solid var(--border);
}

.all-markets-row .header-container {
  padding-top: 0;
  padding-bottom: 0;
}

.all-markets-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 2.75rem;
  overflow: hidden;
}

.all-markets-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
}

.markets-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Topic Pills */
.topic-pills {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.topic-pills::-webkit-scrollbar { display: none; }

.topic-pill {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  background-color: var(--secondary);
  color: var(--muted-foreground);
  border: 1px solid transparent;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.topic-pill:hover {
  background-color: #e5e7eb;
  color: var(--foreground);
}

.topic-pill-active {
  background-color: var(--foreground);
  color: var(--background);
  font-weight: 500;
}

/* === Main Content === */
.main-content {
  max-width: 1536px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* === Market Grid === */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
  max-width: 1400px;
}

/* === Market Card === */
.market-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.market-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Market badge styling */
.market-badge {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.5rem;
  display: inline-block;
}

/* Timeframe text styling */
.timeframe-text {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-title-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.market-category {
  background: var(--muted);
  color: var(--muted-foreground);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
  width: fit-content;
}

.market-image {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  object-fit: cover;
}

.volume-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-icon-container {
  width: 2.5rem;
  height: 2.5rem;
  background-color: #f3f4f6;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.card-icon {
  font-size: 1.25rem;
}

.card-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--foreground);
}

/* === Market Outcomes === */
.outcomes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.outcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.outcome-name {
  font-size: 0.875rem;
  color: var(--foreground);
}

.outcome-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.outcome-percent {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--foreground);
  min-width: 3rem;
  text-align: center;
}

.outcome-buttons {
  display: flex;
  gap: 0.25rem;
}

.btn-trade {
  padding: 0.375rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-yes {
  background-color: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.btn-yes:hover {
  background-color: rgba(34, 197, 94, 0.3);
}

.btn-no {
  background-color: rgba(239, 68, 68, 0.2);
  color: var(--destructive);
}

.btn-no:hover {
  background-color: rgba(239, 68, 68, 0.3);
}

/* === Card Footer === */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.volume-text {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-gift,
.icon-bookmark {
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color 0.2s;
}

.icon-gift:hover,
.icon-bookmark:hover {
  color: var(--foreground);
}

/* === Footer === */
.footer {
  background-color: #f9fafb;
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1536px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.footer-content a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-content a:hover {
  color: var(--foreground);
}

.footer-divider {
  margin: 0 0.5rem;
}

/* ══════════════════════════════════════════════════════════════════
   HERO SECTION
═══════════════════════════════════════════════════════════════════ */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 22rem;
  gap: 1.25rem;
  margin-bottom: 2rem;
  align-items: start;
}

.hero-featured { min-width: 0; }

/* Featured market card */
.featured-market-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem 1rem;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.featured-empty { justify-content: center; align-items: center; }

.featured-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.featured-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.featured-actions { display: flex; gap: 0.25rem; }

.featured-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.25;
}

.featured-outcomes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.featured-outcome-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.fo-name { font-size: 0.875rem; color: var(--foreground); min-width: 11rem; }
.fo-pct  { font-size: 0.875rem; font-weight: 700; color: var(--foreground); min-width: 3rem; text-align: right; }

.fo-bar-track {
  flex: 1;
  height: 4px;
  background: var(--secondary);
  border-radius: 9999px;
  overflow: hidden;
}
.fo-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
}

.fo-btns { display: flex; gap: 0.25rem; flex-shrink: 0; }

.featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.featured-vol { font-size: 0.875rem; color: var(--muted-foreground); font-weight: 500; }

.featured-tabs { display: flex; gap: 0.25rem; }
.ftab {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s;
}
.ftab:hover, .ftab-active {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}

/* Pagination dots */
.hero-dots {
  display: flex;
  gap: 0.375rem;
  justify-content: center;
  margin: 0.625rem 0 0;
}
.hero-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
}
.hero-dot-active { background: var(--primary); width: 18px; border-radius: 3px; }

/* Suggest pills */
.hero-suggest-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
  justify-content: space-between;
}
.hero-suggest-pill {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--secondary);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.hero-suggest-pill:hover { border-color: var(--primary); color: var(--primary); }
.hero-suggest-active { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.hero-suggest-active:hover { background: var(--foreground); color: var(--background); }

/* Sidebar */
.hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  min-width: 0;
}

.sidebar-promo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
}
.sidebar-promo-text {}
.sidebar-promo-title { font-size: 0.875rem; font-weight: 600; color: var(--foreground); }
.sidebar-promo-sub   { font-size: 0.75rem; color: var(--muted-foreground); margin-top: 0.125rem; }
.sidebar-promo-sub strong { color: var(--primary); }

.sidebar-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
}

.sidebar-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.sidebar-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Breaking news list */
.breaking-list { display: flex; flex-direction: column; gap: 0.625rem; }
.breaking-item {
  display: grid;
  grid-template-columns: 1.25rem 1fr auto;
  align-items: start;
  gap: 0.5rem;
}
.breaking-rank { font-size: 0.75rem; font-weight: 700; color: var(--muted-foreground); padding-top: 2px; }
.breaking-text { font-size: 0.8125rem; color: var(--foreground); line-height: 1.4; }
.breaking-odds { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.breaking-pct  { font-size: 0.875rem; font-weight: 700; color: var(--foreground); }
.breaking-change { font-size: 0.6875rem; font-weight: 600; }
.breaking-up   { color: #16a34a; }
.breaking-down { color: #dc2626; }

/* Hot topics list */
.hot-topics-list { margin-bottom: 0.625rem; }
.hot-topic-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.hot-rank { font-size: 0.75rem; font-weight: 700; color: var(--muted-foreground); width: 1rem; }
.hot-name { font-size: 0.875rem; font-weight: 600; color: var(--foreground); flex: 1; }
.hot-vol  { font-size: 0.75rem; color: var(--muted-foreground); }
.hot-arrow { color: var(--muted-foreground); font-size: 1rem; }
.sidebar-explore-link { font-size: 0.8125rem; color: var(--primary); text-decoration: none; font-weight: 500; }
.sidebar-explore-link:hover { text-decoration: underline; }

/* All markets section heading */
.all-markets-section { }
.all-markets-heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1rem;
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
═══════════════════════════════════════════════════════════════════ */

/* ── 1400px – 4-col to 3-col grid ─────────────────────────────── */
@media (max-width: 1400px) {
  .market-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── 1100px – sidebar collapses, 2-col grid ─────────────────────── */
@media (max-width: 1100px) {
  .hero-section {
    grid-template-columns: 1fr;
  }
  .hero-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .market-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 900px – hide some header elements ─────────────────────────── */
@media (max-width: 900px) {
  .main-search-container { max-width: 16rem; margin: 0 1rem; }
  .btn-ghost.btn-sm:first-child { display: none; } /* "How it works" */
}

/* ── 768px – mobile header ──────────────────────────────────────── */
@media (max-width: 768px) {
  .header-top-bar .header-container { flex-wrap: wrap; height: auto; padding: 0.625rem 1rem; gap: 0.5rem; }
  .logo-section { order: 1; }
  .header-actions { order: 2; margin-left: auto; }
  .main-search-container { order: 3; flex: 1 1 100%; max-width: 100%; margin: 0.25rem 0 0; }
  .search-kbd { display: none; }

  .hero-section { grid-template-columns: 1fr; }
  .hero-sidebar { grid-template-columns: 1fr 1fr; display: grid; }

  .pm-modal-box { flex-direction: column; width: min(30rem, 95vw); max-height: 95dvh; overflow-y: auto; }
  .pm-promo-panel { flex: none; min-height: 14rem; }
  .pm-phone-wrap  { display: none; }
  .pm-form-panel  { padding: 1.25rem 1.5rem 1rem; }
  .pm-wallet-grid { gap: 0.375rem; }
}

/* ── 640px – single-col grid, full-width cards ──────────────────── */
@media (max-width: 640px) {
  .market-grid { grid-template-columns: 1fr; }
  .hero-sidebar { grid-template-columns: 1fr; }
  .main-content { padding: 1rem 0.75rem; }
  .all-markets-row .all-markets-bar { gap: 0.5rem; }
  .all-markets-label { display: none; }
  .markets-actions .btn-icon-sm:not(:last-child) { display: none; }
  .featured-title { font-size: 1.125rem; }
  .fo-name { min-width: 7rem; }

  /* Login modal – hide promo panel, show form only */
  .pm-promo-panel { display: none !important; }
  .pm-modal-box   { width: min(26rem, 96vw); border-radius: 1.25rem; }
  .pm-form-panel  { width: 100%; flex: 1 1 auto; }
  .pm-form-heading p { font-size: 1.125rem; }
}

/* ── 480px – very small phones ─────────────────────────────────── */
@media (max-width: 480px) {
  .header-actions .btn-ghost { display: none; }
  .header-actions .btn-primary { display: inline-flex; }
  .categories-row .header-container { height: 2.5rem; }
  .btn { padding: 0.4rem 0.75rem; font-size: 0.8125rem; }
  .pm-wallet-grid { grid-template-columns: repeat(4, 1fr); }
  /* Login modal – full-width on very small phones */
  .pm-modal-box {
    width: 100%;
    max-width: 100%;
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 90dvh;
  }
  .pm-modal-overlay { align-items: flex-end; }
  .pm-email-form { height: auto; padding: 0; background: transparent; border: none; overflow: visible; }
  .pm-email-form:focus-within { box-shadow: none; }
  .pm-email-input {
    width: 100%; height: 3.25rem;
    padding: 0 0.875rem;
    background: #1f2430; border: 1px solid #2d3340;
    border-radius: 0.625rem; color: #f0f4f8; font-size: 1rem; outline: none;
  }
  .pm-email-form:focus-within .pm-email-input { border-color: #3b82f6; }
  .pm-email-btn-wrap { position: static; transform: none; margin-top: 0.5rem; }
  .pm-email-submit   { width: 100%; height: 3rem; border-radius: 0.75rem; font-size: 1rem; }
  .breaking-item { grid-template-columns: 1.25rem 1fr; }
  .breaking-odds { display: none; }
}

/* === Utility Classes === */
.hidden {
  display: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  scrollbar-width: none;
}

/* ══════════════════════════════════════════════════════════════════
   SYSTEM DARK THEME  (respects prefers-color-scheme automatically)
═══════════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
  :root {
    --background:          #0d1117;
    --foreground:          #f0f4f8;
    --card:                #161b22;
    --card-foreground:     #f0f4f8;
    --primary:             #3b82f6;
    --primary-foreground:  #ffffff;
    --secondary:           #21262d;
    --secondary-foreground:#c9d1d9;
    --muted:               #161b22;
    --muted-foreground:    #8b949e;
    --border:              #30363d;
    --input:               #30363d;
    --success:             #3fb950;
    --destructive:         #f85149;
  }

  .main-search-input { background-color: #0d1117; color: #f0f4f8; }

  /* pm- modal dark overrides are baked in (always dark), no extra rules needed */
  .pm-wallet-btn    { background: #1f2430 !important; border-color: #2d3340 !important; color: #9ca3af; }
  .pm-wallet-btn:hover { background: #2d3340 !important; border-color: #4b5563 !important; }
  .pm-form-footer   { border-top-color: #2d3340 !important; }
  .pm-footer-link   { color: #6b7280 !important; }
  .pm-footer-link:hover { color: #c9d1d9 !important; }

  .featured-market-card { background: #161b22; border-color: #30363d; }
  .sidebar-section { background: #161b22; border-color: #30363d; }
  .sidebar-promo-card { background: linear-gradient(135deg,#1e3a5f,#2a4a8f); border-color: #30363d; }
  .breaking-text { color: #c9d1d9; }
  .hot-topic-item { border-bottom-color: #21262d; }
  .footer { background-color: #161b22; }
  .search-kbd { background: #21262d; border-color: #30363d; }
  .market-card { background: #161b22; border-color: #30363d; }
  .topic-pill { background: #21262d; color: #8b949e; }
  .topic-pill:hover { background: #30363d; color: #f0f4f8; }
  .topic-pill-active { background: #f0f4f8; color: #0d1117; }
  .card-icon-container { background: #21262d; }
  .otp-digit { background: #21262d; border-color: #30363d; color: #f0f4f8; }
  .otp-digit:focus { border-color: #3b82f6; background: #0d1117; }
  body { background-color: #0d1117; color: #f0f4f8; }
}

/* === Modal Styles === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.60);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
}

.modal-content {
  background-color: #ffffff;
  border-radius: 1rem;
  padding: 2rem;
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

/* ══════════════════════════════════════════════════════════════════
   LOGIN MODAL  (exact Polymarket split-screen)
   Left panel: blue, 21.25rem wide (md:w-85 equivalent)
   Right panel: dark, 21.25rem wide
═══════════════════════════════════════════════════════════════════ */

/* Overlay */
.pm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal box – side-by-side on desktop */
.pm-modal-box {
  display: flex;
  flex-direction: row;
  width: min(42.5rem, 95vw);   /* 2 × 21.25rem */
  max-height: 95dvh;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}

/* ── Left: blue promo ──────────────────────────────────────────── */
.pm-promo-panel {
  flex: 0 0 21.25rem;
  width: 21.25rem;
  background: #3b82f6;   /* bg-blue-500 */
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 28rem;
  color: white;
}

/* Beam wrapper – fills entire panel */
.pm-beam-wrap {
  pointer-events: none;
  position: absolute;
  inset: 0;
  margin: -1.5rem;      /* counteract panel padding so SVG fills edge-to-edge */
}

/* Mobile beam: full-bleed, both axes flipped */
.pm-beam-mobile {
  transform: scaleX(-1) scaleY(-1);
  display: block;
}
.pm-beam-svg { width: 100%; height: 100%; }

/* Desktop beam: large, bottom-left, 250% wide, 30% opacity */
.pm-beam-desktop {
  position: absolute;
  bottom: -4rem;
  left: -1.5rem;
  top: auto;
  right: auto;
  width: 250%;
  height: auto;
  opacity: 0.3;
  display: none;
  transform: scaleX(-1) scaleY(-1);
}

@media (min-width: 640px) {
  .pm-beam-mobile  { display: none; }
  .pm-beam-desktop { display: block; margin: 0; inset: auto; }
}

/* Beam SVG fill/stroke (Polymarket's exact class names) */
.pm-us-beam-symbol-fill   { fill: rgba(255,255,255,0.15); }
.pm-us-beam-symbol-stroke { stroke: rgba(255,255,255,0.25); stroke-width: 1; fill: none; }

/* Animated bloom */
.pm-us-beam {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.pm-us-beam-bloom {
  position: absolute;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 65%);
  top: -15%;
  left: -5%;
  animation: pm-bloom-drift var(--pm-us-beam-duration, 6s) ease-in-out infinite alternate;
}
@keyframes pm-bloom-drift {
  0%   { transform: translate(0,0)      scale(1);   opacity: 0.6; }
  50%  { transform: translate(45%,35%)  scale(1.3); opacity: 0.25; }
  100% { transform: translate(85%,12%)  scale(0.9); opacity: 0.5; }
}

/* Promo text – sits above the beam layers */
.pm-promo-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.pm-promo-flag {
  height: 1.25rem;
  width: 1.875rem;
  object-fit: cover;
  border-radius: 3px;
  overflow: hidden;
}

.pm-promo-heading {
  font-size: 1.5625rem;   /* md:text-[25px] */
  font-weight: 600;
  color: #fff;
  line-height: 2rem;      /* md:leading-8 */
  letter-spacing: -0.02em;
  margin: 0;
}

.pm-promo-sub  { font-size: 1rem; font-weight: 500; color: rgba(255,255,255,.5); margin: 0; line-height: 1.25rem; }
.pm-promo-code { font-family: monospace; color: rgba(255,255,255,.8); }

/* Phone mockup (absolute, right overflow) */
.pm-phone-wrap {
  position: absolute;
  right: -1.5rem;
  top: 10rem;
  width: 12.5rem;   /* w-50 */
  z-index: 5;
}

.pm-phone-device {
  background: #0f0f1a;
  border-radius: 1.25rem;
  border: 2px solid rgba(255,255,255,.18);
  padding: 1rem 0.75rem 0.75rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

.pm-phone-notch {
  width: 2.5rem; height: 0.375rem;
  background: rgba(255,255,255,.2);
  border-radius: 9999px;
  margin: 0 auto 0.625rem;
}

.pm-phone-screen { display: flex; flex-direction: column; gap: 0.375rem; }

.pm-phone-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.25rem; }
.pm-phone-logo   { width: 5rem; height: 0.5rem; background: #3b82f6; border-radius: 3px; }
.pm-phone-amt    { font-size: 0.75rem; font-weight: 700; color: #22c55e; }

.pm-phone-tabs   { display: flex; gap: 0.5rem; margin-bottom: 0.375rem; }
.pm-phone-tab    { font-size: 0.625rem; color: rgba(255,255,255,.4); padding: 0.2rem 0.5rem; border-radius: 9999px; }
.pm-phone-tab-on { background: rgba(255,255,255,.15); color: white; }

.pm-phone-card { background: rgba(255,255,255,.08); border-radius: 0.5rem; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.3rem; }
.pm-phone-bar  { height: 0.375rem; background: rgba(255,255,255,.25); border-radius: 9999px; }

.pm-phone-label {
  font-size: 0.5rem; font-weight: 800;
  color: rgba(255,255,255,.6);
  letter-spacing: 0.1em;
  text-align: center;
  margin-top: 0.25rem;
}

/* QR code – bottom-left, desktop only */
.pm-qr-wrap {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 10;
  display: none;
  color: white;
  --color-background: #3b82f6;
}
@media (min-width: 640px) {
  .pm-qr-wrap   { display: block; }
  .pm-phone-wrap { display: block; }
}

/* Mobile CTA – hidden on desktop */
.pm-mobile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #111827;
  color: #f9fafb;
  border-radius: 0.75rem;
  padding: 0.875rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  position: absolute;
  bottom: 1.25rem;
  left: 1.5rem;
  right: 1.5rem;
  z-index: 20;
}
@media (min-width: 640px) {
  .pm-mobile-cta { display: none; }
}

/* ── Right: dark form panel ────────────────────────────────────── */
.pm-form-panel {
  flex: 0 0 21.25rem;
  width: 21.25rem;
  background: #15181e;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;  /* needed for close button absolute positioning */
}

/* Close button – top-right of form panel */
.pm-modal-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  z-index: 20;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  color: #9ca3af;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  padding: 0;
}
.pm-modal-close:hover { background: rgba(255,255,255,0.12); color: #f9fafb; }

.pm-form-heading {
  padding: 1.25rem 1.5rem 0;
  text-align: center;
}
.pm-form-heading p {
  font-size: 1rem;
  font-weight: 600;
  color: #f9fafb;
  margin: 0;
}

.pm-form-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  padding: 1.25rem 1.5rem;
}

/* Google button – blue pill, full width, h-[52px], rounded-[16px] */
.pm-btn-google {
  width: 100%;
  height: 3.25rem;    /* h-[52px] */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1rem;
  background: #2563eb;  /* blue-600 */
  color: #ffffff;
  border: none;
  border-radius: 1rem;  /* rounded-[16px] */
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease-out;
}
.pm-btn-google:hover  { background: #1d4ed8; }  /* blue-700 */
.pm-btn-google:active { transform: scale(0.98); }

.pm-google-icon { flex-shrink: 0; fill: white; }

/* Back button shown when email-only view is active */
#pm-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0;
  transition: color 120ms;
}
#pm-back-btn:hover { color: #f9fafb; }
#pm-back-btn svg   { flex-shrink: 0; stroke: currentColor; }

/* OR row */
.pm-or-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: -0.25rem 0;
}
.pm-or-line { flex: 1; height: 1px; background: #2d3340; }
.pm-or-text { font-size: 0.875rem; font-weight: 500; color: #6b7280; flex-shrink: 0; }

/* Email form – bordered input with inline Continue button */
.pm-email-form {
  position: relative;
  width: 100%;
  height: 3.5rem;
  border: 1px solid #2d3340;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #1f2430;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pm-email-form:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.pm-email-input {
  width: 100%;
  height: 100%;
  padding: 0 7rem 0 0.875rem;
  background: transparent;
  border: none;
  color: #f0f4f8;
  font-size: 0.9375rem;
  outline: none;
}
.pm-email-input::placeholder { color: #4b5563; }

/* Enable button once there's input (JS toggles disabled) */
.pm-email-form:focus-within .pm-email-submit:not(:disabled) { color: #60a5fa; }

.pm-email-btn-wrap {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.pm-email-submit {
  height: 2.5rem;
  padding: 0 0.875rem;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms, opacity 120ms;
  white-space: nowrap;
}
.pm-email-submit:disabled { background: #1f2430; color: #4b5563; cursor: default; }
.pm-email-submit:not(:disabled):hover { background: #1d4ed8; }

/* Wallet grid – 4 columns, 2 rows */
.pm-wallet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.125rem;
}

.pm-wallet-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  background: #1f2430;
  border: 1px solid #2d3340;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, transform 150ms;
  padding: 0.5rem;
  color: #9ca3af;
}
.pm-wallet-btn:hover  { background: #2d3340; border-color: #4b5563; }
.pm-wallet-btn:active { transform: scale(0.97); }
.pm-wallet-more       { color: #9ca3af; }

/* Footer */
.pm-form-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  padding: 0.75rem 1.5rem 1.25rem;
  border-top: 1px solid #2d3340;
}
.pm-footer-link {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.pm-footer-link:hover { color: #d1d5db; }
.pm-footer-dot { color: #374151; }

/* Wallet Loader Modal */
.wallet-loader-modal {
  width: 20rem;
  text-align: center;
  background: #ffffff;
  color: #111827;
}

.wallet-back-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.wallet-back-btn:hover {
  color: var(--foreground);
}

.wallet-loader-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 2rem;
}

.wallet-loader-icon-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem auto;
}

.loading-spinner {
  position: absolute;
  width: 6rem;
  height: 6rem;
  border: 3px solid rgba(59, 130, 246, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.wallet-loader-icon {
  position: relative;
  z-index: 1;
}

.wallet-loader-status {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.wallet-loader-message {
  font-size: 0.875rem;
  color: #6b7280;
}

/* === Magic Loader Modal === */
.magic-loader-modal {
  width: 26rem;
  min-height: 28rem;
  text-align: center;
  padding: 2rem 2rem 3rem;
  background-color: #1f2937;
  position: relative;
}

.magic-back-btn {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.magic-back-btn:hover {
  color: #f3f4f6;
}

.magic-loader-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2.5rem;
  margin-top: 0.5rem;
}

.magic-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2.5rem;
  position: relative;
  width: 140px;
  height: 140px;
  margin-left: auto;
  margin-right: auto;
}

.magic-spinner {
  position: absolute;
  top: 0;
  left: 0;
  animation: spin 2s linear infinite;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

.magic-logo {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 20px rgba(104, 81, 255, 0.5));
}

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

.magic-status { margin-top: 1rem; }

.magic-status-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.magic-status-subtitle {
  font-size: 0.875rem;
  color: #9ca3af;
  line-height: 1.6;
  max-width: 20rem;
  margin: 0 auto;
}

/* === OTP Modal === */
.otp-modal {
  width: 28rem;
  text-align: center;
}

.otp-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.otp-email-icon {
  width: 4rem;
  height: 4rem;
  color: var(--primary);
  stroke-width: 1.5;
}

.otp-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.otp-email {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 2rem;
}

/* OTP Input Boxes */
.otp-input-container {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.otp-input {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  background-color: rgba(55, 65, 81, 0.5);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  color: var(--foreground);
  outline: none;
  transition: all 0.2s;
}

.otp-input:focus {
  border-color: var(--primary);
  background-color: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.otp-input:not(:placeholder-shown) {
  border-color: var(--primary);
}

/* OTP Warning */
.otp-warning {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.otp-warning p {
  font-size: 0.75rem;
  color: var(--foreground);
  line-height: 1.5;
  margin: 0;
}

.otp-warning strong {
  color: var(--destructive);
  font-weight: 700;
}

/* OTP Footer */
.otp-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

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

.otp-magic-logo {
  height: 1.25rem;
  width: auto;
}

/* Responsive adjustments for OTP Modal */
@media (max-width: 500px) {
  .otp-modal {
    width: 90vw;
    max-width: 24rem;
  }

  .otp-input-container {
    gap: 0.5rem;
  }

  .otp-input {
    width: 2.5rem;
    height: 3rem;
    font-size: 1.25rem;
  }
}

/* === Connection Failed Modal === */
.connection-failed-modal {
  width: 26rem;
  min-height: 20rem;
  text-align: center;
  padding: 2.5rem 2rem;
  background-color: #1f2937;
}

.failed-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.failed-wallet-icon {
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background-color: rgba(55, 65, 81, 0.5);
  position: relative;
}

.failed-wallet-icon img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 0.5rem;
}

.error-badge {
  position: absolute;
  bottom: -0.5rem;
  right: -0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  background-color: #1f2937;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #1f2937;
}

.failed-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.failed-message {
  font-size: 0.9375rem;
  color: #9ca3af;
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 20rem;
  margin-left: auto;
  margin-right: auto;
}

.failed-message span {
  color: #ffffff;
  font-weight: 600;
}

.failed-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn-try-again,
.btn-manual-connect {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-try-again {
  background-color: #3b82f6;
  color: #ffffff;
}

.btn-try-again:hover {
  background-color: #2563eb;
}

.btn-manual-connect {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  color: #ffffff;
}

.btn-manual-connect:hover {
  opacity: 0.9;
}

.btn-back-to-login {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  color: #9ca3af;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back-to-login:hover {
  background-color: rgba(55, 65, 81, 0.3);
  color: #ffffff;
  border-color: #4b5563;
}

/* === Import Wallet Modal === */
.import-wallet-modal {
  width: 28rem;
  min-height: 30rem;
  padding: 2.5rem 2rem;
  background-color: #1f2937;
  position: relative;
}

.import-back-btn {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  z-index: 10;
}

.import-back-btn:hover {
  color: #f3f4f6;
}

.import-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.import-wallet-icon {
  width: 4.5rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background-color: rgba(55, 65, 81, 0.5);
  position: relative;
}

.import-wallet-icon img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  border-radius: 0.5rem;
}

.shield-badge {
  position: absolute;
  bottom: -0.5rem;
  right: -0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  background-color: #1f2937;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #1f2937.
}

.import-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  margin-bottom: 0.5rem;
}

.import-title span {
  color: #6851FF;
}

.import-subtitle {
  font-size: 0.8125rem;
  color: #9ca3af;
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Import Tabs */
.import-tabs {
  display: flex;
  border-bottom: 2px solid #374151;
  margin-bottom: 1.5rem;
  gap: 0.25rem;
}

.import-tab {
  flex: 1;
  padding: 0.75rem 0.5rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #9ca3af;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -2px;
}

.import-tab:hover {
  color: #ffffff;
}

.import-tab.active {
  color: #6851FF;
  border-bottom-color: #6851FF;
}

/* Tab Panels */
.import-tab-content {
  margin-bottom: 1.5rem;
}

.tab-panel {
  display: none;
}

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

.import-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f3f4f6;
  margin-bottom: 0.5rem;
}

.import-input {
  width: 100%;
  padding: 0.875rem;
  background-color: #293642;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  color: #ffffff;
  font-size: 0.875rem;
  font-family: monospace;
  resize: vertical;
  outline: none;
  transition: all 0.2s;
}

.import-input:focus {
  border-color: #6851FF;
  box-shadow: 0 0 0 3px rgba(104, 81, 255, 0.1);
}

.import-input::placeholder {
  color: #6b7280;
}

.import-input-single {
  width: 100%;
  padding: 0.875rem;
  background-color: #293642;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  color: #ffffff;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s;
}

.import-input-single:focus {
  border-color: #6851FF;
  box-shadow: 0 0 0 3px rgba(104, 81, 255, 0.1);
}

.import-input-single::placeholder {
  color: #6b7280;
}

.word-count-display {
  margin-top: 0.5rem;
  text-align: right;
  font-size: 0.75rem;
  color: #9ca3af.
}

.import-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 0.5rem.
}

.import-warning span {
  font-size: 0.75rem;
  color: #fbbf24;
  line-height: 1.5;
}

.import-warning svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
}

/* Connect Button */
.btn-import-connect {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
}

.btn-import-connect:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-import-connect:active {
  transform: translateY(0);
}

.import-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem.
  background-color: rgba(55, 65, 81, 0.3);
  border-radius: 0.5rem.
}

.import-security-note span {
  font-size: 0.6875rem;
  color: #9ca3af.
  line-height: 1.4.
}

.import-security-note svg {
  flex-shrink: 0.
}

/* Responsive adjustments for Connection Failed Modal */
@media (max-width: 500px) {
  .connection-failed-modal {
    width: 90vw;
    max-width: 24rem;
    padding: 2rem 1.5rem;
  }

  .failed-icon-container {
    margin-bottom: 1.25rem;
  }

  .failed-wallet-icon {
    width: 4.5rem;
    height: 4.5rem;
  }

  .failed-wallet-icon img {
    width: 3rem;
    height: 3rem.
  }

  .failed-title {
    font-size: 1.25rem.
  }

  .failed-message {
    font-size: 0.875rem.
  }
}

/* Responsive adjustments for Import Wallet Modal */
@media (max-width: 500px) {
  .import-wallet-modal {
    width: 90vw;
    max-width: 24rem;
    padding: 2rem 1.5rem.
  }

  .import-tab {
    padding: 0.625rem 0.25rem.
    font-size: 0.75rem.
  }

  .import-input {
    font-size: 0.8125rem.
    padding: 0.75rem.
  }

  .import-input-single {
    font-size: 0.8125rem.
    padding: 0.75rem.
  }
}

/* === Enhanced Mobile Responsiveness === */
@media (max-width: 768px) {
  /* Header Adjustments */
  .logo-icon {
    height: 6rem;
  }

  .main-search-container {
    max-width: none;
    margin: 0 1rem;
    flex: 1;
  }

  .header-actions {
    gap: 0.25rem.
  }

  .btn {
    padding: 0.375rem 0.625rem.
    font-size: 0.8125rem.
  }

  /* Hide search kbd on mobile */
  .search-kbd {
    display: none.
  }

  /* Categories - make scrollable */
  .categories-list {
    gap: 1rem.
    padding-right: 1rem.
  }

  .category-btn {
    font-size: 0.8125rem.
  }

  /* Topics */
  .topic-pills {
    gap: 0.375rem.
  }

  .topic-pill {
    padding: 0.25rem 0.625rem.
    font-size: 0.6875rem.
  }

  /* Filters */
  .filters-content {
    gap: 0.5rem.
  }

  .filter-option {
    padding: 0.375rem 0.625rem.
    font-size: 0.6875rem.
  }

  /* Main Content */
  .main-content {
    padding: 1rem 0.75rem.
  }

  /* Market Grid */
  .market-grid {
    gap: 0.75rem.
  }

  /* Market Cards */
  .market-card {
    padding: 0.875rem.
    min-height: 180px.
  }

  .card-header {
    gap: 0.5rem.
    margin-bottom: 0.75rem.
  }

  .card-icon-container {
    width: 2rem.
    height: 2rem.
  }

  .card-icon {
    font-size: 1rem.
  }

  .card-title {
    font-size: 0.9375rem.
  }

  .market-image {
    width: 35px.
    height: 35px.
  }

  /* Outcomes */
  .outcomes-list {
    gap: 0.625rem.
    margin-bottom: 0.75rem.
  }

  .outcome-name {
    font-size: 0.8125rem.
  }

  .outcome-percent {
    font-size: 0.6875rem.
    min-width: 2.75rem.
  }

  .btn-trade {
    padding: 0.3125rem 0.75rem.
    font-size: 0.6875rem.
  }

  /* Card Footer */
  .card-footer {
    padding-top: 0.375rem.
  }

  .volume-text {
    font-size: 0.8125rem.
  }

  .footer-icons {
    gap: 0.5rem.
  }
}

@media (max-width: 480px) {
  /* Full-screen modals on mobile */
  .modal-overlay {
    padding: 0.
    align-items: flex-start.
  }

  .modal-content {
    max-width: 100vw.
    max-height: 100vh.
    width: 100%.
    height: 100%.
    border-radius: 0.
    padding: 1.5rem.
  }

  /* Login Modal */
  .login-modal {
    width: 100%.
    height: 100%.
    display: flex.
    flex-direction: column.
    justify-content: center.
  }

  .wallet-options {
    grid-template-columns: repeat(2, 1fr).
    gap: 0.625rem.
  }

  .wallet-btn {
    padding: 0.875rem 0.375rem.
  }

  .wallet-icon {
    width: 2.5rem.
    height: 2.5rem.
  }

  .wallet-name {
    font-size: 0.6875rem.
  }

  /* OTP Modal - Full screen */
  .otp-modal {
    width: 100%.
    height: 100%.
    display: flex.
    flex-direction: column.
    justify-content: center.
  }

  .otp-input-container {
    gap: 0.375rem.
    justify-content: space-between.
    padding: 0 0.5rem.
  }

  .otp-input {
    width: 2.25rem.
    height: 2.75rem.
    font-size: 1.125rem.
  }

  /* Magic Loader - Full screen */
  .magic-loader-modal {
    width: 100%.
    height: 100%.
    display: flex.
    flex-direction: column.
    justify-content: center.
    min-height: 100vh.
  }

  /* Connection Failed - Full screen */
  .connection-failed-modal {
    width: 100%.
    height: 100%.
    display: flex.
    flex-direction: column.
    justify-content: center.
    min-height: 100vh.
    padding: 2rem 1.5rem.
  }

  /* Import Wallet - Full screen */
  .import-wallet-modal {
    width: 100%.
    height: 100%.
    display: flex.
    flex-direction: column.
    justify-content: center.
    min-height: 100vh.
    padding: 2rem 1.5rem.
  }
}