/* ===== THEME VARIABLES ===== */
:root {
  --bg-body: #030712;
  --bg-sidebar: linear-gradient(180deg, #1a0a2e 0%, #0f0a1e 100%);
  --bg-sidebar-solid: #130a26;
  --bg-auth: radial-gradient(ellipse at top, #1e0a3c 0%, #0f0a1e 50%, #0a0f1e 100%);
  --bg-landing: radial-gradient(ellipse 35% 100% at 0% 50%, #1e0b40 0%, transparent 100%),
    radial-gradient(ellipse 35% 100% at 100% 50%, #1e0b40 0%, transparent 100%), #060310;
  --bg-card: #0d0b1a;
  --bg-card-hover: #110e22;
  --bg-input: #0f0c1c;
  --bg-overlay: rgba(0, 0, 0, 0.15);
  --bg-popup: #0a0616;
  --bg-modal: #1a0a2e;
  --bg-hover-subtle: rgba(255, 255, 255, 0.06);
  --bg-composite: #0a0612;
  --bg-tabs: rgba(31, 41, 55, 0.5);

  --border-card: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-light: rgba(255, 255, 255, 0.06);
  --border-input: rgba(255, 255, 255, 0.1);
  --border-card-hover: rgba(147, 51, 234, 0.35);

  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-dim: #6b7280;
  --text-dimmer: #4b5563;
  --text-bright: #e5e7eb;
  --text-muted: #d1d5db;
  --text-heading: #f9fafb;

  --accent: #9333ea;
  --accent-hover: #7c3aed;
  --accent-light: #a855f7;
  --accent-lighter: #c084fc;
  --accent-bg: rgba(147, 51, 234, 0.2);
  --accent-bg-subtle: rgba(147, 51, 234, 0.1);
  --accent-bg-light: rgba(147, 51, 234, 0.15);
  --accent-border: rgba(147, 51, 234, 0.25);
  --accent-border-strong: rgba(147, 51, 234, 0.35);
  --accent-gradient: linear-gradient(135deg, #9333ea, #7c3aed);
  --accent-shadow: rgba(147, 51, 234, 0.35);
  --accent-glow: rgba(147, 51, 234, 0.4);
  --accent-text: #c084fc;
  --accent-text-hover: #e9d5ff;

  --landing-h1-gradient: linear-gradient(135deg, #a855f7, #7c3aed 40%, #6366f1);
  --landing-cta-shadow: rgba(147, 51, 234, 0.35);
  --landing-cta-shadow-hover: rgba(147, 51, 234, 0.55);

  --color-danger: #f87171;
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  --color-danger-border: rgba(239, 68, 68, 0.2);
  --color-success: #4ade80;

  --color-orange: #f97316;
  --color-orange-light: #fb923c;
  --color-orange-border: rgba(249,115,22,0.5);
  --color-orange-bg: rgba(249,115,22,0.1);
  --color-orange-hover-text: #fdba74;
  --color-danger-light: #fca5a5;
  --color-gold: #fbbf24;
  --color-gold-border: rgba(251, 191, 36, 0.35);
  --color-gold-shadow: rgba(245, 158, 11, 0.15);
  --color-gold-shadow-hover: rgba(245, 158, 11, 0.3);

  --scrollbar-thumb: rgba(255, 255, 255, 0.1);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.2);

  --color-scheme: dark;
  --logo-text-fill: white;
  --logo-rays-stroke: #f97316;
  --learn-more-color: #e5e7eb;
  --learn-more-hover: #ffffff;
  --badge-blue-bg: rgba(59, 130, 246, 0.2);
  --badge-blue-text: #93c5fd;
  --select-option-bg: #1a0a2e;
  --gate-design: #e67e22;
  --gate-personality: #ffffff;
  --transit-color: #38bdf8;
  --gradient-success: linear-gradient(135deg, #10b981, #059669);
  --radius-full: 999px;
  --color-coin: #daa520;
  --color-coin-glow: #ffcc00;
  --control-bg: rgba(17, 24, 39, 0.7);
  --control-border: rgba(139, 92, 246, 0.3);

  /* Modal (always light background) */
  --modal-bg: #ffffff;
  --modal-text: #1a1a2e;
  --modal-text-secondary: #333;
  --modal-text-dim: #555;
  --modal-text-muted: #666;
  --modal-text-faint: #999;
  --modal-input-bg: #fafafa;
  --modal-input-border: #ddd;
  --modal-border-divider: #e5e5e5;
  --modal-consent-bg: #f8f5ff;
  --modal-consent-border: #e9d5ff;
  --modal-consent-heading: #7c3aed;
  --modal-accent: #9333ea;
  --modal-shadow: rgba(0, 0, 0, 0.25);

  /* Mobile layout */
  --mobile-bottom-bar: 3.5rem;
  --mobile-header: 44px;
  --mobile-fab-offset: 12px;
  --mobile-bodygraph-top: 55px;
  --mobile-composite-offset: 175px;
}

[data-theme="light"] {
  --bg-body: #e8e4ef;
  --bg-sidebar: rgba(220, 215, 228, 0.75);
  --bg-sidebar-solid: rgba(215, 210, 224, 0.85);
  --bg-auth: radial-gradient(ellipse at top, rgba(230,225,240,0.9) 0%, rgba(225,220,235,0.8) 50%, rgba(220,215,230,0.85) 100%);
  --bg-landing: radial-gradient(ellipse 35% 100% at 0% 50%, rgba(160,40,50,0.06) 0%, transparent 100%),
    radial-gradient(ellipse 35% 100% at 100% 50%, rgba(160,40,50,0.06) 0%, transparent 100%), #e8e4ef;
  --bg-card: rgba(225, 220, 235, 0.6);
  --bg-card-hover: rgba(218, 213, 228, 0.7);
  --bg-input: rgba(255, 255, 255, 0.5);
  --bg-overlay: rgba(232, 228, 239, 0.6);
  --bg-popup: rgba(230, 226, 238, 0.9);
  --bg-modal: rgba(225, 220, 235, 0.9);
  --bg-hover-subtle: rgba(45, 55, 72, 0.06);
  --bg-composite: rgba(228, 224, 236, 0.7);
  --bg-tabs: rgba(45, 55, 72, 0.06);

  --border-card: rgba(255, 255, 255, 0.3);
  --border-subtle: rgba(255, 255, 255, 0.2);
  --border-light: rgba(255, 255, 255, 0.25);
  --border-input: rgba(45, 55, 72, 0.12);
  --border-card-hover: rgba(180, 50, 50, 0.3);

  --text-primary: #1a1a2e;
  --text-secondary: #3d3d5c;
  --text-dim: #5a5a7a;
  --text-dimmer: #8888a8;
  --text-bright: #2a2a44;
  --text-muted: #4a4a6a;
  --text-heading: #1a1a2e;

  --accent: #8b1520;
  --accent-hover: #6e1118;
  --accent-light: #a91c28;
  --accent-lighter: #c4232f;
  --accent-bg: rgba(145, 20, 30, 0.1);
  --accent-bg-subtle: rgba(145, 20, 30, 0.05);
  --accent-bg-light: rgba(145, 20, 30, 0.07);
  --accent-border: rgba(145, 20, 30, 0.2);
  --accent-border-strong: rgba(145, 20, 30, 0.3);
  --accent-gradient: linear-gradient(135deg, rgba(120,15,20,0.82), rgba(90,10,15,0.88));
  --accent-shadow: rgba(120, 15, 22, 0.25);
  --accent-glow: rgba(145, 20, 30, 0.25);
  --accent-text: #8b1520;
  --accent-text-hover: #5e0f16;

  --landing-h1-gradient: linear-gradient(135deg, #8b1520, #6e1118 40%, #5e0f16);
  --landing-cta-shadow: rgba(120, 15, 22, 0.25);
  --landing-cta-shadow-hover: rgba(120, 15, 22, 0.4);

  --color-danger: #dc2626;
  --color-danger-bg: rgba(220, 38, 38, 0.08);
  --color-danger-border: rgba(220, 38, 38, 0.2);
  --color-success: #16a34a;

  --color-orange: #b91c1c;
  --color-orange-light: #991b1b;
  --color-orange-border: rgba(185,28,28,0.5);
  --color-orange-bg: rgba(185,28,28,0.1);
  --color-orange-hover-text: #b91c1c;
  --color-danger-light: #f87171;
  --color-gold: #b45309;
  --color-gold-border: rgba(180, 83, 9, 0.35);
  --color-gold-shadow: rgba(180, 83, 9, 0.15);
  --color-gold-shadow-hover: rgba(180, 83, 9, 0.3);

  --scrollbar-thumb: rgba(45, 55, 72, 0.15);
  --scrollbar-thumb-hover: rgba(45, 55, 72, 0.25);

  --color-scheme: light;
  --logo-text-fill: #1a202c;
  --logo-rays-stroke: #be123c;
  --learn-more-color: #1e3a8a;
  --learn-more-hover: #1d4ed8;
  --badge-blue-bg: rgba(30, 58, 138, 0.15);
  --badge-blue-text: #1e3a8a;
  --select-option-bg: #ede8e1;
  --gate-design: #c0392b;
  --gate-personality: #1a1a2e;
  --transit-color: #0284c7;
  --control-bg: rgba(255, 255, 255, 0.75);
  --control-border: rgba(30, 64, 175, 0.5);
  --color-coin: #b45309;
  --color-coin-glow: #d97706;
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
}

/* ===== UTILITY CLASSES ===== */
.error-text { color: var(--color-danger); padding: 1rem; font-size: 0.85rem; }

/* ===== LANDING ===== */
.landing-screen {
  position: relative;
  min-height: var(--app-height, 100dvh);
  overflow-x: hidden;
  background: var(--bg-landing);
}
.neutrino-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.landing-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: var(--app-height, 100dvh);
}

/* Nav */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.landing-nav-logo {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}
.landing-logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid var(--color-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -2px;
  background: transparent;
  overflow: hidden;
}
.landing-nav-brand {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-start;
}
.landing-nav-brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.1;
}
.landing-nav-brand-sub {
  font-size: 0.65rem;
  color: var(--text-secondary);
  line-height: 1.2;
  margin-top: 1px;
}
.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.landing-btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: color 0.15s;
}
.landing-btn-ghost:hover { color: var(--text-primary); }
.landing-btn-outline {
  background: transparent;
  border: 1px solid var(--color-orange-border);
  color: var(--color-orange-light);
  font-size: 0.9rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.landing-btn-outline:hover {
  border-color: var(--color-orange);
  background: var(--color-orange-bg);
  color: var(--color-orange-hover-text);
}

/* Hero */
.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 1.5rem 1rem;
}
.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  color: var(--accent-text);
  margin-bottom: 2rem;
  letter-spacing: 0.01em;
}
.landing-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px 2px var(--accent-glow);
  flex-shrink: 0;
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}
@keyframes pulse-scale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
.landing-h1 {
  font-size: clamp(3rem, 6.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text-heading);
  margin-bottom: 1.25rem;
}
.landing-h1-accent {
  background: var(--landing-h1-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 480px;
  margin-bottom: 1.5rem;
}
.landing-cta-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 0.875rem;
  cursor: pointer;
  box-shadow: 0 0 28px var(--landing-cta-shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  margin-bottom: 1rem;
}
.landing-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px var(--landing-cta-shadow-hover);
}
.landing-cta-main {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}
.landing-cta-sub {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.7;
  letter-spacing: 0.02em;
  margin-left: -14px;
}
.landing-signin-hint {
  font-size: 0.875rem;
  color: var(--text-dim);
}
.landing-signin-link {
  background: none;
  border: none;
  color: var(--accent-light);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.landing-signin-link:hover { color: var(--accent-lighter); }

/* Features */
.landing-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 0 2.5rem 3rem;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}
.landing-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: border-color 0.2s, background 0.2s;
}
.landing-feature-card:hover {
  border-color: var(--accent-border-strong);
  background: var(--bg-card-hover);
}
.landing-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-bg-light);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
  margin-bottom: 0.875rem;
}
.landing-feature-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}
.landing-feature-text {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.55;
}

