/* ==========================================================================
   Stocktalk - Dark & Light Base Design System
   ========================================================================== */

:root {
  --bg-dark: #0B1020;
  --bg-surface: #12182B;
  --bg-card: #12182B;
  --bg-card-hover: #17213A;
  --bg-input: #0B1020;

  --accent-blue: #0052FF;
  --accent-blue-hover: #0052FF;
  --accent-cyan: #8B9BB8;
  --accent-indigo: #0052FF;
  --accent-emerald: #3DDC97;

  --text-primary: #E8EEF9;
  --text-secondary: #B3C0D6;
  --text-muted: #8B9BB8;

  --border-subtle: #1E2A4A;
  --border-accent: #0052FF;
  --border-blue: #0052FF;

  --shadow-sm: 2px 2px 0 #050916;
  --shadow-md: 3px 3px 0 #050916;
  --shadow-lg: 4px 4px 0 #050916;
  --glow-blue: none;

  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-full: 0;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

/* Light Theme Overrides Across Landing & App */
body.light-theme {
  --bg-dark: #E7EEF8;
  --bg-surface: #F7F4EC;
  --bg-card: #F7F4EC;
  --bg-card-hover: #E7EEF8;
  --bg-input: #F7F4EC;

  --text-primary: #1A2333;
  --text-secondary: #33415C;
  --text-muted: #5C6B82;

  --border-subtle: #C5D0E4;
  --border-accent: #0052FF;
  --border-blue: #0052FF;

  --shadow-sm: 2px 2px 0 #C5D0E4;
  --shadow-md: 3px 3px 0 #C5D0E4;
  --shadow-lg: 4px 4px 0 #C5D0E4;

  background: var(--bg-dark);
  color: var(--text-primary);
}

body.light-theme .landing-header,
body.light-theme .chat-topbar,
body.light-theme .composer,
body.light-theme .chat-sidebar,
body.light-theme .site-footer {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

body.light-theme .feature-card,
body.light-theme .step-card,
body.light-theme .safety-card,
body.light-theme .hero-stats-bar,
body.light-theme .landing-prompt-chip {
  background: #F7F4EC;
  border-color: #C5D0E4;
  color: #1A2333;
}

body.light-theme .chip-tag,
body.light-theme .token-chip {
  background: #E7EEF8;
  border-color: #C5D0E4;
  color: #33415C;
}

body.light-theme .feature-icon-wrapper.blue {
  background: rgba(0, 82, 255, 0.12);
  color: #0052ff;
}

body.light-theme .feature-icon-wrapper.amber {
  background: rgba(245, 196, 81, 0.16);
  color: #1A2333;
}

body.light-theme .hero-title {
  color: #1A2333;
}

body.light-theme .msg.assistant {
  background: #F7F4EC;
  border-color: #C5D0E4;
  color: #1A2333;
}

body.light-theme .composer-inner {
  background: #F7F4EC;
  border-color: #C5D0E4;
}

body.light-theme .attestation-panel {
  background: #F7F4EC;
  border-color: #C5D0E4;
}

body.light-theme .composer input {
  color: #1A2333;
}

body.light-theme .empty-chip {
  background: #F7F4EC;
  border-color: #C5D0E4;
  color: #1A2333;
}

body.light-theme .quote-card {
  background: #F7F4EC;
  border-color: #0052FF;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

body.light-theme .feedback-panel {
  background: #F7F4EC;
  border-color: #0052FF;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

body.light-theme .feedback-input,
body.light-theme .feedback-textarea {
  background: #F7F4EC;
  border-color: #C5D0E4;
  color: #1A2333;
}

body.light-theme .feedback-input:focus,
body.light-theme .feedback-textarea:focus {
  border-color: #0052ff;
  box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.15);
}

body.light-theme .feedback-close-btn {
  color: #5C6B82;
}

body.light-theme .feedback-close-btn:hover {
  background: #E7EEF8;
  color: #1A2333;
}

body.light-theme .feedback-char-count {
  color: #5C6B82;
}

body.light-theme .feedback-toast {
  background: #F7F4EC;
  border-color: #0052FF;
  color: #1A2333;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.attestation-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 16, 32, 0.78);
}

.attestation-overlay[hidden] {
  display: none;
}

.attestation-panel {
  width: min(100%, 520px);
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}

.attestation-panel h2 {
  margin-bottom: 10px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
}

.attestation-panel p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.attestation-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  cursor: pointer;
}

.attestation-check input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--accent-blue);
}

.attestation-continue {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--accent-blue);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.attestation-continue:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

body.light-theme .quote-row {
  border-bottom-color: #C5D0E4;
}

body.light-theme .quote-row span {
  color: #5C6B82;
}

body.light-theme .quote-row strong {
  color: #1A2333;
}

body.light-theme .confirm-actions .cancel {
  background: #E7EEF8;
  border-color: #C5D0E4;
  color: #33415C;
}

body.light-theme .nav-home-btn {
  background: #E7EEF8;
  border-color: #C5D0E4;
  color: #33415C;
}

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

html {
  height: 100%;
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg-dark);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Chat Page Specific Body Lock */
body#index {
  height: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh;
  overflow: hidden;
}

body#index .page-wrapper {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

body#index .site-footer {
  display: none;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* --------------------------------------------------------------------------
   Buttons & Base Components
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 82, 255, 0.35);
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 6px 20px rgba(0, 82, 255, 0.5);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  backdrop-filter: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

#landing .hero-cta-group .btn-secondary:hover {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: #1A2333;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  width: 20px;
  height: 20px;
}

/* Base Badge */
.base-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0, 82, 255, 0.15);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.base-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-blue);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-accent);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
}

/* --------------------------------------------------------------------------
   LANDING PAGE LAYOUT
   -------------------------------------------------------------------------- */
.landing-page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border-subtle);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

/* Hero */
.hero-section {
  padding: 80px 24px 60px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 24px;
}

.badge-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 82, 255, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(0, 82, 255, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 82, 255, 0);
  }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.gradient-text {
  color: var(--accent-blue);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.hero-stats-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 16px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: none;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border-subtle);
}

/* Features Grid */
.features-section,
.how-section,
.prompts-section,
.safety-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  justify-content: center;
  gap: 24px;
}

