/**
 * Dope Economics — Main Styles
 */

/* ============================
   RESET & BASE
   ============================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-mono);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============================
   CIRCUIT BOARD BG
   ============================ */
.circuit-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,255,136,0.015) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0,255,136,0.015) 1px, transparent 1px),
    radial-gradient(ellipse at 20% 50%, rgba(0,255,136,0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(255,51,102,0.02) 0%, transparent 60%);
  background-size: 40px 40px, 40px 40px, 100% 100%, 100% 100%;
}

/* ============================
   APP SHELL
   ============================ */
.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================
   PAGES
   ============================ */
.page {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(80px + var(--safe-bottom));
}

.page.active {
  display: flex;
}

/* ============================
   HEADER
   ============================ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px 8px;
}

.header-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--neon-green);
  text-shadow: 0 0 12px var(--neon-green-glow);
}

.header-subtitle {
  display: block;
  font-size: 10px;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 2px;
  margin-top: 2px;
}

.header-version {
  font-size: 9px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 4px;
}
.header-author {
  font-size: 9px;
  font-weight: 500;
  color: var(--neon);
  opacity: 0.5;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.header-author:active {
  opacity: 1;
}


/* ============================
   SECTION LABEL
   ============================ */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-left: 4px;
}

/* ============================
   MONITOR (GRAPH)
   ============================ */
.monitor {
  margin-bottom: 16px;
}

.graph-container {
  position: relative;
  width: 100%;
  height: 240px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-green);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow:
    0 0 20px rgba(0,255,136,0.05),
    inset 0 0 30px rgba(0,0,0,0.3);
}

.graph-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.graph-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.graph-hint {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dim);
}

/* Time controls */
.time-controls {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: center;
}

.time-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.time-btn.active {
  background: rgba(0,255,136,0.1);
  border-color: var(--border-green);
  color: var(--neon-green);
  text-shadow: 0 0 6px var(--neon-green-glow);
}

/* ============================
   CONTROLLER
   ============================ */
.controller {
  margin-bottom: 12px;
}

/* Tabs */
.controller-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.controller-tabs::-webkit-scrollbar { display: none; }

.tab {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  padding: 7px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s;
  flex-shrink: 0;
}

.tab.active {
  background: rgba(0,255,136,0.08);
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 10px rgba(0,255,136,0.15);
  text-shadow: 0 0 6px var(--neon-green-glow);
}

.tab:active {
  transform: scale(0.96);
}

/* Controller Filters (subcategory chips) */
.controller-filters {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.controller-filters::-webkit-scrollbar { display: none; }

.controller-filters:empty { display: none; }

.filter-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.filter-chip--active {
  background: rgba(0, 255, 136, 0.08);
  border-color: var(--border-green);
  color: var(--neon-green);
  text-shadow: 0 0 4px var(--neon-green-glow);
}

.filter-chip:active {
  transform: scale(0.95);
}

/* Stack Toggle */
.stack-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.stack-toggle {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.stack-toggle--active {
  background: rgba(0,255,136,0.1);
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 12px rgba(0,255,136,0.15);
  text-shadow: 0 0 6px var(--neon-green-glow);
}

.stack-toggle:active {
  transform: scale(0.96);
}

.stack-hint {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  line-height: 1.3;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s;
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--font-mono);
  min-height: 76px;
}

.card:active {
  transform: scale(0.95);
}

.card-emoji {
  font-size: 24px;
  line-height: 1;
}

.card-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card--active {
  border-color: var(--neon-green);
  background: rgba(0,255,136,0.06);
  box-shadow: 0 0 15px rgba(0,255,136,0.12), inset 0 0 15px rgba(0,255,136,0.04);
}

.card--active .card-name {
  color: var(--neon-green);
}

/* Promoted card (user's products — gold theme) */
.card--promoted {
  border-color: rgba(255, 204, 0, 0.35);
  background: rgba(255, 204, 0, 0.04);
  animation: promotedPulse 3s ease-in-out infinite;
}

.card--promoted .card-name {
  color: var(--neon-yellow);
}

.card--promoted.card--active {
  border-color: var(--neon-yellow);
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.15), inset 0 0 15px rgba(255, 204, 0, 0.04);
  animation: none;
}

.card-promoted {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 10px;
  line-height: 1;
}