/* Auth back button */
.landing-back-btn {
  display: inline-block;
  margin-bottom: 1.25rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.landing-back-btn:hover { color: var(--accent-light); }

/* ===== BACKGROUNDS ===== */
.auth-bg {
  background: var(--bg-auth);
}
.sidebar-bg {
  background: var(--bg-sidebar);
  position: relative;
  z-index: 1;
}
[data-theme="light"] .sidebar-bg {
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0 20px 20px 0;
  margin: 8px 0 8px 0;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
}

/* ===== MAIN LAYOUT ===== */
#main-layout {
  min-height: var(--app-height, 100dvh);
}

/* ===== MAIN CONTENT ===== */
#main-content {
  position: relative;
  z-index: 1;
  min-height: var(--app-height, 100dvh);
  margin-left: 16rem;
}

/* ===== APP NEUTRINO CANVAS ===== */
.app-neutrino-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ===== SIDEBAR LOGO ===== */
.sidebar-logo-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1.5px solid var(--color-orange);
  display: flex;
  align-items: center;
  margin-top: -2px;
  justify-content: center;
  overflow: hidden;
}
.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-start;
}
.logo-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
  top: -2px;
}
.logo-beta {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-lighter);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: -2px;
  animation: beta-pulse 2s ease-in-out infinite;
}
@keyframes beta-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.sidebar-logo-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.sidebar-logo-sub {
  font-size: 0.65rem;
  color: var(--text-secondary);
  line-height: 1.2;
  margin-top: 1px;
}

/* ===== GLASS CARD ===== */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
}
[data-theme="light"] .glass-card {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* ===== AUTH TABS ===== */
.auth-tab {
  color: var(--text-secondary);
}
.auth-tab.active {
  background: var(--accent-bg);
  color: var(--accent-text);
}

/* ===== INPUTS ===== */
.field-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.input-field {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 0.75rem;
  padding: 0.625rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-field::placeholder { color: var(--text-dimmer); }
.input-field:focus {
  border-color: var(--accent-glow);
  box-shadow: 0 0 0 3px var(--accent-bg-light);
}
[data-theme="light"] .input-field {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-theme="light"] .input-field:focus {
  border-color: rgba(145, 20, 30, 0.3);
  box-shadow: 0 0 0 3px rgba(145, 20, 30, 0.06);
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Light theme: frosted glass buttons */
[data-theme="light"] .btn-primary {
  background: rgba(145, 20, 30, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(120, 15, 22, 0.25);
}
[data-theme="light"] .btn-primary:hover {
  background: rgba(120, 15, 22, 0.9);
  opacity: 1;
}
[data-theme="light"] .landing-cta-btn {
  background: rgba(145, 20, 30, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(120, 15, 22, 0.25);
}
[data-theme="light"] .landing-cta-btn:hover {
  background: rgba(120, 15, 22, 0.9);
  box-shadow: 0 4px 28px rgba(120, 15, 22, 0.35);
}

.btn-secondary {
  background: var(--bg-hover-subtle);
  border: 1px solid var(--border-input);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--bg-input); }

.btn-danger {
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  color: var(--color-danger);
  cursor: pointer;
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  transition: background 0.15s;
}
.btn-danger:hover { background: var(--color-danger-border); }

/* ===== SIDEBAR NAV ===== */
.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}
@media (hover: hover) {
  .nav-btn:hover {
    background: var(--accent-bg-subtle);
    color: var(--accent-text-hover);
  }
  .sidebar-new-conv-btn:hover {
    opacity: 1;
    background: rgba(139,92,246,0.1);
  }
}
.sidebar-new-conv-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 0.375rem;
  opacity: 0.6;
  transition: opacity .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn.active {
  background: var(--accent-bg);
  color: var(--accent-text);
}
.nav-btn:disabled, .nav-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.logout-btn:hover { color: var(--color-danger); background: var(--color-danger-bg); }

/* ===== БАЛАНС МОНЕТ ===== */
.balance-badge {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem 0.35rem 0.45rem;
  border-radius: 2rem;
  background: var(--bg-popup);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-coin);
  color: var(--color-coin-glow);
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 2px 14px rgba(255, 204, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.balance-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 24px rgba(255, 204, 0, 0.4);
}
.balance-badge.balance-low {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger-light);
}

/* ===== ГОСТЕВОЙ БАННЕР ===== */
.guest-banner {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.625rem;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.25);
  animation: guest-banner-pulse 2.5s ease-in-out infinite;
}
@keyframes guest-banner-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0); }
  50% { box-shadow: 0 0 12px 2px rgba(234, 179, 8, 0.15); }
}
.guest-banner-text {
  font-size: 0.75rem;
  color: #eab308;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
.guest-banner-btn {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 0.4rem;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #eab308;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.guest-banner-btn:hover { background: rgba(234, 179, 8, 0.25); }
[data-theme="light"] .guest-banner {
  background: rgba(30, 58, 138, 0.08);
  border-color: rgba(30, 58, 138, 0.2);
  animation: guest-banner-pulse-light 2.5s ease-in-out infinite;
}
@keyframes guest-banner-pulse-light {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 58, 138, 0); }
  50% { box-shadow: 0 0 12px 2px rgba(30, 58, 138, 0.12); }
}
[data-theme="light"] .guest-banner-text { color: #1e3a8a; }
[data-theme="light"] .guest-banner-btn {
  background: rgba(30, 58, 138, 0.15);
  border-color: rgba(30, 58, 138, 0.3);
  color: #1e3a8a;
}
[data-theme="light"] .guest-banner-btn:hover { background: rgba(30, 58, 138, 0.25); }

/* ===== МОДАЛ: МОНЕТЫ ЗАКОНЧИЛИСЬ ===== */
.ooc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.privacy-text p,
.privacy-text li {
  text-align: justify;
}
.ooc-modal {
  position: relative;
  background: var(--bg-modal);
  border: 1px solid var(--accent-border-strong);
  border-radius: 1.25rem;
  padding: 2rem 1.75rem 1.75rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 40px var(--accent-shadow);
}
.ooc-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}
.ooc-close:hover { color: var(--text-primary); }
.ooc-icon { font-size: 2.5rem; margin-bottom: 0.75rem; text-align: center; display: flex; justify-content: center; }
.ooc-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.625rem;
}
.ooc-body {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}
.ooc-register-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.625rem;
  transition: opacity 0.15s;
}
.ooc-register-btn:hover { opacity: 0.9; }
.ooc-dismiss {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem;
}
.ooc-dismiss:hover { color: var(--text-secondary); }