@media (min-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: none;
  transition: all 0.25s ease;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

.feature-icon-wrapper.blue {
  background: rgba(0, 82, 255, 0.15);
  color: var(--accent-blue);
}

.feature-icon-wrapper.cyan {
  background: rgba(0, 82, 255, 0.15);
  color: var(--accent-cyan);
}

.feature-icon-wrapper.indigo {
  background: rgba(0, 82, 255, 0.12);
  color: var(--accent-blue);
}

.feature-icon-wrapper.emerald {
  background: rgba(61, 220, 151, 0.15);
  color: var(--accent-emerald);
}

.feature-icon-wrapper.blue {
  background: rgba(0, 82, 255, 0.12);
  color: var(--accent-blue);
}

.feature-icon-wrapper.amber {
  background: rgba(245, 196, 81, 0.16);
  color: #F5C451;
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.925rem;
  line-height: 1.55;
}

/* Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.step-card {
  position: relative;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.step-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-blue);
  opacity: 0.8;
  margin-bottom: 12px;
}

.step-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.prompts-section {
  background: var(--bg-dark);
  border-radius: var(--radius-lg);
}

.prompt-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.landing-prompt-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
}

.landing-prompt-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.chip-icon {
  font-size: 1.2rem;
}

.chip-text {
  flex: 1;
  font-size: 0.925rem;
  font-weight: 500;
}

.chip-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* Safety Section */
.safety-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 28px;
  background: rgba(0, 82, 255, 0.08);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-lg);
}

.safety-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 82, 255, 0.2);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.safety-icon svg {
  width: 24px;
  height: 24px;
}

.safety-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.safety-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   CHAT PAGE LAYOUT (FIXED HEIGHT WORKSPACE)
   -------------------------------------------------------------------------- */
.chat-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-surface);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.topbar-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.topbar-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
}

.nav-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 36px;
}