@keyframes promotedPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 204, 0, 0.06); }
  50% { box-shadow: 0 0 14px rgba(255, 204, 0, 0.14); }
}


/* ============================
   CONTEXT PANEL
   ============================ */
.context-panel {
  position: fixed;
  bottom: calc(64px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  background: rgba(12, 18, 12, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--neon-green);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  padding-top: 20px;
  z-index: 90;
  overflow: hidden;
  max-height: 45vh;
  overflow-y: auto;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  will-change: transform;
}

/* Drag handle — свайп-индикатор */
.context-panel::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 10px;
}

/* Анимация закрытия */
.context-panel.context-hide {
  transform: translateX(-50%) translateY(110%);
  opacity: 0;
  transition: transform 0.3s ease-in, opacity 0.3s ease-in;
}

.context-glow {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 20px rgba(0,255,136,0.1);
  pointer-events: none;
}

.context-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.context-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--neon-green);
  text-shadow: 0 0 8px var(--neon-green-glow);
  flex: 1;
}

.context-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  line-height: 1;
}
.context-close:active {
  background: rgba(255, 51, 102, 0.15);
  border-color: rgba(255, 51, 102, 0.3);
  color: var(--neon-red);
  transform: scale(0.9);
}

.context-mechanism {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.context-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.context-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.stat-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-value--green {
  color: var(--neon-green);
}

.stat-value--red {
  color: var(--neon-red);
}

.context-sources {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.4;
  padding-top: 8px;
  border-top: 1px solid var(--border-dim);
}

/* Buy button (promoted supplements) */
.context-buy-wrap {
  margin-bottom: 10px;
}

.context-buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 18px;
  background: rgba(255, 204, 0, 0.12);
  border: 1px solid rgba(255, 204, 0, 0.5);
  border-radius: var(--radius-sm);
  color: var(--neon-yellow);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(255, 204, 0, 0.3);
}

.context-buy-btn:active {
  background: rgba(255, 204, 0, 0.25);
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.25);
  transform: scale(0.97);
}

/* ============================
   BOTTOM NAV
   ============================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(6, 10, 6, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-dim);
  padding: 6px 0 calc(6px + var(--safe-bottom));
  z-index: 100;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  font-family: var(--font-mono);
  transition: all 0.2s;
  -webkit-appearance: none;
}

.nav-btn.active {
  color: var(--neon-green);
}

.nav-btn.active .nav-icon {
  text-shadow: 0 0 8px var(--neon-green-glow);
}

.nav-icon {
  font-size: 18px;
}

.nav-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ============================
   MODALS
   ============================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-modal);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  border: 1px solid var(--border-green);
  overflow: hidden;
}

.modal-glow {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  box-shadow: 0 0 40px rgba(0,255,136,0.1);
  pointer-events: none;
}


.modal-icon {
  text-align: center;
  font-size: 36px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.modal-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  text-align: center;
  margin-bottom: 10px;
}

.modal-text--warning {
  color: var(--neon-red-dim);
  font-weight: 500;
  margin-bottom: 24px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 28px;
  cursor: pointer;
  z-index: 2;
}

/* Buttons */
.btn-neon {
  display: block;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
}

.btn-neon--green {
  background: rgba(0,255,136,0.12);
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
  box-shadow: 0 0 20px rgba(0,255,136,0.15);
  text-shadow: 0 0 8px var(--neon-green-glow);
}

.btn-neon--green:active {
  background: rgba(0,255,136,0.25);
  box-shadow: 0 0 30px rgba(0,255,136,0.3);
  transform: scale(0.98);
}

.btn-neon--red {
  background: rgba(255,51,102,0.08);
  color: var(--neon-red);
  border: 1px solid rgba(255,51,102,0.3);
  font-size: 12px;
  padding: 10px 16px;
  margin-top: 12px;
}

.btn-neon--large {
  padding: 16px 24px;
  font-size: 15px;
  margin-top: 16px;
}


/* ============================
   PAGE HEADER
   ============================ */
.page-header {
  padding: 14px 4px 12px;
}

.page-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.page-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Search */
.search-wrap {
  margin-bottom: 10px;
}

.search-input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
}

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