/* Лендинг: подпись под CTA */
.landing-guest-hint {
  font-size: 0.78rem;
  color: var(--text-dimmer);
  margin-top: 0.25rem;
}
.landing-data-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* Кнопка «Узнать больше» */
.landing-learn-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 50px;
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid var(--learn-more-color);
  border-radius: 2rem;
  color: var(--learn-more-color);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.landing-learn-more:hover {
  color: var(--learn-more-hover);
  border-color: var(--learn-more-hover);
}
.landing-learn-more svg {
  animation: bounce-down 2s infinite;
}
@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* ===== DEMO CHAT (hero лендинга) ===== */
.landing-hero--with-demo {
  gap: 0;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
  justify-content: space-between;
}
.landing-hero-top {
  margin-bottom: 0;
}
.landing-hero--with-demo .landing-h1 {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  margin-bottom: 0.3rem;
}
.landing-hero--with-demo .landing-lead {
  font-size: 0.85rem;
  margin-bottom: 0;
  line-height: 1.4;
}
.landing-hero-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0;
}
.landing-hero-bottom .landing-cta-btn {
  padding: 0.7rem 1.75rem;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.landing-hero-bottom .landing-guest-hint {
  margin-top: 0;
}
.landing-hero-bottom .landing-learn-more {
  margin-top: 0.25rem;
}
.demo-chat-wrap {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  width: 100%;
  max-width: 540px;
  height: 180px;
  margin: 0 auto;
}
.demo-bodygraph {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.demo-bg-svg {
  width: 100%;
  height: auto;
}
.demo-center {
  transition: fill 0.3s, stroke 0.3s;
}
.demo-center.active {
  fill: rgba(147, 51, 234, 0.25);
  stroke: rgba(168, 85, 247, 0.9);
}
.demo-bg-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
  min-height: 1.1em;
  text-align: center;
  transition: opacity 0.3s;
}
.demo-chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem;
  overflow: hidden;
}
.demo-chat-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.demo-chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.demo-chat-dot--green {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34,197,94,0.5);
}
.demo-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  scrollbar-width: none;
}
.demo-chat-body::-webkit-scrollbar { display: none; }
.demo-msg {
  max-width: 92%;
  padding: 0.4rem 0.6rem;
  border-radius: 0.6rem;
  font-size: 0.72rem;
  line-height: 1.45;
  animation: demo-msg-in 0.3s ease-out;
}
@keyframes demo-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.demo-msg--user {
  align-self: flex-end;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent-light);
}
.demo-msg--ai {
  align-self: flex-start;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-secondary);
}
.demo-typing {
  display: inline-flex;
  gap: 3px;
  padding: 0.5rem 0.7rem;
  align-self: flex-start;
}
.demo-typing span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: demo-dot-pulse 1.2s infinite;
}
.demo-typing span:nth-child(2) { animation-delay: 0.15s; }
.demo-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes demo-dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Секция «О Дизайне Человека» — отдельная зона ниже hero */
.landing-about {
  position: relative;
  z-index: 1;
  padding: 3.5rem 2rem 4rem;
  min-height: var(--app-height, 100dvh);
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  background: var(--bg-body);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.landing-about-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}
.landing-about-lead {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.landing-about-lead strong {
  color: var(--text-primary);
}
.landing-neutrino {
  max-width: 620px;
  margin: 0 auto 0.75rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.08), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(147, 51, 234, 0.15);
  border-radius: 1rem;
  text-align: center;
}
.landing-neutrino-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, #9333ea, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.landing-neutrino-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.landing-neutrino p {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
  text-align: justify;
}
.landing-neutrino p:last-child {
  margin-bottom: 0;
}
.landing-about .landing-features {
  grid-template-columns: repeat(2, 1fr);
  max-width: 100%;
  padding: 0;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.landing-about .landing-feature-card {
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
}
.landing-about .landing-feature-card:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-2px);
}
.landing-about .landing-feature-icon {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}
.landing-about .landing-feature-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.25rem;
}
.landing-about .landing-feature-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Шаги и Теги — горизонтальный layout */
.landing-about-columns {
  display: flex;
  gap: 2rem;
  margin-top: 1.25rem;
  text-align: left;
}
.landing-about-col {
  flex: 1;
  min-width: 0;
}
.landing-about-col .landing-about-title {
  text-align: left;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}
.landing-about-block {
  margin-top: 0;
}
.landing-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}
.landing-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.landing-step-num {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.8rem;
}
.landing-step h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.15rem;
}
.landing-step p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Теги */
.landing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-start;
  margin-bottom: 0;
}
.landing-tag {
  padding: 0.3rem 0.7rem;
  border-radius: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  font-size: 0.78rem;
  transition: border-color 0.15s, color 0.15s;
}
.landing-tag:hover {
  border-color: var(--accent-border);
  color: var(--accent-text);
}

/* Тарифы */
.landing-pricing {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}
.landing-pricing .landing-about-lead { margin-bottom: 1rem;
}
.landing-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}
.landing-price-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  padding: 1.25rem 0.75rem;
  text-align: center;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}
.landing-price-card:hover {
  border-color: rgba(139,92,246,0.5);
  transform: translateY(-2px);
}
.landing-price-card-popular {
  border-color: rgba(139,92,246,0.6);
  background: rgba(139,92,246,0.1);
}
.landing-price-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #9333ea, #7c3aed);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.landing-price-coins {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-heading, #fff);
  line-height: 1;
}
.landing-price-label {
  font-size: 0.75rem;
  color: var(--text-muted, rgba(255,255,255,0.5));
  margin-bottom: 0.5rem;
}
.landing-price-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-lighter);
}
.landing-price-per {
  font-size: 0.7rem;
  color: var(--text-dim, rgba(255,255,255,0.4));
  margin-top: 0.15rem;
}
.landing-pricing-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim, rgba(255,255,255,0.5));
  margin-top: 0.75rem;
}

/* Нижний CTA */
.landing-cta-bottom {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}
.landing-cta-bottom .landing-about-title { margin-bottom: 0.3rem; }
.landing-cta-bottom .landing-about-lead { margin-bottom: 0.75rem;
}