.nav-home-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.nav-icon {
  width: 16px;
  height: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wallet-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-copy-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 200;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.wallet-copy-popup button {
  width: 44px;
  height: 44px;
  padding: 10px;
  background: var(--accent-blue);
  border: 0;
  border-radius: var(--radius-sm);
  color: #ffffff;
  cursor: pointer;
}

.wallet-copy-popup svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.copy-toast {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 250;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.history-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.hamburger-icon,
.hamburger-icon span {
  display: block;
}

.hamburger-icon {
  width: 20px;
}

.hamburger-icon span {
  height: 2px;
  margin: 4px 0;
  background: currentColor;
  border-radius: 2px;
}

.wallet-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  background: var(--accent-blue);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wallet-controls {
  position: relative;
}

.wallet-choice-popup {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 240px;
  gap: 8px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.wallet-choice-popup[hidden] {
  display: none;
}

.wallet-choice-popup button {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  color: var(--text-primary);
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.wallet-choice-popup button:hover {
  border-color: var(--accent-blue);
}

.wallet-choice-popup button span {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.wallet-btn:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 4px 12px rgba(0, 82, 255, 0.4);
}

.wallet-btn.connected {
  background: var(--bg-surface);
  border-color: var(--border-accent);
  color: var(--accent-cyan);
}

.wallet-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.disconnect-btn {
  min-height: 40px;
  padding: 8px 12px;
  background: rgba(255, 92, 122, 0.12);
  border: 1px solid #FF5C7A;
  color: #FF5C7A;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.disconnect-btn:hover {
  background: rgba(255, 92, 122, 0.2);
}

/* Chat Main Layout */
.chat-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  min-height: 0;
  height: 100%;
}

.chat-sidebar {
  width: 280px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-header h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 12px;
}

.token-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.token-chip {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-balances .sidebar-header h3 {
  margin-bottom: 14px;
}

.balances-group {
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.balances-group + .balances-group {
  margin-top: 12px;
}

.balances-group-title {
  margin: 0 0 7px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
}

.balances-row {
  display: flex;
  justify-content: space-between;
  min-width: 0;
  gap: 10px;
  padding: 5px 0;
  color: var(--text-secondary);
  font-size: 0.775rem;
  line-height: 1.35;
}

.balances-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.balances-row strong {
  color: var(--text-primary);
  font-size: inherit;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.balances-status {
  color: var(--text-muted);
  font-size: 0.775rem;
  line-height: 1.45;
}

.history-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
}

.history-status {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 64px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.history-details {
  min-width: 0;
}

.history-kind,
.history-hash {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.history-kind strong {
  color: var(--text-primary);
  font-size: 0.78rem;
}

.history-pair {
  overflow: hidden;
  margin: 2px 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-link {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 4px;
  color: var(--accent-cyan);
  font-size: 0.72rem;
  text-align: right;
  text-decoration: none;
}

.history-link:hover {
  color: var(--text-primary);
}

.history-mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 301;
  display: none;
  width: min(88vw, 360px);
  height: 100dvh;
  padding: 24px 18px;
  overflow-y: auto;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.history-mobile-panel.is-open {
  transform: translateX(0);
}

.history-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.history-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

body.history-drawer-open {
  overflow: hidden;
}

/* Chat Shell */
.chat-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: transparent;
  position: relative;
}

.log {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.empty-state {
  margin: auto;
  text-align: center;
  max-width: 500px;
  padding: 40px 20px;
}

.empty-state h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.empty-chips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.empty-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

/* Chat Messages */
.msg {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-word;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg.user {
  align-self: flex-end;
  background: var(--accent-blue);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.msg.assistant {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  backdrop-filter: none;
}

.msg.thinking {
  color: var(--accent-cyan);
  font-style: italic;
  animation: pulseText 1.5s infinite alternate;
}

@keyframes pulseText {
  from {
    opacity: 0.6;
  }

  to {
    opacity: 1;
  }
}

.msg.error {
  background: rgba(255, 92, 122, 0.12);
  border: 1px solid #FF5C7A;
  color: #FF5C7A;
}

/* Quote Card */
.quote-card {
  align-self: flex-start;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-top: 8px;
  backdrop-filter: none;
  position: relative;
}

.quote-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.quote-card .enable-col,
.quote-card .skip-col {
  border-radius: 10px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

.quote-card .enable-col {
  background: var(--accent-blue);
  color: #FFFFFF;
  border: 0;
}

.quote-card .skip-col {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  opacity: 0.8;
}

.quote-card button:disabled,
.quote-card .enable-col:disabled,
.quote-card .skip-col:disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.2);
}

body.light-theme .quote-card .enable-col {
  color: #FFFFFF;
}

.mock-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 2px 8px;
  background: rgba(245, 196, 81, 0.14);
  border: 1px solid #F5C451;
  color: #F5C451;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

.quote-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.quote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.quote-row span {
  color: var(--text-secondary);
}

.quote-row strong {
  color: var(--text-primary);
}

.confirm-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.confirm-actions button {
  flex: 1;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.confirm-actions .confirm {
  background: var(--accent-blue);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.confirm-actions .confirm:hover:not(:disabled) {
  background: var(--accent-blue-hover);
  box-shadow: 0 4px 12px rgba(0, 82, 255, 0.4);
}

.confirm-actions .confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.confirm-actions .cancel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.confirm-actions .cancel:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.action-editor {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.action-editor-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-editor-field > span {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.action-editor-field input,
.action-editor-field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
}

.action-editor-field .action-amount-display {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
}

.action-editor-field select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.action-editor .action-balance {
  min-height: 1em;
  font-size: 0.75rem;
}

.action-editor .action-position-balance {
  min-height: 1em;
  font-size: 0.75rem;
}

.action-editor .action-presets {
  margin-top: 2px;
}

.action-editor .gift-preset {
  color: var(--text-primary);
}

.action-update {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.action-update:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.action-edit-error {
  margin: 0;
  color: #FF5C7A;
  font-size: 0.8rem;
}

.basket-leg {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.basket-leg .action-editor {
  margin: 8px 0 0;
}

/* Composer Input Bar */
.composer {
  padding: 8px 24px 12px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  margin-bottom: 0;
}

.composer-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 16px;
  transition: all 0.2s ease;
}

.composer-inner:focus-within {
  border-color: var(--border-accent);
  box-shadow: 0 0 16px rgba(0, 82, 255, 0.15);
}

.composer input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.975rem;
}

.composer input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 18px;
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.send-btn:hover:not(:disabled) {
  background: var(--accent-blue-hover);
  box-shadow: 0 2px 10px rgba(0, 82, 255, 0.4);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.send-icon {
  width: 16px;
  height: 16px;
}

.app-disclaimer {
  flex-shrink: 0;
  margin: 0;
  padding: 0 24px 10px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: center;
}

.basket-card .quote-row {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
}

.basket-card .quote-row.error {
  opacity: 0.75;
  font-size: 0.85rem;
}

.basket-card .muted {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.gift-card .gift-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.gift-card .gift-field span {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.gift-card .gift-field input,
.gift-card .gift-field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
}

.gift-card .gift-field select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.gift-card .gift-resolved {
  min-height: 1em;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.gift-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gift-preset {
  flex: 1;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.gift-preset:hover {
  background: rgba(255, 255, 255, 0.12);
}

.gift-error {
  margin: 8px 0 0;
  color: #FF5C7A;
  font-size: 0.8rem;
}

body.light-theme .gift-error {
  color: #FF5C7A;
}

body.light-theme .gift-preset {
  background: #E7EEF8;
  border-color: #C5D0E4;
  color: #1A2333;
}

body.light-theme .gift-card .gift-field input,
body.light-theme .gift-card .gift-field select {
  background: #F7F4EC;
  border-color: #C5D0E4;
  color: #1A2333;
}

body.light-theme .gift-card .gift-field select option {
  background: #F7F4EC;
  color: #1A2333;
}

body.light-theme .action-editor-field input,
body.light-theme .action-editor-field select {
  background: #F7F4EC;
  border-color: #C5D0E4;
  color: #1A2333;
}

body.light-theme .action-editor-field select option {
  background: #F7F4EC;
  color: #1A2333;
}

body.light-theme .action-editor .gift-preset,
body.light-theme .action-update {
  background: #E7EEF8;
  border-color: #C5D0E4;
  color: #1A2333;
}

body.light-theme .action-editor .gift-preset:hover,
body.light-theme .action-update:hover:not(:disabled) {
  background: #D9E4F3;
}


body.light-theme .app-disclaimer {
  color: #5C6B82;
}

@media (max-width: 768px) {
  .app-disclaimer {
    padding: 0 16px calc(8px + env(safe-area-inset-bottom, 0px));
    font-size: 0.68rem;
  }
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  background: rgba(4, 6, 14, 0.95);
  border-top: 1px solid var(--border-subtle);
  padding: 40px 24px 24px;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.footer-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-links-group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--accent-cyan);
}

.footer-link .icon {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.disclaimer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 750px;
}

.copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .chat-sidebar {
    display: none;
  }

  .history-toggle {
    position: fixed;
    top: 60px;
    right: 14px;
    z-index: 200;
    display: inline-flex;
  }

  .history-mobile-panel {
    display: block;
  }

  .history-mobile-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .history-mobile-heading h2 {
    font-family: var(--font-heading);
    font-size: 1rem;
  }

  .history-close {
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font: inherit;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .hero-stats-bar {
    gap: 16px;
    padding: 12px 20px;
  }

  .stat-divider {
    height: 20px;
  }

  .footer-container,
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-topbar {
    padding: 12px 16px;
  }

  .topbar-title {
    font-size: 1.1rem;
  }

  .nav-home-btn span {
    display: none;
  }
}

/* Sub-560px Header Rowover / Wrap Setup for Landing & Chat pages */
@media (max-width: 560px) {
  .landing-header .header-container {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .landing-header .header-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .chat-topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 14px;
  }

  .topbar-left {
    gap: 12px;
  }

  .topbar-right {
    flex-wrap: wrap;
    gap: 10px;
  }

  .wallet-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .wallet-btn,
  .disconnect-btn {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 0.825rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 40px 16px;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  .composer {
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
    margin-bottom: 0;
  }

  .send-btn span {
    display: none;
  }

  .msg {
    max-width: 90%;
  }
}

/* ==========================================================================
   Feedback Widget (Floating Trigger & Expanded Card)
   ========================================================================== */

.feedback-widget-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
}

.feedback-fab-btn {
  position: fixed;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--accent-blue);
  color: #ffffff;
  border: 1px solid var(--border-blue);
  box-shadow: var(--shadow-md), var(--glow-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  z-index: 501;
}

.feedback-fab-btn:hover {
  background: var(--accent-blue-hover);
  transform: scale(1.06);
  box-shadow: var(--shadow-lg), 0 0 28px rgba(0, 82, 255, 0.4);
}

.feedback-fab-btn:active,
.feedback-fab-btn.is-dragging {
  cursor: grabbing;
  transform: scale(0.96);
}

.feedback-fab-btn.is-success {
  background: var(--accent-emerald) !important;
  border-color: #3DDC97 !important;
  box-shadow: 0 0 20px rgba(61, 220, 151, 0.4) !important;
}

.feedback-fab-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.feedback-fab-icon,
.feedback-fab-success-icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.feedback-panel {
  position: fixed;
  pointer-events: auto;
  z-index: 502;
  width: min(calc(100vw - 24px), 340px);
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: feedbackPanelIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.feedback-panel[hidden] {
  display: none;
}

@keyframes feedbackPanelIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(4px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.feedback-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.feedback-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-header-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-cyan);
}

.feedback-panel-header h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.feedback-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.feedback-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.feedback-close-btn svg {
  width: 16px;
  height: 16px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feedback-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feedback-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.feedback-required {
  color: #FF5C7A;
  margin-left: 2px;
}

.feedback-optional {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 400;
}

.feedback-input,
.feedback-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feedback-input:focus,
.feedback-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.15);
}

.feedback-input.input-error,
.feedback-textarea.input-error {
  border-color: #FF5C7A !important;
  box-shadow: 0 0 0 3px rgba(255, 92, 122, 0.15) !important;
}

.feedback-textarea {
  resize: vertical;
  min-height: 76px;
  max-height: 180px;
}

.feedback-char-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

.feedback-char-count.is-under {
  color: #F5C451;
}

.feedback-char-count.is-max {
  color: #FF5C7A;
}

.feedback-inline-error {
  font-size: 0.72rem;
  color: #FF5C7A;
  line-height: 1.2;
}

.feedback-inline-error:empty {
  display: none;
}

.feedback-form-alert {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.35;
}

.feedback-form-alert.alert-error {
  background: rgba(255, 92, 122, 0.12);
  border: 1px solid #FF5C7A;
  color: #FF5C7A;
}

.feedback-form-alert.alert-success {
  background: rgba(61, 220, 151, 0.15);
  border: 1px solid #3DDC97;
  color: #3DDC97;
}

.feedback-submit-btn {
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  padding: 8px 14px;
  background: var(--accent-blue);
  color: #ffffff;
  border: 0;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.feedback-submit-btn:hover:not(:disabled) {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
}

.feedback-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.feedback-btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: feedbackSpin 0.7s linear infinite;
}

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

.feedback-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 550;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.feedback-toast[hidden] {
  display: none;
}

.feedback-toast.is-visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.feedback-toast-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-emerald);
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Base pixel-terminal skin */
:root {
  --bg-dark: #0B1020;
  --bg-surface: #12182B;
  --bg-card: #12182B;
  --bg-card-hover: #17213A;
  --bg-input: #0B1020;
  --accent-blue: #0052FF;
  --accent-blue-hover: #0052FF;
  --accent-cyan: #8B9BB8;
  --accent-indigo: #0052FF;
  --accent-emerald: #3DDC97;
  --text-primary: #E8EEF9;
  --text-secondary: #B3C0D6;
  --text-muted: #8B9BB8;
  --border-subtle: #1E2A4A;
  --border-accent: #0052FF;
  --border-blue: #0052FF;
  --shadow-sm: 2px 2px 0 #050916;
  --shadow-md: 3px 3px 0 #050916;
  --shadow-lg: 4px 4px 0 #050916;
  --glow-blue: none;
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-full: 0;
  --font-pixel: "Press Start 2P", "Silkscreen", monospace;
}

body.light-theme {
  --bg-dark: #E7EEF8;
  --bg-surface: #F7F4EC;
  --bg-card: #F7F4EC;
  --bg-card-hover: #E7EEF8;
  --bg-input: #F7F4EC;
  --text-primary: #1A2333;
  --text-secondary: #33415C;
  --text-muted: #5C6B82;
  --border-subtle: #C5D0E4;
  --border-accent: #0052FF;
  --border-blue: #0052FF;
  --shadow-sm: 2px 2px 0 #C5D0E4;
  --shadow-md: 3px 3px 0 #C5D0E4;
  --shadow-lg: 4px 4px 0 #C5D0E4;
  background: var(--bg-dark);
  color: var(--text-primary);
}

html {
  background: var(--bg-dark);
  color: var(--text-primary);
  scroll-behavior: auto;
}

body,
body.light-theme {
  background: var(--bg-dark);
  color: var(--text-primary);
}

.page-wrapper,
.landing-page,
.chat-page,
.chat-container,
.chat-shell {
  background: var(--bg-dark);
}

.landing-header,
.chat-topbar,
.composer,
.chat-sidebar,
.site-footer,
body.light-theme .landing-header,
body.light-theme .chat-topbar,
body.light-theme .composer,
body.light-theme .chat-sidebar,
body.light-theme .site-footer {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  backdrop-filter: none;
}

.landing-header,
.chat-topbar {
  border-bottom: 1px solid var(--border-subtle);
}

.chat-sidebar {
  border-right: 1px solid var(--border-subtle);
}

.composer {
  border-top: 1px solid var(--border-subtle);
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
}

.btn,
.wallet-btn,
.disconnect-btn,
.theme-toggle-btn,
.nav-home-btn,
.history-toggle,
.empty-chip,
.landing-prompt-chip,
.send-btn,
.quote-card button,
.gift-preset,
.confirm-actions button,
.attestation-continue {
  border-radius: 0;
  box-shadow: 2px 2px 0 #050916;
  transition: background-color 100ms steps(2, end), border-color 100ms steps(2, end),
    color 100ms steps(2, end), transform 80ms steps(2, end), box-shadow 80ms steps(2, end);
}

.btn-primary,
.wallet-btn,
.send-btn,
.confirm-actions .confirm,
.quote-card .enable-col,
.attestation-continue,
.wallet-copy-popup button {
  background: #0052FF;
  border: 1px solid #0052FF;
  color: #FFFFFF;
  box-shadow: 2px 2px 0 #0B1020;
}

.btn-primary:hover,
.wallet-btn:hover,
.send-btn:hover:not(:disabled),
.confirm-actions .confirm:hover:not(:disabled),
.quote-card .enable-col:hover:not(:disabled),
.attestation-continue:hover:not(:disabled) {
  background: #0052FF;
  border-color: #0052FF;
  box-shadow: 2px 2px 0 #0B1020;
  transform: translate(-1px, -1px);
}

.btn-primary:active,
.wallet-btn:active,
.send-btn:active:not(:disabled),
.confirm-actions button:active:not(:disabled),
.quote-card button:active:not(:disabled),
.theme-toggle-btn:active,
.nav-home-btn:active,
.landing-prompt-chip:active,
.empty-chip:active,
.gift-preset:active,
.attestation-continue:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.btn-primary:disabled,
.wallet-btn:disabled,
.send-btn:disabled,
.confirm-actions button:disabled,
.quote-card button:disabled,
.gift-preset:disabled,
.attestation-continue:disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

.btn-secondary,
.theme-toggle-btn,
.nav-home-btn,
.history-toggle,
.empty-chip,
.landing-prompt-chip,
.confirm-actions .cancel,
.gift-preset {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  backdrop-filter: none;
}

.base-badge,
.hero-badge {
  background: #0052FF;
  border: 1px solid #0052FF;
  border-radius: 0;
  color: #FFFFFF;
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.6;
}

.base-dot,
.badge-pulse {
  border-radius: 0;
  box-shadow: none;
  animation: none;
}

.hero-section {
  max-width: 1040px;
}

.hero-title {
  color: var(--text-primary);
  letter-spacing: 0;
}

body.light-theme .hero-title {
  color: var(--text-primary);
}

.gradient-text {
  color: #0052FF;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.hero-stats-bar,
.feature-card,
.step-card,
.safety-card,
.landing-prompt-chip,
.prompts-section,
.quote-card,
.history-item,
.history-mobile-panel,
.attestation-panel,
.feedback-panel,
.feedback-toast {
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}

body.light-theme .feature-card,
body.light-theme .step-card,
body.light-theme .safety-card,
body.light-theme .hero-stats-bar,
body.light-theme .landing-prompt-chip,
body.light-theme .quote-card,
body.light-theme .history-item,
body.light-theme .attestation-panel,
body.light-theme .feedback-panel,
body.light-theme .feedback-toast {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.feature-card:hover,
.landing-prompt-chip:hover,
.empty-chip:hover {
  border-color: #0052FF;
  background: var(--bg-card-hover);
  transform: none;
  box-shadow: var(--shadow-sm);
}

body.light-theme .nav-home-btn,
body.light-theme .empty-chip,
body.light-theme .confirm-actions .cancel {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.section-title,
.sidebar-header h3,
.history-mobile-heading h2,
.empty-state h2,
.quote-card h3,
.feature-card h3,
.step-content h3,
.safety-content h3 {
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0;
  font-weight: 400;
}

.hero-title,
.empty-state h2 {
  line-height: 1.5;
}

.hero-subtitle,
.section-description,
.feature-card p,
.step-content p,
.safety-content p,
.footer-tagline,
.disclaimer-text,
.app-disclaimer,
.msg {
  font-size: 14px;
}

.stat-value,
.balances-row strong,
.history-pair,
.history-hash,
.quote-row strong,
.quote-row span,
.gift-card input,
.gift-card select,
.msg code,
.msg pre,
.history-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.hero-stats-bar,
.feature-card,
.step-card,
.landing-prompt-chip,
.safety-card {
  border-color: var(--border-subtle);
}

.empty-chip,
.landing-prompt-chip,
.chip-tag,
.token-chip {
  border-radius: 0;
}

.chip-tag,
.token-chip {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.msg {
  max-width: min(82%, 720px);
  border-radius: 0;
  animation: pixel-step-in 120ms steps(2, end) both;
}

.msg.user {
  background: #0052FF;
  color: #FFFFFF;
  border: 1px solid #0052FF;
  box-shadow: var(--shadow-sm);
}

.msg.assistant {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  backdrop-filter: none;
}

body.light-theme .msg.assistant {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.msg.thinking {
  color: var(--text-secondary);
  font-style: normal;
  animation: none;
}

.msg.thinking::after {
  content: " ···";
  color: #0052FF;
  animation: thinking-dots 900ms steps(3, end) infinite;
}

.msg.error,
.gift-error {
  color: #FF5C7A;
}

.msg.error {
  background: rgba(255, 92, 122, 0.12);
  border-color: #FF5C7A;
}

.mock-tag {
  background: rgba(245, 196, 81, 0.14);
  border-color: #F5C451;
  border-radius: 0;
  color: #F5C451;
}

body.light-theme .mock-tag {
  color: #1A2333;
}

.quote-card {
  border-color: var(--border-subtle);
  margin-top: 4px;
  animation: pixel-step-in 120ms steps(2, end) both;
}

.quote-card h3 {
  color: var(--text-primary);
}

.quote-row {
  border-color: var(--border-subtle);
}

.confirm-actions .cancel {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.confirm-actions .confirm:hover:not(:disabled) {
  background: #0052FF;
  box-shadow: 2px 2px 0 #0B1020;
}

.confirm-actions .confirm:disabled,
.quote-card button:disabled,
.quote-card .enable-col:disabled,
.quote-card .skip-col:disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: none;
}

.composer-inner,
.composer-inner:focus-within,
.gift-card .gift-field input,
.gift-card .gift-field select,
body.light-theme .composer-inner,
body.light-theme .gift-card .gift-field input,
body.light-theme .gift-card .gift-field select,
.feedback-input,
.feedback-textarea {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--text-primary);
  box-shadow: none;
}

.composer-inner:focus-within,
.feedback-input:focus,
.feedback-textarea:focus {
  border-color: #0052FF;
  box-shadow: 2px 2px 0 #0B1020;
}

.gift-card .gift-field select option,
body.light-theme .gift-card .gift-field select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.gift-preset,
body.light-theme .gift-preset {
  background: var(--bg-dark);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.balances-row {
  animation: sidebar-row-flash 140ms steps(1, end) both;
}

.history-section,
.balances-group {
  border-color: var(--border-subtle);
}

.history-link,
.footer-link {
  color: #0052FF;
}

.history-link:hover,
.footer-link:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-color: var(--border-subtle);
}

.feature-icon-wrapper,
.safety-icon {
  border-radius: 0;
}

.feature-icon-wrapper.blue,
.feature-icon-wrapper.cyan,
.feature-icon-wrapper.indigo,
.feature-icon-wrapper.emerald,
.feature-icon-wrapper.amber,
.safety-icon {
  background: rgba(0, 82, 255, 0.12);
  color: #0052FF;
}

.feedback-panel,
.feedback-toast {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.balances-row {
  border: 1px solid var(--border-subtle);
}

.page-loader {
  background: #0B1020;
  color: #E8EEF9;
  transition: opacity 180ms steps(2, end), visibility 180ms steps(2, end);
}

.page-loader-grid {
  position: absolute;
  inset: 0;
  opacity: 0.34;
  background-color: #0052FF;
  background-image:
    linear-gradient(to right, #0B1020 1px, transparent 1px),
    linear-gradient(to bottom, #0B1020 1px, transparent 1px);
  background-size: 8px 8px;
}

.page-loader-content {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: 28px;
  background: #0B1020;
  border: 2px solid #0052FF;
  box-shadow: 6px 6px 0 #050916;
}

.page-loader-label {
  color: #E8EEF9;
  font-family: var(--font-pixel);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.page-loader-bar {
  display: flex;
  gap: 4px;
  width: 192px;
  height: 12px;
}

.page-loader-bar span {
  flex: 1;
  background: #1E2A4A;
  border: 1px solid #0052FF;
  animation: boot-dither 480ms steps(4, end) infinite;
}

.page-loader-bar span:nth-child(2) {
  animation-delay: 60ms;
}

.page-loader-bar span:nth-child(3) {
  animation-delay: 120ms;
}

.page-loader-bar span:nth-child(4) {
  animation-delay: 180ms;
}

body.light-theme .page-loader {
  background: #E7EEF8;
  color: #1A2333;
}

body.light-theme .page-loader-grid {
  background-color: #0052FF;
  background-image:
    linear-gradient(to right, #E7EEF8 1px, transparent 1px),
    linear-gradient(to bottom, #E7EEF8 1px, transparent 1px);
}

body.light-theme .page-loader-content {
  background: #F7F4EC;
  border-color: #0052FF;
  box-shadow: 6px 6px 0 #C5D0E4;
}

body.light-theme .page-loader-label {
  color: #1A2333;
}

@keyframes boot-dither {
  0%,
  100% {
    background: #0052FF;
  }

  25% {
    background: #1E2A4A;
  }

  50% {
    background: #0052FF;
  }

  75% {
    background: #8B9BB8;
  }
}

.hero-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

body#landing .page-wrapper {
  position: relative;
  isolation: isolate;
}

body#landing .landing-page,
body#landing .site-footer {
  position: relative;
  z-index: 1;
}

body#landing .landing-page {
  background: transparent;
}

.ticker-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ticker-field::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(48vw, 620px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(0, 82, 255, 0.18), rgba(0, 82, 255, 0.05) 34%, transparent 70%);
  content: "";
  transform: translate(-50%, -50%);
}

.ticker-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 50%;
  opacity: 0.48;
  transform: translate(-50%, -50%) rotate(-18deg);
  animation: ticker-orbit 48s linear infinite;
  pointer-events: none;
}

.ticker-chip {
  position: absolute;
  top: var(--ticker-y);
  left: var(--ticker-x);
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid #0052FF;
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  transform: translate(-50%, -50%);
  animation: ticker-inward 18s linear infinite, ticker-flip 4s steps(2, end) infinite;
  animation-delay: var(--flow-delay), var(--flip-delay);
}

@keyframes ticker-orbit {
  from {
    transform: translate(-50%, -50%) rotate(-18deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(342deg);
  }
}

@keyframes ticker-inward {
  from {
    top: var(--ticker-y);
    left: var(--ticker-x);
    opacity: 0.9;
  }

  to {
    top: 50%;
    left: 50%;
    opacity: 0;
  }
}

@keyframes ticker-flip {
  0%,
  44%,
  56%,
  100% {
    transform: translate(-50%, -50%) scaleX(1);
  }

  48%,
  52% {
    transform: translate(-50%, -50%) scaleX(0);
  }
}

.balances-toggle,
.balances-backdrop {
  display: none;
}

.wallet-copy-popup {
  display: grid;
  gap: 6px;
  min-width: 160px;
}

.wallet-copy-popup[hidden] {
  display: none;
}

.wallet-copy-popup #copy-wallet-address,
.wallet-copy-popup .disconnect-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  background: var(--bg-dark);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.wallet-copy-popup #copy-wallet-address {
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 8px;
  background: #0052FF;
  border-color: #0052FF;
  color: #FFFFFF;
}

.wallet-copy-popup .disconnect-btn {
  margin: 0;
  color: #FF5C7A;
}

@media (max-width: 900px) {
  .chat-container {
    position: relative;
  }

  .chat-sidebar {
    display: contents;
  }

  .chat-sidebar .history-section {
    display: none;
  }

  .history-toggle {
    display: inline-flex;
  }

  .history-mobile-panel {
    display: block;
  }

  .sidebar-balances {
    display: none;
  }

  .sidebar-balances.is-open {
    position: absolute;
    top: 12px;
    right: 12px;
    left: 12px;
    z-index: 6;
    display: block;
    max-height: min(72dvh, 640px);
    padding: 16px;
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
  }

  .balances-backdrop.is-visible {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
    background: rgba(11, 16, 32, 0.72);
  }

  .balances-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 40px;
    padding: 8px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-pixel);
    font-size: 10px;
    box-shadow: 2px 2px 0 #050916;
  }
}

.composer-inner,
.composer input,
.gift-card .gift-field input,
.gift-card .gift-field select,
.feedback-input,
.feedback-textarea {
  background: var(--bg-surface);
  color: var(--text-primary);
}

body.light-theme .composer-inner,
body.light-theme .composer input,
body.light-theme .gift-card .gift-field input,
body.light-theme .gift-card .gift-field select,
body.light-theme .feedback-input,
body.light-theme .feedback-textarea {
  background: #F7F4EC;
  color: #1A2333;
}

.gift-card .gift-field select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

body.light-theme .gift-card .gift-field select option {
  background: #F7F4EC;
  color: #1A2333;
}

.action-juice {
  position: absolute;
  top: auto;
  bottom: -4px;
  right: 16px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  transform: scale(1.6);
  transform-origin: center;
  pointer-events: none;
}

.juice-sprite {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
  background: #0052FF;
}

.juice-coin .juice-sprite {
  width: 16px;
  height: 16px;
  box-shadow:
    -5px 0 #0052FF, 5px 0 #0052FF,
    0 -5px #0052FF, 0 5px #0052FF,
    0 0 0 3px #F7F4EC inset;
  animation: coin-hop 1300ms steps(3, end) both;
}

.juice-envelope .juice-sprite {
  width: 28px;
  height: 20px;
  background: #0052FF;
  border: 3px solid #F7F4EC;
  animation: envelope-slide 1300ms steps(4, end) both;
}

.juice-envelope .juice-sprite::after {
  position: absolute;
  top: -2px;
  left: 6px;
  width: 14px;
  height: 14px;
  content: "";
  border-left: 4px solid #F7F4EC;
  border-bottom: 4px solid #F7F4EC;
  background: transparent;
  transform: rotate(-45deg);
}

.juice-stack .juice-sprite {
  width: 16px;
  height: 10px;
  background: #0052FF;
  box-shadow: -6px -10px 0 #0052FF, 6px -10px 0 #0052FF, 0 -20px 0 #0052FF;
  animation: block-stack 1300ms steps(3, end) both;
}

.juice-flag .juice-sprite {
  width: 4px;
  height: 26px;
  background: #F7F4EC;
  box-shadow: 0 13px 0 #0052FF;
  animation: flag-plant 1300ms steps(2, end) both;
}

.juice-flag .juice-sprite::after {
  position: absolute;
  top: 0;
  left: 4px;
  width: 17px;
  height: 10px;
  content: "";
  background: #F5C451;
}

@keyframes coin-hop {
  0% { transform: translateY(4px); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

@keyframes envelope-slide {
  0% { transform: translateX(-12px); }
  50% { transform: translateX(10px); }
  100% { transform: translateX(28px); }
}

@keyframes block-stack {
  0% { transform: translateY(6px); }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

@keyframes flag-plant {
  0% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

@keyframes pixel-step-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes thinking-dots {
  0%,
  100% {
    opacity: 0.25;
  }

  33% {
    opacity: 0.55;
  }

  66% {
    opacity: 1;
  }
}

@keyframes sidebar-row-flash {
  0% {
    border-color: #0052FF;
  }

  100% {
    border-color: var(--border-subtle);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-orbit,
  .ticker-chip,
  .page-loader-bar span,
  .action-juice,
  .juice-sprite {
    animation: none !important;
  }

  .msg,
  .quote-card,
  .balances-row,
  .msg.thinking::after {
    animation: none;
  }
}

/* Landing page editorial layout */
body#landing .landing-header {
  background: var(--bg-surface);
}

body#landing .landing-header .header-container {
  max-width: 1184px;
  padding: 18px 32px;
}

body#landing .brand-name {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

body#landing .header-actions {
  gap: 14px;
}

body#landing .landing-main {
  width: 100%;
  flex: 1;
}

body#landing .hero-section {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(104px, 15vw, 176px) 32px 132px;
  text-align: left;
}

body#landing .hero-content {
  position: relative;
  z-index: 1;
  width: min(100%, 1120px);
  margin: 0 auto;
}

body#landing .landing-eyebrow,
body#landing .landing-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

body#landing .landing-eyebrow-line {
  width: 24px;
  height: 1px;
  background: var(--accent-blue);
}

body#landing .landing-title {
  max-width: 920px;
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: clamp(3rem, 7.2vw, 6.35rem);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 0.99;
}

body#landing .landing-title span {
  color: var(--accent-blue);
}

body#landing .landing-subtitle {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.45vw, 1.12rem);
  line-height: 1.7;
}

body#landing .landing-cta-group {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 34px;
}

body#landing .landing-primary-cta {
  min-height: 50px;
  padding: 12px 20px;
  border: 1px solid var(--accent-blue);
  border-radius: 2px;
  box-shadow: none;
  font-size: 0.94rem;
  font-weight: 600;
}

body#landing .landing-primary-cta:hover {
  box-shadow: none;
  transform: translateY(-1px);
}

body#landing .landing-primary-cta .btn-icon {
  width: 17px;
  height: 17px;
}

body#landing .landing-secondary-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
}

body#landing .landing-secondary-cta:hover {
  color: var(--text-primary);
}

body#landing .landing-secondary-cta span {
  color: var(--accent-blue);
}

body#landing .landing-capabilities {
  width: min(100% - 64px, 1120px);
  margin: 0 auto;
  padding: 38px 0 96px;
  border-top: 1px solid var(--border-subtle);
  scroll-margin-top: 92px;
}

body#landing .landing-section-heading {
  margin-bottom: 32px;
}

body#landing .landing-section-heading .landing-kicker {
  margin-bottom: 12px;
}

body#landing .landing-section-heading h2 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

body#landing .landing-capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 64px;
  row-gap: 0;
}