.search-input::placeholder {
  color: var(--text-dim);
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-btn.active {
  background: rgba(0,255,136,0.08);
  border-color: var(--border-green);
  color: var(--neon-green);
}

/* ============================
   LIBRARY
   ============================ */
.library-list {
  padding-bottom: 20px;
}

.library-group {
  margin-bottom: 16px;
}

.library-group-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 4px;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 6px;
}

.library-item {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.library-item:active {
  background: var(--bg-card-hover);
}


.library-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.library-item-emoji {
  font-size: 20px;
  flex-shrink: 0;
}

.library-item-info {
  flex: 1;
  min-width: 0;
}

.library-item-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-item-stats {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}


.library-item-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-dim);
}

.library-item-mechanism {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.library-item-meta {
  display: flex;
  gap: 16px;
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.library-item-sources {
  font-size: 9px;
  color: var(--text-dim);
}

.library-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-dim);
  font-size: 13px;
}

/* ============================
   COMPARE
   ============================ */
.compare-selector {
  padding: 0 4px;
  margin-bottom: 12px;
}

.compare-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(0,255,136,0.08);
  border: 1px solid var(--border-green);
  border-radius: 20px;
  font-size: 11px;
  color: var(--neon-green);
}

.chip-remove {
  background: none;
  border: none;
  color: var(--neon-red);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.compare-add-wrap {
  margin-top: 8px;
}

.compare-select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.compare-select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.compare-graph-container {
  width: 100%;
  height: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.compare-graph-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Compare table */
.compare-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.compare-tbl th {
  padding: 8px 6px;
  text-align: left;
  font-weight: 600;
  color: var(--neon-green);
  border-bottom: 1px solid var(--border-green);
  font-size: 10px;
}

.compare-tbl td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-dim);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.4;
}

