/* PolyOrakl Design System - Light Theme Financial & AI Trading */
:root {
  /* Purple Gradient Sidebar */
  --sidebar-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* Light Theme Canvas Colors */
  --bg-main: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;

  /* Text Colors for Light Mode */
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-dim: #9ca3af;

  /* Brand Accents */
  --primary-purple: #7c3aed;
  --primary-blue: #3b82f6;
  --accent-gold: #f59e0b;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-orange: #f97316;

  /* Radius & Shadows */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.09);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.wallet-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top left, #eef2ff 0, #f8fafc 45%, #ecfeff 100%);
}
.wallet-login-shell {
  width: min(100%, 460px);
  padding: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .12);
}
.wallet-login-mark {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border-radius: 16px;
  color: #fff;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #4338ca, #2563eb);
}

/* App Container */
.app-container {
  min-height: 100vh;
}

/* ==========================================================================
   Sidebar responsive layout (Desktop + Mobile)
   ========================================================================== */
.sidebar {
  background: var(--sidebar-gradient);
  color: white;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar-inner {
  padding: 1rem 0.75rem 2rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-brand {
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-brand:hover {
  transform: scale(1.03);
}

.brand-logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd700 0%, #ff9800 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e1b4b;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(255, 193, 7, 0.45);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.brand-logo-badge::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.7) 50%, transparent 60%);
  transform: rotate(25deg) translateY(-100%);
  transition: transform 0.7s;
}

.sidebar-brand:hover .brand-logo-badge::after {
  transform: rotate(25deg) translateY(100%);
}

.sidebar-brand:hover .brand-logo-badge {
  transform: rotate(12deg) scale(1.12);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.65);
}

.sidebar-brand-text {
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff 0%, #ffd54f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-user {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.sidebar-user .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sidebar-user .user-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
}

.sidebar-user .user-meta {
  font-size: 0.72rem;
  opacity: 0.8;
  color: #ffffff;
}

/* Mobile Sidebar Toggle Button */
.sidebar-toggle {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  box-shadow: none;
}

.sidebar-group-title {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin: 0.85rem 0.6rem 0.3rem;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.5rem 0.7rem;
  margin: 0.08rem 0;
  border-radius: 0.5rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 600;
}

.sidebar .nav-link i:first-child {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.sidebar .nav-link .badge {
  font-size: 0.68rem;
  padding: 0.25em 0.55em;
  border-radius: 8px;
}

/* ==========================================================================
   Main Content Layout & Top Header
   ========================================================================== */
.main-content-column {
  background: var(--bg-main);
  min-height: 100vh;
}

.top-navbar {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.top-navbar-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-tag {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  color: var(--text-main);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.header-tag:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.header-tag.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #ffffff;
  font-weight: 600;
}

.header-tag.primary:hover {
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
  color: #ffffff;
}

.content-body {
  padding: 1.75rem 2rem 4rem;
}

/* ==========================================================================
   Cards & Components (Light Theme)
   ========================================================================== */
.light-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
}

.light-card:hover {
  box-shadow: var(--shadow-hover);
}

/* Dashboard Stats Cards */
.stats-card {
  border: 1px solid var(--border-color);
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stats-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.stat-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 0.65rem;
}

.stat-icon-wrapper.green { background: #dcfce7; color: #166534; }
.stat-icon-wrapper.blue { background: #dbeafe; color: #1e40af; }
.stat-icon-wrapper.market { background: #e0e7ff; color: #3730a3; }
.stat-icon-wrapper.purple { background: #f3e8ff; color: #6b21a8; }

/* Competition Entry Banner */
.competition-entry {
  color: white;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #9333ea 100%);
  border: 0;
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(79, 70, 229, 0.22);
  transition: transform 0.25s, box-shadow 0.25s;
  padding: 1.5rem 1.75rem;
  display: block;
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.competition-entry:hover {
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.32);
}

.competition-entry .competition-icon {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 16px;
  color: #5b21b6;
  background: #fef3c7;
  font-size: 1.8rem;
}

/* ==========================================================================
   AI Chart Entry Dark Card inside Light Dashboard
   ========================================================================== */
.ai-chart-hero-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 1.85rem 2.2rem;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  margin-bottom: 1.85rem;
  position: relative;
  overflow: hidden;
  display: block;
  text-decoration: none;
}

.ai-chart-hero-banner:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 25px rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #ffffff;
}

.ai-chart-hero-icon {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
  flex-shrink: 0;
}

.ai-chart-badge-free {
  background: #10b981;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  vertical-align: middle;
  margin-left: 8px;
  display: inline-block;
}

.model-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}
.model-pill-tag.gemini {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}
.model-pill-tag.gpt {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}
.model-pill-tag.claude {
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.08);
}

.ai-chart-circle-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #facc15;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  font-weight: bold;
  box-shadow: 0 8px 24px rgba(250, 204, 21, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  margin: 0 auto;
}

.ai-chart-hero-banner:hover .ai-chart-circle-btn {
  transform: scale(1.08) translateX(2px);
  box-shadow: 0 10px 28px rgba(250, 204, 21, 0.65);
}

.ai-chart-btn-label {
  color: #facc15;
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 8px;
  text-align: center;
}

/* ==========================================================================
   AI Chart Page 1:1 Replica (图1还原)
   - Purple Top Bar with Pills
   - White Secondary Tab Bar
   - Light Purple/Blue Hero Card with 3D Icon & 5 Feature Pills
   - 2 Analysis Mode Selector Boxes (Upload vs Manual)
   - Bottom Sticky Console (Pill buttons, Upload Pic, Rounded Input, Send)
   ========================================================================== */
.aichart-top-navbar {
  background: linear-gradient(90deg, #5b50e6 0%, #635bff 50%, #6f62f7 100%);
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 16px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(99, 91, 255, 0.22);
}

.aichart-brand-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #ffffff;
}

.aichart-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.aichart-nav-pill {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  text-decoration: none;
}
.aichart-nav-pill:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Secondary Tab Subnav */
.aichart-subnav {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  gap: 28px;
  margin-bottom: 24px;
  border-radius: 10px;
}

.aichart-subnav-item {
  padding: 12px 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  text-decoration: none;
}
.aichart-subnav-item:hover {
  color: #635bff;
}
.aichart-subnav-item.active {
  color: #635bff;
}
.aichart-subnav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #635bff;
  border-radius: 3px 3px 0 0;
}

/* Hero Center Card */
.aichart-hero-card {
  background: linear-gradient(180deg, #edf2fe 0%, #f4f7ff 100%);
  border: 1px solid #dbe4fe;
  border-radius: 22px;
  padding: 38px 24px 32px;
  text-align: center;
  margin-bottom: 26px;
  box-shadow: 0 4px 20px rgba(99, 91, 255, 0.06);
  position: relative;
}

.aichart-hero-3d-badge {
  width: 62px;
  height: 62px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(99, 91, 255, 0.16);
  border: 1px solid #e0e7ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 16px;
}

.aichart-hero-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
}

.aichart-hero-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 20px;
}