body#landing .landing-capability {
  min-width: 0;
  padding: 26px 0 30px;
  border-top: 1px solid var(--border-subtle);
}

body#landing .landing-capability-number {
  display: block;
  margin-bottom: 14px;
  color: var(--accent-blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 500;
}

body#landing .landing-capability h3 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1.14rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.4;
}

body#landing .landing-capability p {
  max-width: 460px;
  margin: 9px 0 0;
  color: var(--text-secondary);
  font-size: 0.91rem;
  line-height: 1.65;
}

body#landing .landing-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

body#landing .landing-prompt-chip {
  min-height: 30px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  background: var(--bg-surface);
  box-shadow: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

body#landing .landing-prompt-chip:hover {
  border-color: var(--accent-blue);
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

body#landing .site-footer {
  margin-top: 0;
  padding: 28px 32px 20px;
  background: var(--bg-surface);
}

body#landing .site-footer .footer-container,
body#landing .site-footer .footer-bottom {
  max-width: 1120px;
}

body#landing .site-footer .footer-container {
  margin-bottom: 20px;
}

body#landing .site-footer .footer-bottom {
  padding-top: 16px;
}

@media (max-width: 700px) {
  body#landing .landing-header .header-container {
    padding: 14px 20px;
  }

  body#landing .landing-header .header-actions {
    gap: 10px;
  }

  body#landing .hero-section {
    padding: 92px 24px 88px;
  }

  body#landing .landing-title {
    font-size: clamp(2.8rem, 11vw, 4.7rem);
    letter-spacing: -0.065em;
  }

  body#landing .landing-subtitle {
    margin-top: 22px;
  }

  body#landing .landing-cta-group {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin-top: 28px;
  }

  body#landing .landing-primary-cta {
    width: 100%;
  }

  body#landing .landing-secondary-cta {
    justify-content: center;
  }

  body#landing .landing-capabilities {
    width: calc(100% - 48px);
    padding: 30px 0 64px;
  }

  body#landing .landing-capability-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body#landing .landing-capability {
    padding: 22px 0 25px;
  }

  body#landing .site-footer {
    padding: 24px 20px 18px;
  }
}