/* ===== CARDS ===== */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  cursor: pointer;
}
.chart-card:hover {
  border-color: var(--border-card-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

/* ===== BADGE ===== */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-purple { background: var(--accent-bg); color: var(--accent-text); }
.badge-blue   { background: var(--badge-blue-bg); color: var(--badge-blue-text); }
.badge-gray   { background: rgba(107, 114, 128, 0.2); color: var(--text-secondary); }

/* ===== INFO GRID ===== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.info-row {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
}
.info-row-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.info-row-value {
  font-size: 0.95rem;
  color: var(--text-bright);
  font-weight: 500;
}

/* ===== CHAT ===== */
.chat-bubble {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.chat-bubble-user {
  background: var(--accent-gradient);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
  margin-left: auto;
}
.chat-bubble-ai {
  background: var(--bg-hover-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  border-bottom-left-radius: 0.25rem;
}

.ai-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-card);
}

.ai-followup-btn {
  background: var(--accent-bg-light);
  border: 1px solid var(--accent-border-strong);
  color: var(--accent-text);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-followup-btn:hover {
  background: var(--accent-bg);
  border-color: var(--accent-glow);
  color: var(--accent-text-hover);
}

.ai-pro-btn {
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(139,92,246,0.2));
  border-color: rgba(168,85,247,0.5);
  color: #c4b5fd;
}
.ai-pro-btn:hover {
  background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(139,92,246,0.35));
  border-color: rgba(168,85,247,0.7);
  color: #e9d5ff;
}

/* Показываем follow-up только в последнем AI-сообщении */
#chat-messages .ai-followups { display: none; }
#chat-messages > :last-child .ai-followups { display: flex; }

/* ===== FEATURE HINT BUTTONS (транзит, совместимость) ===== */
.ai-feature-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ai-feature-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  background: var(--bg-hover-subtle);
  color: var(--text-secondary);
}

.ai-feature-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.ai-feat-transit {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}

.ai-feat-transit:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.4);
  color: #bae6fd;
}

.ai-feat-composite {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.ai-feat-composite:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

.ai-feature-btn.ai-feature-active {
  opacity: 0.7;
}

/* Показываем feature hints только в последнем AI-сообщении */
#chat-messages .ai-feature-hints { display: none; }
#chat-messages > :last-child .ai-feature-hints { display: flex; }

/* ===== OAUTH BUTTONS ===== */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-input);
  background: var(--bg-hover-subtle);
  color: var(--text-bright);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.oauth-btn:hover {
  background: var(--bg-input);
  border-color: var(--border-card-hover);
}

.oauth-btn--yandex:hover {
  border-color: rgba(252, 63, 29, 0.35);
  background: rgba(252, 63, 29, 0.06);
}

.oauth-btn--vk:hover {
  border-color: rgba(0, 119, 255, 0.35);
  background: rgba(0, 119, 255, 0.06);
}

/* ===== DIVIDER ===== */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 1.5rem 0;
}

/* ===== SPINNER ===== */
.spinner {
  width: 2rem; height: 2rem;
  border: 3px solid var(--accent-bg);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-dim);
}
.empty-state svg { margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 0.95rem; }

/* ===== UNIFIED CHART+CHAT LAYOUT ===== */
.chart-page {
  display: grid;
  grid-template-columns: 55% 1fr;
  position: relative;
  z-index: 1;
  height: var(--app-height, 100dvh);
  overflow: hidden;
}

.chart-left {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
  background: var(--bg-overlay);
}

.chart-header {
  padding: 1rem 1.25rem 0.875rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.chart-props {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.75rem;
  padding: 0;
}
.chart-prop {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.chart-prop-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.chart-prop-value {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.2;
}
.chart-prop-good { color: var(--color-success); }
.chart-prop-bad { color: var(--color-danger); }

.clickable-prop {
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  border-radius: 4px;
}
.clickable-prop:hover {
  background: var(--bg-hover-subtle);
}
.chart-prop.clickable-prop { padding: 2px 4px; margin: -2px -4px; }
.badge.clickable-prop:hover { opacity: 0.8; }

.bodygraph-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem 0.25rem;
  min-height: 0;
  position: relative;
  z-index: 1;
}

#bodygraph-container {
  width: 100%;
  flex: 1;
  min-height: 0;
}

.bodygraph-hint {
  font-size: 0.7rem;
  color: var(--text-dimmer);
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.bodygraph-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 1rem 1rem;
  border-top: 1px solid var(--border-subtle);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}
.legend-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-block;
}

/* Chat side */
.chart-chat {
  display: flex;
  flex-direction: column;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  background: var(--bg-body);
  position: relative;
  z-index: 1;
}
.chat-header-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--bg-overlay);
}
.chat-header-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 0.375rem;
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s;
  color: var(--text-dim);
  display: flex;
  align-items: center;
}
.chat-header-icon-btn:hover {
  opacity: 1;
  background: rgba(139,92,246,0.1);
}
.sidebar-chat-item {
  border-radius: 0.375rem;
  position: relative;
  overflow: hidden;
}
.sidebar-chat-item.active {
  background: rgba(139, 92, 246, 0.15);
}
[data-theme="light"] .sidebar-chat-item.active {
  background: rgba(185, 28, 28, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sidebar-chat-item .nav-btn:hover,
.sidebar-chat-item.active .nav-btn,
.sidebar-chat-item.active .nav-btn:hover {
  background: transparent;
  color: var(--text-primary);
}
.sidebar-chat-item.active .sidebar-chat-icon {
  color: var(--accent-lighter);
}
.sidebar-chat-item:hover .sidebar-chat-del { opacity: 0.6; }
.sidebar-chat-item .sidebar-chat-del:hover { opacity: 1; color: var(--color-danger); }

.sidebar-chats-scroll {
  max-height: 200px;
  overflow-y: auto;
}

/* Свайп-удаление на мобиле */
.sidebar-chat-inner {
  display: flex;
  align-items: center;
  width: 100%;
}
.sidebar-chat-delete-bg {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 0;
  overflow: hidden;
  display: none;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.sidebar-chat-delete-bg.animating {
  transition: width 0.25s ease-out;
}
.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
}
.chat-input-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--bg-overlay);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* ===== TRANSIT CONTROLS ===== */
.transit-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border-subtle);
}

.transit-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.transit-toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
}
.transit-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.transit-slider {
  position: absolute;
  inset: 0;
  background: var(--border-input);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.transit-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.transit-toggle-switch input:checked + .transit-slider {
  background: rgba(56,189,248,0.3);
}
.transit-toggle-switch input:checked + .transit-slider::before {
  transform: translateX(16px);
  background: var(--transit-color);
}

.transit-date-input {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  outline: none;
  color-scheme: var(--color-scheme);
  max-width: 180px;
}
.transit-date-input:focus {
  border-color: rgba(56,189,248,0.5);
  box-shadow: 0 0 0 2px rgba(56,189,248,0.15);
}
.transit-date-input::-webkit-calendar-picker-indicator {
  display: none;
}

.transit-info {
  font-size: 0.7rem;
  color: var(--transit-color);
  white-space: nowrap;
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== FORECAST PANEL ===== */
.forecast-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.forecast-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--bg-overlay);
}
.forecast-back-btn {
  background: var(--bg-hover-subtle);
  border: 1px solid var(--border-input);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 0.625rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.forecast-back-btn:hover { background: var(--bg-input); color: var(--text-bright); }
.forecast-title-group { display: flex; flex-direction: column; gap: 1px; }
.forecast-title-text  { font-size: 0.85rem; font-weight: 600; color: var(--text-bright); }
.forecast-period-text { font-size: 0.7rem; color: var(--text-dim); }

.forecast-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.forecast-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Base day ── */
.forecast-day {
  border-radius: 10px;
  transition: background 0.15s;
}

/* ── Quiet day (no events) ── */
.forecast-day-quiet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  border-radius: 8px;
}
.forecast-day-quiet:hover { background: var(--bg-card); }
.forecast-quiet-date  { font-size: 0.75rem; color: var(--text-dimmer); }
.forecast-quiet-stats { font-size: 0.68rem; color: var(--text-dimmer); }

/* ── Day with events ── */
.forecast-day-has-events {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 0.75rem;
  margin: 2px 0;
}
.forecast-day-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.forecast-day-date  { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.forecast-day-stats { font-size: 0.68rem; color: var(--text-dim); margin-bottom: 0.5rem; }
.forecast-day-badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--accent-bg);
  color: var(--accent-text);
}

/* ── Today ── */
.forecast-day-today {
  background: var(--bg-card);
  border: 1px solid var(--accent-border-strong);
  border-radius: 12px;
  padding: 0.875rem;
  margin: 4px 0;
  box-shadow: 0 0 16px var(--accent-bg-light);
}
.forecast-day-today .forecast-today-label {
  background: var(--accent-bg);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
}
.forecast-today-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