.compare-label {
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================
   PROFILE
   ============================ */
.profile-content {
  padding: 0 4px;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  margin-bottom: 16px;
}

.profile-status,
.profile-telegram {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.profile-status {
  border-bottom: 1px solid var(--border-dim);
}

.profile-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.profile-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-about {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
}

.profile-about h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.profile-about p {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============================
   LIBRARY ENHANCED CARDS
   ============================ */
.lib-risk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.risk-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.risk-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.risk-fill--1 { background: var(--neon-green); }
.risk-fill--2 { background: #88ff00; }
.risk-fill--3 { background: var(--neon-yellow); }
.risk-fill--4 { background: #ff6600; }
.risk-fill--5 { background: var(--neon-red); }

.risk-text {
  font-size: 10px;
  font-weight: 600;
  min-width: 70px;
  text-align: right;
}

.risk-text--1 { color: var(--neon-green); }
.risk-text--2 { color: #88ff00; }
.risk-text--3 { color: var(--neon-yellow); }
.risk-text--4 { color: #ff6600; }
.risk-text--5 { color: var(--neon-red); }

/* Neurotransmitter badges */
.lib-neuro {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.neuro-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.neuro-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.neuro-da {
  background: rgba(0,255,136,0.12);
  color: var(--neon-green);
  border: 1px solid rgba(0,255,136,0.25);
}

.neuro-5ht {
  background: rgba(153,69,255,0.12);
  color: var(--neon-purple);
  border: 1px solid rgba(153,69,255,0.25);
}

.neuro-ne {
  background: rgba(255,102,0,0.12);
  color: #ff6600;
  border: 1px solid rgba(255,102,0,0.25);
}

.neuro-gaba {
  background: rgba(0,204,255,0.12);
  color: var(--neon-cyan);
  border: 1px solid rgba(0,204,255,0.25);
}

.neuro-endo {
  background: rgba(255,51,102,0.12);
  color: var(--neon-red);
  border: 1px solid rgba(255,51,102,0.25);
}

.neuro-glu {
  background: rgba(255,204,0,0.12);
  color: var(--neon-yellow);
  border: 1px solid rgba(255,204,0,0.25);
}

.neuro-cb1 {
  background: rgba(136,255,0,0.12);
  color: #88ff00;
  border: 1px solid rgba(136,255,0,0.25);
}

.neuro-ot {
  background: rgba(255,0,204,0.12);
  color: #ff00cc;
  border: 1px solid rgba(255,0,204,0.25);
}

/* Mini-graph */
.lib-mini-graph {
  margin: 8px 0;
  height: 60px;
  background: rgba(0,0,0,0.25);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mini-graph-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Stats grid */
.lib-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.lib-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.lib-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.lib-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.lib-value--green { color: var(--neon-green); }
.lib-value--red { color: var(--neon-red); }

/* Extras row */
.lib-extras {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-dim);
}

.lib-extra {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

/* ============================
   ONBOARDING MODAL
   ============================ */
.onboarding-modal {
  max-width: 400px;
  max-height: 85vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.onboarding-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 32px 24px;
  flex: 1;
  min-height: 0;
}

.onboarding-section {
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(0, 255, 136, 0.03);
  border: 1px solid var(--border-green);
  border-radius: var(--radius-md);
}

.onboarding-section-icon {
  font-size: 22px;
  margin-bottom: 6px;
}

.onboarding-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--neon-green);
  text-shadow: 0 0 8px var(--neon-green-glow);
  margin-bottom: 8px;
}

.onboarding-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

.onboarding-text:last-child {
  margin-bottom: 0;
}

.onboarding-text b {
  color: var(--text-primary);
  font-weight: 600;
}

.onboarding-highlight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(0, 255, 136, 0.06);
  border: 1px solid var(--neon-green);
  border-radius: var(--radius-sm);
}

.onboarding-highlight-label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--neon-green);
  padding: 3px 8px;
  border: 1px solid var(--neon-green);
  border-radius: 4px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.onboarding-highlight-text {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================
   PROFILE LINKS
   ============================ */
.profile-section {
  margin-bottom: 16px;
}

.profile-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 4px 0 8px;
}

.profile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.profile-link:active {
  background: var(--bg-card-hover);
  transform: scale(0.98);
}

.profile-link-icon {
  flex-shrink: 0;
  color: var(--neon-green);
  display: flex;
  align-items: center;
}

.profile-link-text {
  flex: 1;
  text-align: left;
  line-height: 1.4;
}

.profile-link-sub {
  display: block;
  font-size: 10px;
  color: var(--neon-green);
  font-weight: 600;
  margin-top: 2px;
}

.profile-link-arrow {
  flex-shrink: 0;
  color: var(--text-dim);
  font-size: 16px;
}

.profile-link-badge {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.profile-link-badge--soon {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  border: 1px solid var(--border-dim);
}

.profile-link--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.profile-link--cta {
  border-color: var(--border-green);
  background: rgba(0, 255, 136, 0.04);
}

.profile-link--cta .profile-link-icon {
  color: var(--neon-green);
}

.profile-link--cta .profile-link-arrow {
  color: var(--neon-green);
}

/* ============================
   NEUROPROFILE
   ============================ */
.neuroprofile-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.neuroprofile-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-mono);
  -webkit-appearance: none;
  appearance: none;
}

.neuroprofile-btn--active {
  border-color: var(--neon-green);
  background: rgba(0, 255, 136, 0.08);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.12);
}

.neuroprofile-btn--active[data-profile="adhd"] {
  border-color: var(--neon-cyan);
  background: rgba(0, 204, 255, 0.08);
  box-shadow: 0 0 15px rgba(0, 204, 255, 0.12);
}

.neuroprofile-icon {
  font-size: 24px;
}

.neuroprofile-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.neuroprofile-btn--active .neuroprofile-label {
  color: var(--neon-green);
  text-shadow: 0 0 6px var(--neon-green-glow);
}

.neuroprofile-btn--active[data-profile="adhd"] .neuroprofile-label {
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(0, 204, 255, 0.3);
}

.neuroprofile-desc {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.5;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dim);
}

.neuroprofile-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--neon-cyan);
  background: rgba(0, 204, 255, 0.1);
  border: 1px solid rgba(0, 204, 255, 0.25);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

/* ============================
   ANTI-DRUG WARNINGS
   ============================ */

/* Disclaimer Modal — enhanced scrollable */
.disclaimer-modal {
  max-width: 400px;
  max-height: 90vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.disclaimer-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 28px 20px 14px;
  flex: 1;
  min-height: 0;
}

.disclaimer-footer {
  flex-shrink: 0;
  padding: 0 20px 24px;
}

.disclaimer-section {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
}

.disclaimer-section--red {
  background: rgba(255, 51, 102, 0.06);
  border: 1px solid rgba(255, 51, 102, 0.3);
}

.disclaimer-section--yellow {
  background: rgba(255, 204, 0, 0.04);
  border: 1px solid rgba(255, 204, 0, 0.25);
}

.disclaimer-section--dim {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dim);
}