@media (max-width: 420px) {
  body#landing .landing-header .header-container {
    gap: 10px;
    padding: 12px 16px;
  }

  body#landing .landing-header .header-actions {
    gap: 8px;
  }

  body#landing .landing-header #landing-launch-btn {
    padding: 8px 11px;
    font-size: 0.8rem;
  }

  body#landing .hero-section {
    padding: 78px 20px 72px;
  }

  body#landing .landing-title {
    font-size: clamp(2.45rem, 11vw, 3.3rem);
  }

  body#landing .landing-capabilities {
    width: calc(100% - 40px);
  }
}

/* --------------------------------------------------------------------------
   INDEX APP WORKSPACE
   -------------------------------------------------------------------------- */
body#index .chat-topbar {
  padding: 14px clamp(18px, 3vw, 40px);
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

body#index .topbar-left {
  gap: 18px;
}

body#index .topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

body#index .nav-home-btn {
  border-radius: 8px;
  background: transparent;
}

body#index .topbar-right {
  gap: 12px;
}

body#index .chat-container {
  max-width: 1480px;
}

body#index .chat-sidebar {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

body#index .sidebar-header h3 {
  font-size: 0.7rem;
  letter-spacing: 0.13em;
}

body#index .chat-shell {
  background: var(--bg-dark);
}