.aichart-feature-pills {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feature-pill {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  padding: 5px 14px;
  border-radius: 18px;
  display: inline-block;
}
.feature-pill.p-purple { background: #6366f1; }
.feature-pill.p-blue { background: #3b82f6; }
.feature-pill.p-orange { background: #f97316; }
.feature-pill.p-green { background: #10b981; }
.feature-pill.p-indigo { background: #7c3aed; }

/* 两种分析方式选择卡 */
.mode-selector-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #635bff;
  margin-bottom: 12px;
}

.mode-selector-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 22px;
  cursor: pointer;
  transition: all 0.25s;
  height: 100%;
}
.mode-selector-card:hover {
  border-color: #635bff;
  box-shadow: 0 4px 16px rgba(99, 91, 255, 0.1);
  transform: translateY(-2px);
}
.mode-selector-card.active {
  border-color: #635bff;
  background: #fbfbfe;
  box-shadow: 0 0 0 1px #635bff;
}

.mode-card-header {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-card-item {
  color: #64748b;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 底部固定条 */
.aichart-fixed-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.aichart-bottom-status-line {
  padding: 8px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: #64748b;
}

.aichart-online-tag {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.aichart-bottom-controls-row {
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-gemini-pill {
  background: #8b5cf6;
  color: #ffffff;
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-gemini-pill:hover {
  background: #7c3aed;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
  color: #ffffff;
}

.btn-multimodel-pill {
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-multimodel-pill:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.multimodel-badge {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 10px;
}

.aichart-tip-text {
  color: #94a3b8;
  font-size: 0.84rem;
}

.btn-upload-camera {
  margin-left: auto;
  border: 1.5px solid #8b5cf6;
  color: #8b5cf6;
  background: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-upload-camera:hover {
  background: #8b5cf6;
  color: #ffffff;
}

.aichart-bottom-input-row {
  padding: 6px 24px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.aichart-round-input {
  flex: 1;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 26px;
  padding: 10px 20px;
  font-size: 0.9rem;
  color: #1e293b;
  outline: none;
  transition: all 0.2s;
}
.aichart-round-input:focus {
  background: #ffffff;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.aichart-send-circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #a78bfa;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s;
}
.aichart-send-circle-btn:hover {
  background: #8b5cf6;
  transform: scale(1.05);
}

@media (min-width: 768px) {
  .aichart-fixed-bottom {
    left: 25%;
  }
}
@media (min-width: 992px) {
  .aichart-fixed-bottom {
    left: 16.666667%;
  }
}

@media (max-width: 767.98px) {
  .aichart-fixed-bottom {
    left: 0;
  }
  .btn-upload-camera {
    margin-left: 0;
  }
  .aichart-subnav {
    overflow-x: auto;
    white-space: nowrap;
    gap: 16px;
  }
}

.ai-chat-entry-banner:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.15), 0 16px 40px rgba(0, 0, 0, 0.25);
  border-color: rgba(245, 158, 11, 0.5);
  color: white;
}

.ai-icon-market {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  color: #121826;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.35);
  flex-shrink: 0;
}

/* Notification Amber Box 1:1 */
.notice-box {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  color: #92400e;
  font-size: 0.9rem;
}

/* Tables in Light Mode */
.custom-table {
  width: 100%;
  margin-bottom: 0;
  color: var(--text-main);
  background: #ffffff;
}

.custom-table thead th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
}

.custom-table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 0.88rem;
}

.custom-table tbody tr:hover {
  background: #f8fafc;
}

/* ==========================================================================
   AI Chart Analysis Page
   ========================================================================== */

        * { margin: 0; padding: 0; box-sizing: border-box; }

        :root {
            --purple-start: #7c3aed;
            --purple-end: #a855f7;
            --blue-accent: #3b82f6;
            --green-accent: #22c55e;
            --orange-accent: #f97316;
            --bg-main: #f8fafc;
            --bg-white: #ffffff;
            --text-dark: #1e293b;
            --text-mid: #475569;
            --text-light: #94a3b8;
            --border: #e2e8f0;
            --shadow: 0 4px 24px rgba(0,0,0,0.08);
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", "PingFang SC", sans-serif;
            background: var(--bg-main);
            color: var(--text-dark);
            min-height: 100vh;
        }

        /* ===== 顶部导航 ===== */
        .top-header {
            background: linear-gradient(135deg, var(--purple-start) 0%, #6366f1 50%, var(--blue-accent) 100%);
            color: white;
            padding: 16px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .header-left {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        .header-avatar {
            width: 42px; height: 42px;
            background: rgba(255,255,255,0.2);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
        }
        .header-title h1 {
            font-size: 18px;
            font-weight: 700;
            letter-spacing: 0.5px;
        }
        .header-title p {
            font-size: 12px;
            opacity: 0.85;
            margin-top: 2px;
        }
        .header-right {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .header-badge {
            background: rgba(255,255,255,0.15);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 8px;
            padding: 6px 14px;
            font-size: 13px;
            color: white;
            text-decoration: none;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
        }
        .header-badge:hover {
            background: rgba(255,255,255,0.25);
            transform: translateY(-1px);
        }
        .header-badge.switch-btn {
            background: rgba(255,255,255,0.95);
            color: var(--purple-start);
            font-weight: 600;
            border: none;
        }
        .header-badge.switch-btn:hover {
            background: white;
            box-shadow: 0 4px 16px rgba(0,0,0,0.15);
        }

        /* ===== 导航栏 ===== */
        .nav-bar {
            background: var(--bg-white);
            border-bottom: 1px solid var(--border);
            padding: 0 24px;
            display: flex;
            align-items: center;
            gap: 0;
            overflow-x: auto;
        }
        .nav-item {
            padding: 14px 20px;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-mid);
            text-decoration: none;
            border-bottom: 2px solid transparent;
            white-space: nowrap;
            transition: all 0.2s;
        }
        .nav-item:hover { color: var(--purple-start); }
        .nav-item.active {
            color: var(--purple-start);
            border-bottom-color: var(--purple-start);
            font-weight: 600;
        }

        /* ===== 主内容区 ===== */
        .main-content {
            max-width: 900px;
            margin: 0 auto;
            padding: 32px 24px;
        }

        /* 欢迎区域 */
        .welcome-card {
            background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 50%, #dbeafe 100%);
            border-radius: 20px;
            padding: 48px 40px;
            text-align: center;
            margin-bottom: 32px;
            position: relative;
            overflow: hidden;
        }
        .welcome-card::before {
            content: '';
            position: absolute;
            top: -40px; right: -40px;
            width: 200px; height: 200px;
            background: rgba(124, 58, 237, 0.08);
            border-radius: 50%;
        }
        .welcome-icon {
            font-size: 56px;
            margin-bottom: 16px;
            position: relative;
        }
        .welcome-card h2 {
            font-size: 26px;
            font-weight: 700;
            margin-bottom: 10px;
            color: var(--text-dark);
            position: relative;
        }
        .welcome-card p {
            font-size: 15px;
            color: var(--text-mid);
            position: relative;
        }
        .feature-tags {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-top: 20px;
            flex-wrap: wrap;
            position: relative;
        }
        .feature-tag {
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 600;
            color: white;
        }
        .feature-tag.purple { background: var(--purple-start); }
        .feature-tag.blue { background: var(--blue-accent); }
        .feature-tag.orange { background: var(--orange-accent); }
        .feature-tag.green { background: var(--green-accent); }

        /* 上传方式说明 */
        .methods-section {
            margin-bottom: 32px;
        }
        .methods-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--purple-start);
            margin-bottom: 16px;
        }
        .methods-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }
        .method-card {
            background: var(--bg-white);
            border: 2px solid var(--border);
            border-radius: 16px;
            padding: 24px;
            cursor: pointer;
            transition: all 0.3s;
        }
        .method-card:hover {
            border-color: var(--purple-start);
            box-shadow: 0 8px 32px rgba(124, 58, 237, 0.12);
            transform: translateY(-2px);
        }
        .method-card.active {
            border-color: var(--purple-start);
            background: #faf5ff;
        }
        .method-card h3 {
            font-size: 16px;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .method-card ul {
            list-style: none;
            padding: 0;
        }
        .method-card li {
            font-size: 13px;
            color: var(--text-mid);
            padding: 4px 0;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .method-card li::before {
            content: '•';
            color: var(--purple-start);
            font-weight: bold;
        }

        /* ===== 底部操作栏 ===== */
        .bottom-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--bg-white);
            border-top: 1px solid var(--border);
            box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
            z-index: 100;
        }
        @media (min-width: 768px) {
            .bottom-bar {
                left: 25% !important;
            }
        }
        @media (min-width: 992px) {
            .bottom-bar {
                left: 16.666667% !important;
            }
        }
        @media (max-width: 767.98px) {
            .bottom-bar {
                left: 0 !important;
            }
        }
        .bottom-status {
            padding: 8px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid var(--border);
            font-size: 13px;
        }
        .status-models {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-mid);
        }
        .status-models .globe { font-size: 16px; }
        .status-online {
            background: #dcfce7;
            color: #166534;
            padding: 2px 10px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
        }
        .bottom-actions {
            padding: 12px 24px;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .action-btn {
            padding: 10px 22px;
            border-radius: 24px;
            font-size: 14px;
            font-weight: 600;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .action-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .action-btn.primary {
            background: linear-gradient(135deg, var(--purple-start), var(--blue-accent));
            color: white;
        }
        .action-btn.primary:hover:not(:disabled) {
            box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
            transform: translateY(-1px);
        }
        .action-btn.secondary {
            background: var(--bg-main);
            color: var(--text-dark);
            border: 1px solid var(--border);
        }
        .action-btn.secondary:hover:not(:disabled) {
            background: #f1f5f9;
        }
        .action-btn .badge {
            background: rgba(255,255,255,0.25);
            padding: 1px 8px;
            border-radius: 10px;
            font-size: 12px;
        }
        .upload-btn {
            margin-left: auto;
            padding: 10px 22px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            border: 2px solid var(--purple-start);
            background: white;
            color: var(--purple-start);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.2s;
        }
        .upload-btn:hover {
            background: var(--purple-start);
            color: white;
        }
        .bottom-input {
            padding: 12px 24px 16px;
            display: flex;
            gap: 12px;
            align-items: flex-end;
        }
        .input-wrapper {
            flex: 1;
            position: relative;
        }
        .chat-input {
            width: 100%;
            padding: 14px 18px;
            border: 2px solid var(--border);
            border-radius: 14px;
            font-size: 14px;
            font-family: inherit;
            resize: none;
            outline: none;
            transition: border-color 0.2s;
            background: var(--bg-main);
            min-height: 48px;
            max-height: 120px;
        }
        .chat-input:focus {
            border-color: var(--purple-start);
        }
        .chat-input::placeholder {
            color: var(--text-light);
        }
        .send-btn {
            width: 48px; height: 48px;
            border-radius: 14px;
            background: linear-gradient(135deg, var(--purple-start), var(--blue-accent));
            color: white;
            border: none;
            cursor: pointer;
            font-size: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        .send-btn:hover {
            box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
            transform: translateY(-1px);
        }
        .send-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* ===== 图片预览区 ===== */
        .image-preview-bar {
            display: none;
            padding: 8px 24px;
            border-bottom: 1px solid var(--border);
            background: #faf5ff;
        }
        .image-preview-bar.has-image { display: flex; align-items: center; gap: 12px; }
        .preview-thumb {
            width: 56px; height: 56px;
            border-radius: 10px;
            object-fit: cover;
            border: 2px solid var(--purple-start);
        }
        .preview-info {
            flex: 1;
        }
        .preview-info .name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-dark);
        }
        .preview-info .size {
            font-size: 12px;
            color: var(--text-light);
        }
        .preview-remove {
            width: 28px; height: 28px;
            border-radius: 50%;
            border: 1px solid var(--border);
            background: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: var(--text-mid);
            transition: all 0.2s;
        }
        .preview-remove:hover { background: #fee2e2; color: #ef4444; border-color: #fecaca; }

        /* ===== 信号摘要卡片 ===== */
        .signal-summary {
            display: none;
            background: var(--bg-white);
            border-radius: 20px;
            border: 1px solid var(--border);
            padding: 32px;
            margin-bottom: 24px;
            text-align: center;
            box-shadow: 0 4px 24px rgba(0,0,0,0.06);
        }
        .signal-summary.active { display: block; }
        .signal-icon {
            width: 64px; height: 64px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 12px;
            font-size: 28px;
            font-weight: 700;
            color: white;
        }
        .signal-icon.buy { background: linear-gradient(135deg, #22c55e, #16a34a); }
        .signal-icon.sell { background: linear-gradient(135deg, #ef4444, #dc2626); }
        .signal-icon.hold { background: linear-gradient(135deg, var(--blue-accent), #6366f1); }
        .signal-label {
            font-size: 28px;
            font-weight: 800;
            margin-bottom: 4px;
        }
        .signal-label.buy { color: #22c55e; }
        .signal-label.sell { color: #ef4444; }
        .signal-label.hold { color: var(--blue-accent); }
        .signal-confidence {
            font-size: 14px;
            color: var(--text-mid);
            margin-bottom: 4px;
        }
        .signal-confidence strong {
            font-size: 22px;
            color: var(--text-dark);
        }
        .signal-vote-info {
            font-size: 13px;
            color: var(--text-light);
            margin-bottom: 16px;
        }
        .signal-votes {
            display: flex;
            justify-content: center;
            gap: 32px;
        }
        .vote-item {
            text-align: center;
        }
        .vote-count {
            font-size: 28px;
            font-weight: 800;
        }
        .vote-count.buy { color: #22c55e; }
        .vote-count.sell { color: #ef4444; }
        .vote-count.hold { color: var(--blue-accent); }
        .vote-label {
            font-size: 13px;
            color: var(--text-mid);
            margin-top: 2px;
        }

        /* ===== 各模型分析详情标题 ===== */
        .detail-title {
            display: none;
            font-size: 14px;
            color: var(--text-light);
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .detail-title.active { display: flex; }

        /* ===== 分析结果区 ===== */
        .results-area {
            display: none;
            margin-bottom: 200px;
        }
        .results-area.active { display: block; }
        .result-card {
            background: var(--bg-white);
            border-radius: 16px;
            border: 1px solid var(--border);
            margin-bottom: 16px;
            overflow: hidden;
        }
        .result-header {
            padding: 16px 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid var(--border);
            background: #fafbfc;
            cursor: pointer;
            user-select: none;
            transition: background 0.2s;
        }
        .result-header:hover { background: #f1f5f9; }
        .result-model-icon {
            width: 36px; height: 36px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 14px;
            color: white;
            flex-shrink: 0;
        }
        .result-model-info { flex: 1; min-width: 0; }
        .result-model-name { font-weight: 600; font-size: 15px; }
        .result-model-desc { font-size: 12px; color: var(--text-light); margin-top: 1px; }
        .result-status {
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 0;
        }
        .result-status.loading { color: var(--blue-accent); }
        .result-status.done { color: var(--green-accent); }
        .result-status.error { color: #ef4444; }
        .result-elapsed {
            font-size: 12px;
            color: var(--text-light);
            flex-shrink: 0;
        }
        .result-toggle {
            font-size: 18px;
            color: var(--text-light);
            transition: transform 0.3s;
            flex-shrink: 0;
        }
        .result-toggle.open { transform: rotate(180deg); }
        .result-body {
            padding: 20px;
            font-size: 14px;
            line-height: 1.8;
            color: var(--text-dark);
            white-space: pre-wrap;
            word-wrap: break-word;
            max-height: none;
            overflow: visible;
            transition: padding 0.2s ease;
        }
        .result-body.collapsed {
            max-height: 0;
            overflow: hidden;
            padding-top: 0;
            padding-bottom: 0;
        }
        .result-body .loading-dots::after {
            content: '';
            animation: dots 1.5s infinite;
        }
        @keyframes dots {
            0% { content: ''; }
            25% { content: '.'; }
            50% { content: '..'; }
            75% { content: '...'; }
        }

        /* ===== AI综合总结区域 ===== */
        .summary-section {
            display: none;
            background: var(--bg-white);
            border-radius: 16px;
            border: 1px solid var(--border);
            overflow: hidden;
            margin-bottom: 24px;
        }
        .summary-section.active { display: block; }
        .summary-bar {
            padding: 16px 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid var(--border);
            background: #fffbeb;
        }
        .summary-bar-label {
            font-size: 15px;
            font-weight: 600;
            color: #b45309;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .summary-model-select {
            padding: 8px 14px;
            border: 1px solid var(--border);
            border-radius: 10px;
            font-size: 13px;
            font-family: inherit;
            background: white;
            color: var(--text-dark);
            cursor: pointer;
            outline: none;
        }
        .summary-model-select:focus { border-color: var(--purple-start); }
        .summary-generate-btn {
            padding: 8px 20px;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            border: none;
            cursor: pointer;
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: white;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
        }
        .summary-generate-btn:hover { box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3); }
        .summary-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .summary-body {
            padding: 20px;
            font-size: 14px;
            line-height: 1.8;
            color: var(--text-dark);
            white-space: pre-wrap;
            word-wrap: break-word;
            display: none;
        }
        .summary-body.active { display: block; }
        .analysis-time {
            text-align: center;
            font-size: 12px;
            color: var(--text-light);
            margin-bottom: 16px;
        }

        /* ===== 分析中的图片 ===== */
        .analyzing-image {
            display: none;
            margin-bottom: 24px;
        }
        .analyzing-image.active { display: block; }
        .analyzing-image img {
            width: 100%;
            max-height: 400px;
            object-fit: contain;
            border-radius: 16px;
            border: 2px solid var(--border);
        }

        /* ===== 模型选择弹窗 ===== */
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            z-index: 200;
            align-items: center;
            justify-content: center;
        }
        .modal-overlay.active { display: flex; }
        .modal-box {
            background: white;
            border-radius: 20px;
            padding: 32px;
            width: 90%;
            max-width: 480px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.2);
        }
        .modal-box h3 {
            font-size: 18px;
            margin-bottom: 20px;
        }
        .model-option {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            border: 2px solid var(--border);
            border-radius: 12px;
            margin-bottom: 10px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .model-option:hover { border-color: var(--purple-start); background: #faf5ff; }
        .model-option.selected { border-color: var(--purple-start); background: #f5f3ff; }
        .model-option input[type="checkbox"] {
            width: 18px; height: 18px;
            accent-color: var(--purple-start);
        }
        .model-option .model-icon {
            width: 32px; height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 12px;
            color: white;
        }
        .model-option .model-info {
            flex: 1;
        }
        .model-option .model-name { font-weight: 600; font-size: 14px; }
        .model-option .model-desc { font-size: 12px; color: var(--text-light); }
        .modal-footer {
            display: flex;
            gap: 12px;
            margin-top: 20px;
        }
        .modal-footer button {
            flex: 1;
            padding: 12px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            transition: all 0.2s;
        }
        .modal-footer .btn-cancel {
            background: var(--bg-main);
            color: var(--text-mid);
        }
        .modal-footer .btn-confirm {
            background: linear-gradient(135deg, var(--purple-start), var(--blue-accent));
            color: white;
        }

        /* ===== 隐藏文件输入 ===== */
        #fileInput { display: none; }

        /* ===== 底部间距 ===== */
        .bottom-spacer { height: 220px; }

        /* ===== 响应式 ===== */
        @media (max-width: 768px) {
            .top-header { padding: 12px 16px; }
            .header-title h1 { font-size: 16px; }
            .main-content { padding: 20px 16px; }
            .welcome-card { padding: 32px 24px; }
            .methods-grid { grid-template-columns: 1fr; }
            .bottom-actions { flex-wrap: wrap; }
            .upload-btn { margin-left: 0; }
            .nav-bar { padding: 0 16px; }
            .header-badge.hide-mobile { display: none; }
        }


/* ==========================================================================
   Mobile Responsive Rules
   ========================================================================== */
@media (min-width: 768px) {
  .bottom-bar-light {
    left: 25%;
  }
}
@media (min-width: 992px) {
  .bottom-bar-light {
    left: 16.666667%;
  }
}

@media (max-width: 767.98px) {
  /* 侧边栏不再霸占整屏，内容立即可见 */
  .sidebar {
    min-height: auto;
    max-height: none;
    position: static;
  }
  .sidebar-inner {
    padding: 0.85rem 0.85rem 1rem;
  }
  .sidebar-group-title {
    font-size: 0.7rem;
  }
  .sidebar .nav-link {
    padding: 0.7rem 0.7rem;
    font-size: 0.95rem;
  }
  .main-content-column {
    min-height: auto;
  }
  .content-body {
    padding: 1rem !important;
  }

  /* 统计卡片 2×2 */
  .stats-row > .col-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .stats-row > .col-md-3 .card-body {
    padding: 0.85rem;
  }

  .methods-grid-light {
    grid-template-columns: 1fr;
  }

  .bottom-bar-light {
    left: 0;
  }

  .btn-upload-pic {
    margin-left: 0;
  }

  .bottom-action-buttons {
    flex-wrap: wrap;
  }

  /* AI chart controls stay in the document flow on phones so the keyboard
     and page scrolling never cover the message composer. */
  .bottom-bar {
    position: static;
    bottom: auto;
    left: auto !important;
    right: auto;
    z-index: 20;
    margin: 1rem -1rem 0;
    box-shadow: 0 -2px 12px rgba(15,23,42,.08);
  }
  .main-content { padding-bottom: 0 !important; }
  .bottom-status,
  .bottom-actions,
  .bottom-input,
  .image-preview-bar {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .bottom-status { gap: .5rem; align-items: flex-start; }
  .status-models { min-width: 0; font-size: .72rem; line-height: 1.35; }
  .status-models span:last-child { white-space: normal; }
  .bottom-actions { flex-wrap: wrap; gap: .5rem; }
  .bottom-actions .action-btn,
  .bottom-actions .upload-btn { flex: 1 1 calc(50% - .5rem); justify-content: center; min-width: 0; padding: .65rem .7rem; }
  .upload-btn { margin-left: 0; }
  .bottom-input { align-items: stretch; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .chat-input { min-height: 48px; max-height: 35vh; font-size: 16px; line-height: 1.4; }
  .send-btn { width: 48px; height: 48px; }
  .payment-token-picker select { min-height: 44px; font-size: 16px; touch-action: manipulation; pointer-events: auto; }
  .payment-token-picker,
  .payment-token-picker select { position: relative; z-index: 30; pointer-events: auto; touch-action: manipulation; }
  .floating-support-container {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .floating-support-tooltip { display: none; }
  .floating-support-btn { width: 48px; height: 48px; font-size: 1.35rem; }
}

.payment-token-picker { position: relative; z-index: 30; pointer-events: auto; }
.payment-token-options { display: flex; flex-wrap: wrap; gap: .6rem; position: relative; z-index: 31; pointer-events: auto; }
.payment-token-option {
  flex: 1 1 120px; min-height: 46px; border: 1px solid #cbd5e1; border-radius: 8px;
  background: #fff; color: #334155; font-size: 1rem; font-weight: 700; cursor: pointer;
  pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.payment-token-option.active { border-color: #6366f1; background: #eef2ff; color: #4338ca; box-shadow: 0 0 0 2px rgba(99,102,241,.16); }
.payment-token-option:disabled { opacity: .55; cursor: not-allowed; }

/* Language menu uses ordinary buttons because some wallet WebViews do not
   reliably open a select nested inside a label. */
.locale-switcher {
  position: relative;
  z-index: 1200;
  min-width: 154px;
  pointer-events: auto;
}

.locale-switcher summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  width: 100%;
  padding: .55rem .7rem;
  border: 1px solid rgba(148, 163, 184, .45);
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  color: #1f2937;
  font-size: 16px;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.locale-switcher summary::-webkit-details-marker { display: none; }
.locale-switcher summary > * { pointer-events: none; }
.locale-switcher summary span { flex: 1; white-space: nowrap; }
.locale-switcher-chevron { transition: transform .18s ease; }
.locale-switcher[open] .locale-switcher-chevron { transform: rotate(180deg); }

.locale-switcher-menu {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  padding: 4px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
}

.locale-switcher-option {
  min-height: 44px;
  padding: .55rem .7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1f2937;
  text-align: left;
  font-size: 16px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.locale-switcher-option:hover,
.locale-switcher-option:focus-visible,
.locale-switcher-option.active {
  background: #eef2ff;
  color: #4338ca;
}

.sidebar-locale-selector summary {
  border-color: rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.login-locale-selector { width: min(100%, 190px); }

/* ==========================================================================
   Floating Customer Support Widget 1:1 Replica (Matching Screenshot)
   - Green circular chat icon
   - "1" unread red counter
   - "We Are Here!" curved speech banner with waving hand
   ========================================================================== */
.floating-support-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 10px;
}

.floating-support-tooltip {
  background: #ffffff;
  color: #1e293b;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 6px;
  animation: floatTooltip 3s ease-in-out infinite;
  user-select: none;
  cursor: pointer;
  white-space: nowrap;
}

.floating-support-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #22c55e;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 6px 22px rgba(34, 197, 94, 0.45);
  cursor: pointer;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
}

.floating-support-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(34, 197, 94, 0.6);
}

.floating-support-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.wave-hand {
  display: inline-block;
  animation: waveAnimation 2s infinite;
  transform-origin: 70% 70%;
}

@keyframes waveAnimation {
  0% { transform: rotate( 0.0deg) }
  10% { transform: rotate(14.0deg) }
  20% { transform: rotate(-8.0deg) }
  30% { transform: rotate(14.0deg) }
  40% { transform: rotate(-4.0deg) }
  50% { transform: rotate(10.0deg) }
  60% { transform: rotate( 0.0deg) }
  100% { transform: rotate( 0.0deg) }
}

@keyframes floatTooltip {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Modal Customer Support Box */
.support-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1060;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
}

@media (max-width: 767.98px) {
  .support-modal-backdrop {
    padding: 0;
  }
}

.support-modal-window {
  width: 420px;
  max-width: 100%;
  height: 620px;
  max-height: calc(100vh - 48px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpModal 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 767.98px) {
  .support-modal-window {
    width: 100%;
    height: 90vh;
    border-radius: 20px 20px 0 0;
  }
}

@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.support-modal-header {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: white;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.support-messages-box {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.support-msg-item {
  max-width: 82%;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.support-msg-item.ai {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid var(--border-color);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.support-msg-item.visitor {
  background: #22c55e;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.support-msg-item.system {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fef3c7;
  align-self: center;
  text-align: center;
  font-size: 0.8rem;
  max-width: 90%;
}

/* Keep the compact support launcher above the safe area on phones.  These
   overrides live after the desktop widget rules so mobile browsers cannot
   restore the wide tooltip and cover the AI composer. */
@media (max-width: 767.98px) {
  .floating-support-container {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    gap: 0;
  }

  .floating-support-tooltip {
    display: none;
  }

  .floating-support-btn {
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
  }
}