/* ── Event card ── */
.forecast-event {
  background: var(--bg-overlay);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem;
}
.forecast-event-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.forecast-event-planet { font-size: 0.78rem; font-weight: 600; color: var(--text-bright); }
.forecast-event-gate   { font-size: 0.78rem; color: var(--accent-text); font-weight: 600; }
.forecast-event-time   { font-size: 0.65rem; color: var(--text-dimmer); margin-left: auto; }

.forecast-event-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 0.5rem;
}
.forecast-tag {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.forecast-tag-add  { background: rgba(74,222,128,0.12); color: #4ade80; border: 1px solid rgba(74,222,128,0.2); }
.forecast-tag-lose { background: rgba(248,113,113,0.12); color: var(--color-danger); border: 1px solid rgba(248,113,113,0.2); }

.forecast-event-actions {
  display: flex;
  gap: 0.4rem;
}
.forecast-btn-ai {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.forecast-btn-ai:hover { opacity: 0.85; }

.forecast-btn-graph {
  background: var(--bg-hover-subtle);
  border: 1px solid var(--border-input);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.forecast-btn-graph:hover { background: var(--bg-input); color: var(--text-bright); }

/* Standalone graph button (in today / day footer) */
.forecast-day-today > .forecast-btn-graph,
.forecast-day-has-events > .forecast-btn-graph {
  margin-top: 0.4rem;
  display: block;
  width: fit-content;
}

.forecast-open-btn {
  background: var(--accent-bg-light);
  border: 1px solid var(--accent-border-strong);
  color: var(--accent-text);
  cursor: pointer;
  border-radius: 0.5rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  transition: background 0.15s;
  white-space: nowrap;
}
.forecast-open-btn:hover { background: var(--accent-bg); }

/* ===== ELEMENT POPUP ===== */
.element-popup {
  position: fixed;
  z-index: 1000;
  width: 276px;
  background: var(--bg-popup);
  border: 1px solid var(--accent-border-strong);
  border-radius: 14px;
  padding: 14px 16px 16px;
  backdrop-filter: blur(24px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border-card);
  animation: ep-appear 0.14s ease;
  pointer-events: all;
}
@keyframes ep-appear {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ep-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.ep-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ep-type-tag {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-hover);
  text-transform: uppercase;
}
.ep-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.25;
  word-break: break-word;
}
.ep-close {
  background: none;
  border: none;
  color: var(--text-dimmer);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.ep-close:hover { color: var(--text-muted); background: var(--bg-hover-subtle); }

.ep-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.ep-status-defined     { background: var(--accent-bg-light); color: var(--accent-text); border: 1px solid var(--accent-border); }
.ep-status-open        { background: rgba(107,114,128,0.12); color: var(--text-secondary); border: 1px solid rgba(107,114,128,0.2); }
.ep-status-personality { background: rgba(226,232,240,0.08); color: var(--text-bright); border: 1px solid rgba(226,232,240,0.2); }
.ep-status-design      { background: var(--color-orange-bg);  color: var(--color-orange); border: 1px solid var(--color-orange-border); }
.ep-status-both        { background: rgba(255,255,255,0.06); color: #d1d5db; border: 1px solid rgba(255,255,255,0.15); }
.ep-status-transit     { background: rgba(56,189,248,0.1);  color: var(--transit-color); border: 1px solid rgba(56,189,248,0.25); }

.ep-theme {
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}
.ep-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.ep-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
  padding: 8px 0 0;
  border-top: 1px solid var(--border-light);
}
.ep-meta-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.72rem;
}
.ep-meta-label { color: var(--text-dim); flex-shrink: 0; }
.ep-meta-value { color: var(--text-muted); }

.ep-section-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 8px 0 5px;
}
.ep-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}
.ep-ch-tag,
.comp-ch-tag {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 500;
  white-space: nowrap;
}
.ep-ch-def  { background: var(--accent-bg); color: var(--accent-text); }
.ep-ch-open { background: var(--bg-card); color: var(--text-dim); }

.ep-ask-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 4px;
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.ep-ask-btn:hover  { opacity: 0.88; }
.ep-ask-btn:active { transform: scale(0.97); }

/* Electromagnetic status tag */
.ep-status-em { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }

/* ===== COMPOSITE PANEL ===== */

.composite-open-btn {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--color-success);
  cursor: pointer;
  border-radius: 0.5rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  transition: background 0.15s;
  white-space: nowrap;
}
.composite-open-btn:hover { background: rgba(16,185,129,0.22); }

.composite-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-composite);
  overflow: hidden;
}

.composite-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  flex-shrink: 0;
}

.composite-back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.composite-back-btn:hover { background: var(--bg-hover-subtle); color: var(--text-bright); }

.composite-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composite-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.composite-selector-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.composite-select {
  flex: 1;
  min-width: 150px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 0.5rem;
  color: var(--text-bright);
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  outline: none;
}
.composite-select option { background: var(--select-option-bg); }

.composite-calc-btn {
  background: var(--gradient-success);
  border: none;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.composite-calc-btn:hover { opacity: 0.85; }

.composite-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-dim);
  font-size: 0.85rem;
  gap: 0.5rem;
}

.composite-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.7;
}

.composite-stats {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.comp-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.25rem;
  border-right: 1px solid var(--border-subtle);
  gap: 1px;
}
.comp-stat:last-child { border-right: none; }

.comp-stat-count {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

.comp-stat-label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.3;
}

.comp-stat-hint {
  font-size: 0.55rem;
  color: var(--text-dim);
  text-align: center;
}

.comp-em-section {
  padding: 0.5rem 0.75rem 0.25rem;
  flex-shrink: 0;
}

.comp-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.comp-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.comp-ch-em {
  background: rgba(16,185,129,0.12);
  color: var(--color-success);
  border: 1px solid rgba(16,185,129,0.2);
}

.composite-ask-ai-btn {
  margin: 0.5rem 0.75rem;
  background: var(--gradient-success);
  border: none;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: opacity 0.15s;
  width: calc(100% - 1.5rem);
}
.composite-ask-ai-btn:hover { opacity: 0.85; }

.composite-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.25rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.composite-bodygraph-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ===== АДМИНКА ===== */
.nav-btn-admin {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  color: var(--color-danger);
}
.nav-btn-admin:hover { color: var(--color-danger-light); }
.nav-btn-admin.active { color: var(--color-danger-light); background: var(--color-danger-bg); }

.admin-tab {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.admin-tab:hover { color: var(--text-bright); }
.admin-tab.active {
  color: var(--text-bright);
  background: var(--accent-bg-light);
  border-color: var(--accent-border-strong);
}

.admin-table { border-collapse: collapse; }
.admin-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-card);
}
.admin-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}
.admin-table tbody tr:hover { background: var(--bg-card); }

.admin-action-btn {
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent-lighter);
  background: var(--accent-bg-subtle);
  border: 1px solid var(--accent-bg);
  cursor: pointer;
  transition: all 0.15s;
}
.admin-action-btn:hover { background: var(--accent-bg); }
.admin-action-danger { color: var(--color-danger); background: var(--color-danger-bg); border-color: var(--color-danger-border); }
.admin-action-danger:hover { background: rgba(239, 68, 68, 0.15); }
.admin-ai-response { white-space: pre-line; line-height: 1.4; }