body#index .log {
  padding: clamp(24px, 5vh, 56px) clamp(18px, 4vw, 48px) 24px;
}

body#index .empty-state {
  width: min(100%, 760px);
  max-width: 760px;
  padding: 28px 0 36px;
}

body#index .empty-state h2 {
  margin: 0 0 28px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.1;
}

body#index .empty-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  text-align: left;
}

body#index .empty-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: initial;
  min-width: 0;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-primary);
  text-align: left;
}

body#index .empty-chip:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

body#index .empty-chip-category {
  grid-column: 1;
  color: var(--text-muted);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

body#index .empty-chip-command {
  grid-column: 1;
  min-width: 0;
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body#index .empty-chip-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  padding-left: 8px;
  color: var(--accent-blue);
  font-size: 1rem;
}

body#index .composer {
  padding: 14px clamp(18px, 4vw, 48px) 8px;
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

body#index .composer-inner {
  max-width: 820px;
  min-height: 58px;
  padding: 7px 7px 7px 18px;
  border-radius: 12px;
  background: var(--bg-input);
}

body#index .composer-inner:focus-within {
  box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.12);
}

body#index .composer input {
  min-width: 0;
  font-size: 0.92rem;
}

body#index .send-btn {
  min-height: 44px;
  padding: 9px 15px;
  border-radius: 8px;
}