.disclaimer-section-icon {
  font-size: 20px;
  margin-bottom: 6px;
}

.disclaimer-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.disclaimer-section--red .disclaimer-section-title {
  color: var(--neon-red);
}

.disclaimer-section--yellow .disclaimer-section-title {
  color: var(--neon-yellow);
}

.disclaimer-section-text {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 6px;
}

.disclaimer-section-text:last-child {
  margin-bottom: 0;
}

.disclaimer-section-text b {
  color: var(--text-primary);
  font-weight: 600;
}

/* Substance Warning Banner */
.substance-warning-banner {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(255, 51, 102, 0.06);
  border: 1px solid rgba(255, 51, 102, 0.3);
  border-radius: var(--radius-sm);
  color: var(--neon-red-dim);
  animation: warningPulse 3s ease-in-out infinite;
}

@keyframes warningPulse {
  0%, 100% { border-color: rgba(255, 51, 102, 0.3); }
  50% { border-color: rgba(255, 51, 102, 0.6); }
}

/* Context Panel Danger Warning */
.context-danger-warning {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
}

.context-danger-warning--critical {
  background: rgba(255, 51, 102, 0.1);
  border: 1px solid rgba(255, 51, 102, 0.4);
  color: var(--neon-red);
}

.context-danger-warning--danger {
  background: rgba(255, 102, 0, 0.08);
  border: 1px solid rgba(255, 102, 0, 0.3);
  color: #ff6600;
}

.context-danger-warning--info {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
}

/* Card Danger Indicator */
.card-danger {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  line-height: 1;
  opacity: 0.7;
}

/* Library Warning Banner */
.library-warning-banner {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: rgba(255, 51, 102, 0.06);
  border: 1px solid rgba(255, 51, 102, 0.3);
  border-radius: var(--radius-sm);
  color: var(--neon-red-dim);
}

/* Library Legal Warning (inside expanded cards) */
.lib-legal-warning {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  padding: 6px 8px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
}

.lib-legal-warning--critical {
  background: rgba(255, 51, 102, 0.08);
  border: 1px solid rgba(255, 51, 102, 0.3);
  color: var(--neon-red);
}

.lib-legal-warning--danger {
  background: rgba(255, 102, 0, 0.06);
  border: 1px solid rgba(255, 102, 0, 0.25);
  color: #ff6600;
}

.lib-legal-warning--info {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
}

/* Onboarding Warning Section */
.onboarding-section--warning {
  background: rgba(255, 51, 102, 0.06);
  border: 1px solid rgba(255, 51, 102, 0.3);
}

.onboarding-title--red {
  color: var(--neon-red) !important;
  text-shadow: 0 0 8px rgba(255, 51, 102, 0.4) !important;
}

.onboarding-text--red {
  color: var(--neon-red-dim);
}

.onboarding-text--red b {
  color: var(--neon-red);
}

/* Profile Legal Section */
.profile-legal {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 51, 102, 0.25);
  border-radius: var(--radius-md);
}

.profile-legal-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--neon-red-dim);
  margin-bottom: 12px;
}

.profile-legal-block {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-dim);
}

.profile-legal-block:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.profile-legal-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.profile-legal-block p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}

.profile-legal-block p:last-child {
  margin-bottom: 0;
}

.profile-legal-block p b {
  color: var(--text-primary);
}

.profile-legal-hotline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  background: rgba(0, 255, 136, 0.04);
  border: 1px solid var(--border-green);
  border-radius: var(--radius-sm);
}

.profile-legal-hotline-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.profile-legal-hotline-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.profile-legal-hotline-number {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--neon-green);
  letter-spacing: 1px;
  margin: 2px 0;
}

.profile-legal-hotline-desc {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (min-width: 400px) {
  .cards-grid {
    gap: 10px;
  }
  .card {
    padding: 16px 8px 12px;
    min-height: 82px;
  }
  .card-name {
    font-size: 11px;
  }
}

@media (min-width: 768px) {
  .app {
    max-width: 600px;
  }
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .graph-container {
    height: 300px;
  }
}