/* ===== МОДАЛ ПОКУПКИ МОНЕТ ===== */
.coins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.coin-pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.2);
  cursor: pointer;
  transition: all 0.15s;
}
.coin-pack:hover {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.4);
  transform: translateY(-2px);
}
.coin-pack-amount { font-size: 1.5rem; font-weight: 800; color: #fbbf24; }
.coin-pack-label { font-size: 0.7rem; color: #9ca3af; margin-bottom: 0.5rem; }
.coin-pack-price { font-size: 0.9rem; font-weight: 600; color: #e5e7eb; }
.coin-pack-per { font-size: 0.65rem; color: #9ca3af; margin-top: 0.15rem; }

.coins-balance-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.coins-balance-label { font-size: 0.85rem; color: #9ca3af; }
.coins-balance-value { font-size: 1.25rem; font-weight: 800; color: #fbbf24; }

.coins-guest-block {
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--accent-bg-subtle);
  border: 1px solid var(--accent-bg);
  margin-bottom: 1rem;
  text-align: center;
}
.coins-guest-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.coin-pack-savings {
  position: absolute;
  top: -0.4rem;
  right: -0.3rem;
  padding: 0.1rem 0.4rem;
  border-radius: 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: #16a34a;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover { color: var(--text-bright); background: var(--bg-hover-subtle); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ===== TAILWIND OVERRIDES FOR LIGHT THEME ===== */
[data-theme="light"] body,
[data-theme="light"] .bg-gray-950 { background-color: var(--bg-body) !important; }
[data-theme="light"] .text-white { color: var(--text-primary) !important; }
[data-theme="light"] .border-white\/5 { border-color: var(--border-subtle) !important; }
[data-theme="light"] .bg-gray-800\/50 { background-color: var(--bg-tabs) !important; }
[data-theme="light"] .bg-purple-600\/20 { background-color: var(--accent-bg) !important; }
[data-theme="light"] .border-purple-500\/30 { border-color: var(--accent-border) !important; }
[data-theme="light"] .text-purple-400 { color: var(--accent-text) !important; }
[data-theme="light"] .text-gray-500 { color: var(--text-dim) !important; }
[data-theme="light"] .bg-red-500\/10 { background-color: var(--color-danger-bg) !important; }
[data-theme="light"] .border-red-500\/30 { border-color: var(--color-danger-border) !important; }
[data-theme="light"] .text-red-400 { color: var(--color-danger) !important; }
[data-theme="light"] .text-sm { color: var(--text-primary); }
[data-theme="light"] .balance-badge { color: #92400e; text-shadow: none; }
[data-theme="light"] .text-xs.text-gray-500 { color: var(--text-dim) !important; }
/* Logo SVG text color adapts to theme */
.sidebar-logo-icon svg text,
.landing-logo-icon svg text { fill: var(--logo-text-fill) !important; }
.logo-rays { stroke: var(--logo-rays-stroke); }

/* ===== CITY AUTOCOMPLETE ===== */
.city-autocomplete {
  position: relative;
}
.city-arrow {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.city-arrow:hover { color: var(--text-bright); }
.city-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-popup);
  border: 1px solid var(--border-input);
  border-radius: 0.5rem;
  z-index: 50;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.city-dropdown-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-bright);
  cursor: pointer;
  transition: background 0.1s;
}
.city-dropdown-item:hover {
  background: var(--bg-hover-subtle);
}
.city-dropdown-item:first-child { border-radius: 0.5rem 0.5rem 0 0; }
.city-dropdown-item:last-child { border-radius: 0 0 0.5rem 0.5rem; }

/* ===== MOBILE NAVIGATION ===== */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 39;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-popup);
  border-top: 1px solid var(--border-card);
  backdrop-filter: blur(20px);
  padding: 0.15rem 0;
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
}
.mobile-bottom-bar-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.mobile-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 0.15rem 0.75rem;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 0.6rem;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  min-width: 56px;
}
.mobile-tab-btn svg { width: 18px; height: 18px; }
.mobile-tab-btn.active { color: var(--accent-light); }
.mobile-tab-btn:hover { background: var(--bg-hover-subtle); }

/* ===== MOBILE CHAT BOTTOM SHEET ===== */
.chat-fab {
  display: none;
  position: fixed;
  bottom: 5rem;
  right: 1rem;
  z-index: 45;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-shadow);
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.chat-fab:active { transform: scale(0.93); }
.chat-fab svg { width: 24px; height: 24px; }
.chat-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--bg-body);
  display: none;
}

.chat-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 55;
  backdrop-filter: blur(2px);
}
.chat-sheet-overlay.active { display: block; }

.chat-bottom-sheet {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 56;
  background: var(--bg-body);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-top: 1px solid var(--border-card);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
  max-height: 85vh;
  height: 85vh;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.chat-bottom-sheet.open {
  display: flex;
  transform: translateY(0);
}
.chat-bottom-sheet .chat-sheet-handle {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--text-dimmer);
  margin: 0 auto 0;
  padding: 0;
  flex-shrink: 0;
  /* Увеличенная зона тача */
  box-sizing: content-box;
  padding-top: 12px;
  padding-bottom: 8px;
  cursor: grab;
}
.chat-bottom-sheet .chat-header-bar {
  border-bottom: 1px solid var(--border-light);
  padding: 0.5rem 1rem;
  flex-shrink: 0;
  background: var(--bg-overlay);
}
.chat-bottom-sheet .chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
}
.chat-bottom-sheet .chat-input-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  padding-bottom: max(0.625rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--bg-overlay);
}

/* ===== MOBILE ELEMENT POPUP → BOTTOM SHEET ===== */
.element-popup-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 999;
}
.element-popup-sheet-overlay.active { display: block; }

.element-popup-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-popup);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-top: 1px solid var(--accent-border-strong);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
  padding: 0 16px 16px;
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  backdrop-filter: blur(24px);
}
.element-popup-sheet.open { transform: translateY(0); }
.element-popup-sheet .ep-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--text-dimmer);
  margin: 8px auto 12px;
}
.element-popup-sheet .ep-ask-btn {
  padding: 12px 16px;
  font-size: 0.9rem;
  min-height: 44px;
}

/* ===== TOUCH-EXPLORE PREVIEW BUBBLE ===== */
.touch-preview {
  position: fixed;
  z-index: 900;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 56px;
  padding: 6px 10px;
  border-radius: 14px;
  background: var(--bg-popup);
  border: 2px solid var(--accent);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 20px var(--accent-glow);
  transform: translate(-50%, -100%);
  animation: touch-preview-in 0.12s ease;
}
@keyframes touch-preview-in {
  from { opacity: 0; transform: translate(-50%, -90%) scale(0.7); }
  to   { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}
.touch-preview-icon {
  font-size: 1.6rem;
  line-height: 1;
  font-weight: 700;
}
.touch-preview-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-top: 2px;
}
.touch-preview-gate {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
}
[data-theme="light"] .touch-preview-gate {
  color: #111;
  border-color: rgba(0,0,0,0.2);
}
.touch-preview-center {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
  text-align: center;
  line-height: 1.2;
}
.touch-preview-planet {
  display: flex;
  align-items: center;
  gap: 6px;
}
.touch-preview-planet-sym {
  font-size: 1.5rem;
  line-height: 1;
}
.touch-preview-planet-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  font-family: monospace;
}
.touch-preview-channel {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  font-family: monospace;
}

/* ===== MOBILE-ONLY ELEMENTS (hidden on desktop) ===== */
.mobile-info-overlay { display: none; }
.mobile-chart-title { display: none; }
.composite-controls {
  display: inline-flex;
  align-items: center;
  padding: 0 1rem 0.5rem;
}

/* ===== MOBILE PLANET OVERLAYS ===== */
.mobile-planets {
  position: absolute;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 1px;
  pointer-events: auto;
  max-height: 45vh;
  overflow-y: auto;
}
/* Две таблицы параллельно слева, над селезёнкой */
.mobile-planets.mp-left { left: 16px; top: calc(6% + 10px); }
.mobile-planets.mp-right { left: 66px; top: calc(6% + 10px); }
.mp-title {
  font-size: 0.5rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 1px;
}
.mp-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 3px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mp-row:active {
  background: rgba(139,92,246,0.2);
}
.mp-sym {
  font-size: 0.65rem;
  line-height: 1;
  width: 14px;
  text-align: center;
}
.mp-val {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-heading);
  font-family: monospace;
  line-height: 1;
}