body#index .app-disclaimer {
  padding: 2px 18px 12px;
  background: var(--bg-surface);
  font-size: 0.67rem;
  line-height: 1.5;
}

body#index .page-loader,
body#landing .page-loader {
  background: var(--bg-dark);
  color: var(--text-primary);
  transition: opacity 240ms ease, visibility 240ms ease;
}

body#index .page-loader-grid,
body#landing .page-loader-grid {
  opacity: 0.18;
  background-color: transparent;
  background-image:
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
}

body#index .page-loader-content,
body#landing .page-loader-content {
  gap: 18px;
  min-width: 252px;
  padding: 28px 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.22);
}

body#index .page-loader-label,
body#landing .page-loader-label {
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

body#index .page-loader-bar,
body#landing .page-loader-bar {
  width: 188px;
  height: 4px;
  gap: 5px;
}

body#index .page-loader-bar span,
body#landing .page-loader-bar span {
  border: 0;
  border-radius: 4px;
  background: var(--border-subtle);
  animation: boot-dither 700ms ease-in-out infinite;
}

body#index .page-loader-bar span:nth-child(2),
body#landing .page-loader-bar span:nth-child(2) {
  animation-delay: 100ms;
}

body#index .page-loader-bar span:nth-child(3),
body#landing .page-loader-bar span:nth-child(3) {
  animation-delay: 200ms;
}

body#index .page-loader-bar span:nth-child(4),
body#landing .page-loader-bar span:nth-child(4) {
  animation-delay: 300ms;
}

body#index.light-theme .empty-chip,
body#index.light-theme .page-loader-content,
body#landing.light-theme .page-loader-content {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

@media (max-width: 600px) {
  body#index .chat-topbar {
    padding-right: 14px;
    padding-left: 14px;
  }

  body#index .topbar-left {
    gap: 10px;
  }

  body#index .empty-state {
    padding: 20px 0 28px;
  }

  body#index .empty-state h2 {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  body#index .empty-chips {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  body#index .empty-chip {
    min-height: 68px;
  }

  body#index .composer {
    padding: 10px 12px 6px;
  }

  body#index .composer-inner {
    min-height: 54px;
    padding-left: 13px;
  }

  body#index .app-disclaimer {
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  body#index .page-loader,
  body#landing .page-loader,
  body#index .page-loader-bar span,
  body#landing .page-loader-bar span {
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }
}