/* ===== MODAL SHARED STYLES ===== */
.modal-container {
  position: relative;
  background: var(--modal-bg);
  color: var(--modal-text);
  border-radius: 1.25rem;
  padding: 2rem 1.75rem 1.75rem;
  width: 92vw;
  margin: auto;
  box-shadow: 0 8px 32px var(--modal-shadow);
}
.modal-container--sm { max-width: 480px; }
.modal-container--md { max-width: 580px; }
.modal-container--lg {
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--modal-text-muted);
}
.modal-icon {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.modal-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--modal-text);
}
.modal-title--tight { margin-bottom: 0.75rem; }
.modal-field { margin-bottom: 0.75rem; }
.modal-field--lg { margin-bottom: 1rem; }
.modal-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--modal-text-dim);
}
.modal-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--modal-input-border);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  background: var(--modal-input-bg);
  color: var(--modal-text-secondary);
  box-sizing: border-box;
}
textarea.modal-input { resize: vertical; }
.modal-submit {
  width: 100%;
  padding: 0.75rem;
  background: var(--modal-accent);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.modal-submit--mt { margin-top: 1rem; }
.modal-submit:disabled { opacity: 0.5; }
.modal-status {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}
.modal-section-heading {
  font-weight: 700;
  margin: 1rem 0 0.4rem;
  color: var(--modal-text);
}
.modal-text {
  text-align: justify;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--modal-text-secondary);
}
.modal-text p { margin-bottom: 0.5rem; }
.modal-text ul { padding-left: 1.2rem; margin-bottom: 0.5rem; }
.modal-text .modal-subtitle { margin: 0.4rem 0; font-weight: 600; }
.modal-footer-divider {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--modal-border-divider);
  text-align: center;
  font-size: 0.75rem;
  color: var(--modal-text-faint);
}
.modal-consent-section {
  background: var(--modal-consent-bg);
  border: 1px solid var(--modal-consent-border);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
}
.modal-consent-section h4 {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--modal-consent-heading);
}
.modal-consent-section .modal-text {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--modal-text-dim);
}
.modal-consent-section .modal-text p { margin-bottom: 0.4rem; }
.modal-consent-section .modal-text ul { padding-left: 1.2rem; margin: 0.3rem 0; }
.modal-disclaimer-text {
  text-align: justify;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--modal-text-secondary);
  margin-bottom: 1rem;
}
.modal-disclaimer-text p { margin-bottom: 0.5rem; }
.modal-checkbox-label {
  display: flex;
  align-items: start;
  gap: 0.5rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--modal-text-secondary);
}
.modal-checkbox-label--mb { margin-bottom: 1rem; }
.modal-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--modal-accent);
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}
.modal-checkbox-link { color: var(--modal-accent); text-decoration: underline; }
.modal-text-muted { color: var(--modal-text-muted); }

/* ===== FOOTER STYLES ===== */
.landing-footer-links {
  text-align: center;
  padding: 1.5rem 0 0.25rem;
  font-size: 0.75rem;
  opacity: 0.5;
}
.landing-footer-links a,
.landing-footer-link-btn { text-decoration: underline; }
.landing-footer-link-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.landing-footer-links .landing-footer-sep { margin: 0 0.5rem; }
.landing-footer-copy {
  text-align: center;
  padding: 0.25rem 0 1rem;
  font-size: 0.7rem;
  opacity: 0.35;
}

/* ===== BANNERS ===== */
.slow-conn-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--color-orange-bg);
  border-bottom: 1px solid var(--color-orange-border);
  color: var(--text-bright);
  font-size: 0.82rem;
}
.slow-conn-banner button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.shared-cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-bright);
}
.shared-cta-btn {
  white-space: nowrap;
  padding: 0.4rem 0.75rem;
  background: var(--accent);
  color: #fff;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.shared-cta-btn:hover { background: var(--accent-hover); }

/* ===== MOBILE ZOOM (pinch only, no slider) ===== */
.bodygraph-zoom-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 100%;
}
.bodygraph-zoom-wrapper svg {
  transition: transform 0.08s ease-out;
  will-change: transform;
}

/* ===== RESPONSIVE: TABLET & MOBILE (< 1024px) ===== */
@media (max-width: 1024px) {
  html, body {
    overflow: hidden;
    max-width: 100vw;
    height: var(--app-height, 100dvh);
  }

  #main-layout {
    height: var(--app-height, 100dvh);
    max-height: var(--app-height, 100dvh);
    overflow: hidden;
    min-height: 0;
  }

  /* --- Sidebar: slide-in overlay --- */
  #main-layout > aside {
    width: 280px;
    height: calc(var(--app-height, 100dvh) - var(--mobile-bottom-bar));
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 40;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
  }
  #main-layout > aside.sidebar-open {
    transform: translateX(0);
  }
  #main-content {
    margin-left: 0;
    width: 100%;
    padding-bottom: var(--mobile-bottom-bar);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: calc(var(--app-height, 100dvh) - var(--mobile-bottom-bar));
    min-height: 0;
  }
  /* Фиксируем страницу при открытии бодиграфа — без скролла */
  #main-content:has(.chart-page) {
    overflow: hidden;
    padding-bottom: 0;
    height: var(--app-height, 100dvh);
  }

  /* --- Show mobile UI --- */
  .mobile-bottom-bar { display: block; }
  .chat-fab {
    display: flex;
    width: 48px;
    height: 48px;
    right: 0.75rem;
    bottom: calc(var(--mobile-bottom-bar) + var(--mobile-fab-offset));
  }
  .chat-fab svg { width: 24px; height: 24px; }

  /* --- Balance badge: правый верхний угол --- */
  .balance-badge {
    top: 0.5rem;
    right: 0.5rem;
  }

  /* --- Landing --- */
  .landing-nav {
    padding: 0.75rem 1rem;
    padding-top: max(0.75rem, calc(env(safe-area-inset-top) + 30px));
  }
  .landing-nav-brand { display: none; }
  .landing-nav-actions { gap: 0.4rem; }
  .landing-btn-ghost { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
  .landing-btn-outline { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
  .landing-hero { padding: 0 1rem; }
  .landing-h1 { font-size: clamp(2rem, 7vw, 3rem); }
  .landing-cta-btn { width: 100%; max-width: 320px; }
  .landing-features { grid-template-columns: 1fr; padding: 0 1rem 2rem; }
  .landing-about { padding: 1.5rem 1rem 1rem; }
  .landing-about-columns { flex-direction: column; gap: 1.5rem; }
  .landing-about .landing-features { grid-template-columns: 1fr; }
  .landing-about-title { font-size: 1.2rem; }
  .landing-about-col .landing-about-title { text-align: center; }

  /* --- Auth --- */
  .auth-bg > .w-full { padding: 0 0.5rem; }
  .glass-card.rounded-2xl.p-8 { padding: 1.25rem; }

  /* --- Charts list --- */
  .p-8 { padding: 1rem; }
  .charts-page { padding-top: 2.25rem; }
  .charts-page .mb-6 h1 { font-size: 1.35rem; }
  .chart-card { padding: 0.75rem; }

  /* --- Chart page: fullscreen bodygraph --- */
  .chart-page {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: var(--app-height, 100dvh);
    overflow: hidden;
    position: relative;
    padding-top: 0;
    padding-bottom: 3rem;
    box-sizing: border-box;
  }
  .chart-left {
    border-right: none;
    overflow: visible;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
  }

  /* Десктопный заголовок — скрыт */
  .chart-header {
    display: none !important;
  }

  /* Мобильный заголовок: имя + тип + бейджи */
  .mobile-chart-title {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    position: absolute;
    top: 0;
    left: 10px;
    right: 70px;
    z-index: 30;
    pointer-events: none;
  }
  .mobile-chart-title .mct-badge {
    pointer-events: auto;
    touch-action: manipulation;
  }
  .mct-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55%;
  }
  .mct-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
  }
  .mct-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
  }
  .mct-badge-purple {
    background: rgba(139,92,246,0.25);
    color: rgb(167,139,250);
    border: 1px solid rgba(139,92,246,0.35);
  }
  .mct-badge-blue {
    background: rgba(30,64,175,0.3);
    color: rgb(96,165,250);
    border: 1px solid rgba(30,64,175,0.5);
  }
  [data-theme="light"] .mct-badge-blue {
    background: rgba(30,64,175,0.15);
    color: #1e3a8a;
    border: 1px solid rgba(30,64,175,0.4);
  }

  /* Мобильный инфо-оверлей: справа */
  .mobile-info-overlay {
    display: flex !important;
    flex-direction: column;
    align-items: flex-end;
    position: absolute;
    right: 16px;
    top: 110px;
    z-index: 25;
    gap: 3px;
    max-width: 110px;
    pointer-events: auto;
  }
  .mio-row {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 3px 6px;
    border-radius: 6px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    background: rgba(17,24,39,0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(139,92,246,0.15);
    width: 100%;
    transition: background 0.15s;
  }
  .mio-row:active {
    background: rgba(139,92,246,0.25);
  }
  .mio-label {
    font-size: 0.45rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
  }
  .mio-value {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.2;
    text-align: right;
    word-break: break-word;
  }
  .mio-good { color: var(--color-success); }
  .mio-bad { color: var(--color-danger); }

  /* Бодиграф — весь экран */
  .bodygraph-wrap {
    position: absolute;
    top: var(--mobile-bodygraph-top);
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0;
    min-height: 0;
    z-index: 1;
  }
  #bodygraph-container {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: none;
    position: relative;
  }
  #bodygraph-container svg {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
  }
  .bodygraph-hint { display: none; }

  /* Легенда — компактная внизу */
  .bodygraph-legend {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    z-index: 25;
    gap: 0.4rem;
    padding: 0.2rem 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    pointer-events: auto;
    touch-action: none;
  }
  .legend-dot { width: 12px; height: 12px; }
  .legend-item { font-size: 0.5rem; gap: 0.15rem; cursor: pointer; }

  /* Увеличительный пузырь для легенды */
  .legend-bubble {
    position: fixed;
    z-index: 900;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 14px;
    background: var(--bg-popup);
    border: 2px solid var(--accent);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 20px var(--accent-glow);
    transform: translate(-50%, -100%);
    animation: touch-preview-in 0.12s ease;
    margin-top: -12px;
  }
  .legend-bubble-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.25);
  }
  .legend-bubble-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
    white-space: nowrap;
  }

  /* Транзиты — слева */
  .transit-controls {
    position: absolute;
    bottom: calc(8% - 29px);
    left: calc(30% - 80px);
    z-index: 25;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 0;
    background: none;
    border: none;
    max-width: 90px;
  }
  .transit-toggle-label {
    width: var(--mobile-header);
    height: var(--mobile-header);
    border-radius: 50%;
    background: var(--control-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--control-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 0;
  }
  .transit-toggle-label .text-xs { display: none; }
  .transit-toggle-switch { margin: 0; }
  .transit-date-input {
    position: absolute;
    top: 48px;
    left: -4px;
    font-size: 0.45rem;
    padding: 0.05rem 0.15rem;
    max-width: 80px;
    border-radius: 6px;
    height: 18px;
    min-height: unset;
    opacity: 0.85;
    animation: pulse-scale 2s ease-in-out infinite;
  }
  .forecast-open-btn {
    position: absolute;
    top: 47px;
    left: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    padding: 0;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--control-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--control-border);
    overflow: hidden;
    text-indent: -9999px;
    animation: pulse-scale 2s ease-in-out infinite;
  }
  .forecast-open-btn::before {
    content: "📅";
    text-indent: 0;
    display: block;
    font-size: 0.7rem;
  }
  #transit-strategy-btn {
    top: 20px;
    left: 0;
  }
  #transit-strategy-btn::before {
    content: "✨";
    text-indent: 0;
    display: block;
    font-size: 0.7rem;
  }
  .transit-info {
    position: absolute;
    top: 71px;
    left: 0;
    font-size: 0.4rem;
    max-width: 80px;
    line-height: 1.1;
  }

  /* Совместимость — справа, НАД эмоциональным центром */
  .composite-controls {
    position: absolute;
    right: 11px;
    bottom: calc(var(--mobile-bottom-bar) + var(--mobile-fab-offset) + var(--mobile-composite-offset));
    top: auto;
    z-index: 25;
    padding: 0;
  }
  .composite-open-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17,24,39,0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(16,185,129,0.3);
    font-size: 1.2rem;
    overflow: hidden;
    text-indent: -9999px;
    animation: pulse-scale 2s ease-in-out infinite;
  }
  .composite-open-btn::before {
    content: "";
    text-indent: 0;
    display: block;
    width: 22px;
    height: 22px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E") no-repeat center;
  }

  /* --- Demo chat responsive --- */
  .demo-chat-wrap {
    height: 150px;
    max-width: 100%;
    gap: 0.4rem;
  }
  .demo-bodygraph {
    flex: 0 0 100px;
  }
  .landing-hero--with-demo .landing-h1 {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
  }
  .landing-hero--with-demo .landing-lead {
    font-size: 0.78rem;
  }

  /* --- Chat: hidden on mobile, shown as bottom sheet --- */
  .chart-chat {
    display: none !important;
  }

  /* --- Element popup: bottom sheet on mobile --- */
  .element-popup {
    display: none !important;
  }

  /* --- Forecast/Composite panels: fullscreen overlay --- */
  .forecast-panel,
  .composite-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    min-height: 0;
    overflow-y: auto;
    background: var(--bg-body);
    padding-top: 38px;
  }
  .composite-stats {
    flex-wrap: wrap;
  }
  .comp-stat {
    min-width: 45%;
    flex: 1 1 45%;
  }

  /* --- Modals --- */
  .ooc-modal {
    width: 92vw;
    max-width: 420px;
    padding: 1.25rem;
  }

  /* --- Inputs: date/time не вылезают за экран --- */
  .input-field {
    max-width: 100%;
    box-sizing: border-box;
  }
  input[type="date"].input-field,
  input[type="time"].input-field {
    -webkit-appearance: none;
    appearance: none;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    min-height: var(--mobile-header);
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
  }

  /* --- Pricing responsive --- */
  .landing-pricing-grid { gap: 0.5rem; }
  .landing-price-card { padding: 1rem 0.5rem; }

  /* --- Misc --- */
  .empty-state { padding: 2rem 1rem; }

  /* --- Light theme: кнопки и инфо-карточки --- */
  [data-theme="light"] .mio-row {
    background: rgba(255,255,255,0.6);
    border-color: rgba(30,64,175,0.3);
  }
  [data-theme="light"] .mio-row:active {
    background: rgba(30,64,175,0.3);
  }

  /* --- Light theme: прогноз транзитов --- */
  [data-theme="light"] .forecast-event-time {
    color: #475569;
  }
  [data-theme="light"] .forecast-event {
    border-color: rgba(30,64,175,0.25);
  }
  [data-theme="light"] .forecast-day-has-events {
    border-color: rgba(30,64,175,0.2);
  }
  [data-theme="light"] .forecast-day-today {
    border-color: rgba(30,64,175,0.4);
  }
  [data-theme="light"] .forecast-event-planet {
    color: #1e293b;
  }
  [data-theme="light"] .forecast-event-gate {
    color: #4338ca;
  }
  [data-theme="light"] .forecast-tag-add {
    color: #16a34a;
    border-color: rgba(22,163,74,0.35);
  }
  [data-theme="light"] .forecast-tag-lose {
    color: #dc2626;
    border-color: rgba(220,38,38,0.35);
  }
}

/* ===== RESPONSIVE: SMALL PHONES (< 480px) ===== */
@media (max-width: 480px) {
  .landing-hero-bottom { margin-top: 0; }
  .landing-hero-bottom .landing-cta-btn { padding: 0.75rem 1.5rem; font-size: 0.95rem; }
  .landing-hero-bottom .landing-guest-hint { font-size: 0.7rem; }
  .landing-hero-bottom .landing-signin-hint { font-size: 0.75rem; }
  .landing-hero-bottom .landing-data-hint { font-size: 0.65rem; }
  .landing-hero-bottom .landing-learn-more { font-size: 0.7rem; margin-top: 0.3rem; }
  .landing-hero--with-demo {
    padding-top: 0;
    padding-bottom: 0.5rem;
  }
  .demo-chat-wrap {
    height: 140px;
    gap: 0.3rem;
  }
  .demo-bodygraph {
    flex: 0 0 90px;
  }
  .demo-bg-label {
    font-size: 0.55rem;
  }
  .demo-msg {
    font-size: 0.65rem;
    padding: 0.3rem 0.45rem;
  }
  .demo-chat-header {
    font-size: 0.6rem;
    padding: 0.35rem 0.45rem;
  }
  .landing-price-coins { font-size: 1.6rem; }
}

/* ===== RESPONSIVE: SMALL PHONES (< 380px, iPhone SE) ===== */
@media (max-width: 380px) {
  .chart-header { padding: 0.5rem 0.75rem 0.4rem; }
  .chart-props { grid-template-columns: 1fr; }
  .badge { font-size: 0.6rem; padding: 2px 6px; }
  .landing-h1 { font-size: 1.75rem; }
  .mobile-tab-btn { min-width: 48px; padding: 0.15rem 0.4rem; }

  /* Кнопки — выше эмоционального центра */
  .composite-controls {
    bottom: calc(var(--mobile-bottom-bar) + var(--mobile-fab-offset) + var(--mobile-composite-offset));
    right: 6px;
  }
  .composite-open-btn {
    width: 36px;
    height: 36px;
  }
  .chat-fab {
    width: 42px;
    height: 42px;
    bottom: calc(var(--mobile-bottom-bar) + 8px);
    right: 0.5rem;
  }
  .chat-fab svg { width: 20px; height: 20px; }
  .forecast-open-btn {
    width: 22px;
    height: 22px;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
