:root {
  --bg: #08070d;
  --bg-soft: #12111a;
  --card: #131220;
  --card-2: #1a1830;
  --line: #2c2942;
  --text: #f8f5ff;
  --muted: #b1accf;
  --accent-1: #ff4da6;
  --accent-2: #b03eff;
  --accent-3: #7a5cff;
  --good: #39d98a;
  --warn: #ffbe55;
  --danger: #ff6b6b;
  --radius: 22px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

body.theme-light {
  --bg: #f4f7ff;
  --bg-soft: #eef3ff;
  --card: #ffffff;
  --card-2: #f0f4ff;
  --line: #d7def3;
  --text: #1a1f2f;
  --muted: #4f5976;
  --shadow: 0 16px 36px rgba(31, 53, 109, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 90% 0%, rgba(176, 62, 255, 0.18), transparent 30%),
    radial-gradient(circle at 10% 20%, rgba(255, 77, 166, 0.18), transparent 32%), var(--bg);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  min-height: 100%;
}

h1,
h2,
h3,
h4 {
  font-family: "Sora", sans-serif;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, rgba(26, 24, 48, 0.7), rgba(19, 18, 32, 0.7));
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: 0.2px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: contain;
  padding: 0;
  display: block;
  flex: 0 0 auto;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 24px rgba(176, 62, 255, 0.9);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  color: var(--muted);
  transition: all 0.2s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(176, 62, 255, 0.15);
  color: var(--text);
}

.main-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px 26px;
  background: linear-gradient(180deg, rgba(8, 7, 13, 0.95), rgba(8, 7, 13, 0.6), transparent);
  backdrop-filter: blur(10px);
}

.search-wrap {
  width: min(480px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 10px 12px;
}

.search-wrap input,
input,
select,
textarea,
button {
  font: inherit;
}

.search-wrap input,
input,
select,
textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
}

button {
  border: none;
  cursor: pointer;
}

.view {
  padding: 12px 24px 100px;
  display: grid;
  gap: 18px;
  animation: fadeIn 0.24s ease;
  max-width: 1500px;
}

.gradient-hero {
  padding: 24px;
  border-radius: 30px;
  background: linear-gradient(120deg, rgba(255, 77, 166, 0.2), rgba(176, 62, 255, 0.22), rgba(122, 92, 255, 0.22));
  border: 1px solid rgba(196, 172, 255, 0.18);
  box-shadow: var(--shadow);
}

.gradient-hero h1 {
  font-size: clamp(1.6rem, 2vw, 2.3rem);
  margin-bottom: 8px;
}

.gradient-text {
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kpi-grid,
.grid-3,
.grid-2,
.card-grid {
  display: grid;
  gap: 14px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.glass-card,
.stat-card,
.chart-card,
.table-wrap,
.form-card,
.timeline-item,
.empty-state,
.calculator-card {
  background: linear-gradient(180deg, rgba(26, 24, 48, 0.75), rgba(19, 18, 32, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

body.theme-light .glass-card,
body.theme-light .stat-card,
body.theme-light .chart-card,
body.theme-light .table-wrap,
body.theme-light .form-card,
body.theme-light .timeline-item,
body.theme-light .empty-state,
body.theme-light .calculator-card {
  background: linear-gradient(180deg, #ffffff, #f3f6ff);
}

body.theme-light {
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 77, 166, 0.14), transparent 28%),
    radial-gradient(circle at 12% 16%, rgba(122, 92, 255, 0.16), transparent 30%),
    linear-gradient(180deg, #f7f9ff, #eef4ff 46%, #e8efff 100%);
}

body.theme-light .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(240, 246, 255, 0.84));
}

body.theme-light .topbar {
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.92), rgba(244, 248, 255, 0.65), transparent);
}

body.theme-light .nav-item.active,
body.theme-light .nav-item:hover {
  background: rgba(122, 92, 255, 0.18);
  color: #11172a;
}

body.theme-light .search-wrap {
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(69, 86, 140, 0.08);
}

body.theme-light .gradient-hero {
  background: linear-gradient(120deg, rgba(255, 77, 166, 0.14), rgba(122, 92, 255, 0.18), rgba(80, 130, 255, 0.2));
  border-color: rgba(122, 92, 255, 0.22);
}

body.theme-light .btn,
body.theme-light .chip,
body.theme-light .tab {
  background: #edf2ff;
  border-color: #d7e0f8;
  color: #202842;
}

body.theme-light .btn.primary {
  color: #fff;
  border-color: transparent;
}

body.theme-light .btn.ghost {
  background: rgba(255, 255, 255, 0.75);
}

body.theme-light .chip.active,
body.theme-light .tab.active {
  background: rgba(122, 92, 255, 0.22);
  border-color: rgba(122, 92, 255, 0.38);
}

body.theme-light .peptide-card {
  background: linear-gradient(180deg, #ffffff, #f5f8ff);
  border-color: #d7def2;
}

body.theme-light .peptide-card:hover {
  border-color: rgba(122, 92, 255, 0.46);
}

body.theme-light .badge {
  background: rgba(122, 92, 255, 0.12);
  color: #364064;
}

body.theme-light .input-wrap select option {
  background: #ffffff;
  color: #1a1f2f;
}

body.theme-light .bottom-nav {
  background: rgba(247, 250, 255, 0.94);
}

.glass-card,
.chart-card,
.table-wrap,
.form-card,
.timeline-item,
.calculator-card {
  padding: 16px;
}

.stat-card {
  padding: 16px;
}

.stat-card .label {
  color: var(--muted);
  font-size: 0.86rem;
}

.stat-card .value {
  font-size: 1.9rem;
  font-weight: 700;
  margin-top: 6px;
}

.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn,
.chip,
.tab {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 10px 14px;
  color: var(--text);
  background: var(--card-2);
  transition: transform 0.18s ease, background 0.2s ease;
}

.btn:hover,
.chip:hover,
.tab:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: linear-gradient(120deg, rgba(255, 77, 166, 0.75), rgba(176, 62, 255, 0.75));
}

.btn.ghost {
  border-color: var(--line);
  background: transparent;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip.popular-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(255, 77, 166, 0.42);
  background: linear-gradient(120deg, rgba(255, 77, 166, 0.2), rgba(176, 62, 255, 0.2));
}

.chip.popular-filter svg {
  width: 14px;
  height: 14px;
  color: #ff7b7b;
}

.chip.popular-filter.active {
  border-color: rgba(255, 77, 166, 0.62);
  box-shadow: 0 0 0 1px rgba(176, 62, 255, 0.28);
}

body.theme-light .chip.popular-filter {
  background: linear-gradient(120deg, rgba(255, 77, 166, 0.18), rgba(122, 92, 255, 0.18));
  border-color: rgba(255, 77, 166, 0.36);
}

.chip.active,
.tab.active {
  background: rgba(176, 62, 255, 0.24);
  border-color: rgba(176, 62, 255, 0.5);
}

.muted {
  color: var(--muted);
}

.peptide-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(26, 24, 48, 0.7), rgba(19, 18, 32, 0.95));
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.peptide-card:hover {
  transform: translateY(-4px);
  border-color: rgba(176, 62, 255, 0.55);
}

.badge {
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 8px;
  border-radius: 999px;
  width: fit-content;
}

.risk-low {
  color: var(--good);
}

.risk-medium {
  color: var(--warn);
}

.risk-high {
  color: var(--danger);
}

.list {
  display: grid;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.input-wrap {
  display: grid;
  gap: 6px;
}

.input-wrap label {
  color: var(--muted);
  font-size: 0.85rem;
}

.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 78%, #000 22%);
  padding: 10px 12px;
  transition: border-color 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-wrap input::placeholder,
.input-wrap textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.input-wrap input:focus,
.input-wrap select:focus,
.input-wrap textarea:focus {
  border-color: rgba(176, 62, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(176, 62, 255, 0.22);
  background: color-mix(in srgb, var(--card) 88%, #000 12%);
}

.input-wrap textarea {
  resize: vertical;
  min-height: 96px;
}

.input-wrap select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent-3) 50%),
    linear-gradient(135deg, var(--accent-3) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.input-wrap select option {
  background: #181529;
  color: #f8f5ff;
}

body.theme-light .input-wrap input,
body.theme-light .input-wrap select,
body.theme-light .input-wrap textarea {
  background: #f8f6ff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  gap: 5px;
  animation: popIn 0.26s ease;
}

.chart {
  width: 100%;
  height: 220px;
}

.card-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.bottom-nav {
  display: none;
}

body.mobile-layout-force .app-shell {
  grid-template-columns: 1fr;
}

body.mobile-layout-force .sidebar {
  display: none;
}

body.mobile-layout-force .bottom-nav {
  position: fixed;
  left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  gap: 4px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(12, 10, 22, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}

body.theme-light.mobile-layout-force .bottom-nav {
  border-color: #d7e0f8;
  background: rgba(247, 250, 255, 0.96);
}

body.mobile-layout-force .bottom-nav .nav-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  grid-column: 1 / -1;
}

body.mobile-layout-force .bottom-nav .nav-item {
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 8px 3px;
  line-height: 1.1;
  text-align: center;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body.mobile-layout-force .bottom-nav .nav-item span {
  width: 100%;
  display: block;
  font-size: clamp(0.58rem, 2.25vw, 0.68rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.mobile-layout-force .bottom-nav .nav-item svg {
  width: 17px;
  height: 17px;
}

body.mobile-layout-force .topbar {
  padding: 10px 12px;
  flex-direction: column;
  align-items: stretch;
}

body.theme-light.mobile-layout-force .topbar {
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.98), rgba(246, 250, 255, 0.85));
}

body.mobile-layout-force .top-right {
  display: grid;
  grid-template-columns: minmax(130px, 1.2fr) repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

body.mobile-layout-force .top-right .btn,
body.mobile-layout-force .top-right .lang-control {
  width: 100%;
  justify-content: center;
}

body.mobile-layout-force .search-wrap {
  width: 100%;
}

body.mobile-layout-force .view {
  padding: 12px 12px calc(106px + env(safe-area-inset-bottom));
}

body.mobile-layout-force .grid-3,
body.mobile-layout-force .grid-2,
body.mobile-layout-force .kpi-grid,
body.mobile-layout-force .form-grid {
  grid-template-columns: 1fr;
}

.skeleton-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.skeleton-card {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.06));
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 16px;
  animation: pulse 1.2s infinite;
}

.skeleton-card div {
  height: 11px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.12);
}

.skeleton-card div:last-child {
  margin-bottom: 0;
  width: 60%;
}

.empty-state {
  text-align: center;
  padding: 36px 18px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 13, 0.7);
  display: grid;
  place-items: center;
  z-index: 100;
}

.modal {
  width: min(520px, 90vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-select {
  width: auto;
  min-width: 140px;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0 24px 0 2px;
  height: 38px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.lang-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  padding: 0 10px;
  height: 40px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lang-control::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 17px;
  width: 7px;
  height: 7px;
  border-right: 2px solid color-mix(in srgb, var(--text) 75%, transparent);
  border-bottom: 2px solid color-mix(in srgb, var(--text) 75%, transparent);
  transform: rotate(45deg);
  pointer-events: none;
}

.lang-control:focus-within {
  border-color: rgba(176, 62, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(176, 62, 255, 0.2);
  background: linear-gradient(180deg, rgba(176, 62, 255, 0.16), rgba(255, 255, 255, 0.03));
}

.lang-label {
  font-size: 0.95rem;
  opacity: 0.9;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 77, 166, 0.28), rgba(122, 92, 255, 0.28));
  color: #f4edff;
  border: 1px solid rgba(176, 62, 255, 0.35);
}

.category-icon svg {
  width: 13px;
  height: 13px;
}

.disclaimer-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
}

.disclaimer-check input {
  width: auto;
  margin-top: 2px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

body.theme-light .lang-select {
  color: #1a1f2f;
}

body.theme-light .lang-control {
  background: linear-gradient(180deg, #ffffff, #f5f8ff);
  border-color: #d6dff5;
}

body.theme-light .lang-control:focus-within {
  border-color: rgba(122, 92, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(122, 92, 255, 0.18);
}

body.theme-light .category-icon {
  color: #2f3a62;
  border-color: rgba(122, 92, 255, 0.35);
}

/* Theme Pack: Neon Clean (default) */
body.pack-neon {
  --accent-1: #ff4da6;
  --accent-2: #b03eff;
  --accent-3: #7a5cff;
}

/* Theme Pack: Noir */
body.pack-noir.theme-dark {
  --bg: #060608;
  --bg-soft: #0f1014;
  --card: #111217;
  --card-2: #1a1c23;
  --line: #2a2d37;
  --text: #f0f2f7;
  --muted: #a3acbf;
  --accent-1: #b7bccd;
  --accent-2: #7b8399;
  --accent-3: #545d73;
}

body.pack-noir.theme-dark {
  background:
    radial-gradient(900px 460px at 90% -12%, rgba(183, 188, 205, 0.13), transparent 58%),
    radial-gradient(700px 360px at -10% 10%, rgba(123, 131, 153, 0.1), transparent 56%),
    linear-gradient(160deg, #060608 0%, #090b11 40%, #08090f 100%);
}

body.pack-noir.theme-dark .gradient-hero {
  background: linear-gradient(120deg, rgba(183, 188, 205, 0.15), rgba(123, 131, 153, 0.16), rgba(84, 93, 115, 0.18));
  border-color: rgba(183, 188, 205, 0.2);
}

body.pack-noir.theme-dark .btn.primary {
  background: linear-gradient(120deg, rgba(138, 146, 166, 0.9), rgba(101, 110, 130, 0.9));
}

/* Theme Pack: Frost */
body.pack-frost.theme-dark {
  --bg: #071018;
  --bg-soft: #0d1824;
  --card: #10202f;
  --card-2: #172b3f;
  --line: #27445f;
  --text: #ecf8ff;
  --muted: #9ab5c6;
  --accent-1: #00b8ff;
  --accent-2: #4dd3ff;
  --accent-3: #67e8f9;
}

body.pack-frost.theme-dark {
  background:
    radial-gradient(980px 520px at 92% -10%, rgba(0, 184, 255, 0.16), transparent 56%),
    radial-gradient(800px 430px at -5% 16%, rgba(103, 232, 249, 0.16), transparent 58%),
    linear-gradient(150deg, #061119 0%, #0a1b2a 42%, #0a1622 100%);
}

body.pack-frost.theme-dark .gradient-hero {
  background: linear-gradient(120deg, rgba(0, 184, 255, 0.18), rgba(77, 211, 255, 0.17), rgba(103, 232, 249, 0.16));
  border-color: rgba(121, 225, 255, 0.26);
}

body.pack-frost.theme-dark .btn.primary {
  background: linear-gradient(120deg, rgba(0, 184, 255, 0.84), rgba(77, 211, 255, 0.84));
}

/* Light mode adaptations for packs */
body.pack-noir.theme-light {
  --card-2: #ecf1fb;
  --line: #cdd7ea;
  --accent-1: #6e7588;
  --accent-2: #8a95ab;
  --accent-3: #4e596f;
}

body.pack-noir.theme-light {
  background:
    radial-gradient(900px 460px at 95% -6%, rgba(110, 117, 136, 0.12), transparent 58%),
    radial-gradient(760px 420px at -8% 14%, rgba(138, 149, 171, 0.13), transparent 58%),
    linear-gradient(180deg, #f7f9ff 0%, #edf2fb 48%, #e8edf7 100%);
}

body.pack-frost.theme-light {
  --card-2: #e8f6ff;
  --line: #c4deec;
  --accent-1: #0094cc;
  --accent-2: #00b8ff;
  --accent-3: #47d7f4;
}

body.pack-frost.theme-light {
  background:
    radial-gradient(900px 480px at 96% -8%, rgba(0, 184, 255, 0.11), transparent 58%),
    radial-gradient(760px 420px at -10% 16%, rgba(71, 215, 244, 0.14), transparent 58%),
    linear-gradient(180deg, #f5fcff 0%, #eaf7ff 48%, #e3f1ff 100%);
}

/* ===== Visual Refresh Overrides ===== */
:root {
  --radius-lg: 28px;
  --radius-md: 16px;
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 24px 44px rgba(3, 0, 20, 0.42);
}

html {
  scroll-behavior: smooth;
}

body {
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(255, 77, 166, 0.18), transparent 55%),
    radial-gradient(900px 460px at -5% 12%, rgba(122, 92, 255, 0.2), transparent 55%),
    linear-gradient(160deg, #07060d 0%, #0b0817 38%, #090815 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(420px 220px at 20% 24%, rgba(176, 62, 255, 0.12), transparent 60%),
    radial-gradient(360px 180px at 82% 70%, rgba(255, 77, 166, 0.12), transparent 62%);
}

body::after {
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.12;
}

body.theme-light {
  background:
    radial-gradient(900px 480px at 95% -6%, rgba(255, 77, 166, 0.12), transparent 58%),
    radial-gradient(860px 460px at -10% 14%, rgba(80, 130, 255, 0.14), transparent 58%),
    linear-gradient(180deg, #f7faff 0%, #eef3ff 45%, #e8f0ff 100%);
}

.app-shell {
  position: relative;
}

.sidebar {
  border-right: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: linear-gradient(180deg, rgba(20, 18, 34, 0.84), rgba(10, 9, 18, 0.7));
}

.brand {
  font-size: 1.05rem;
  margin-bottom: 22px;
}

.nav-item {
  border: 1px solid transparent;
  border-radius: 13px;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgba(176, 62, 255, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.main-panel {
  min-height: 100vh;
}

.topbar {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: linear-gradient(180deg, rgba(8, 7, 13, 0.96), rgba(8, 7, 13, 0.72), rgba(8, 7, 13, 0.22));
}

.search-wrap {
  border-color: color-mix(in srgb, var(--line) 76%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.search-wrap:focus-within {
  border-color: rgba(176, 62, 255, 0.66);
  box-shadow: 0 0 0 3px rgba(176, 62, 255, 0.16);
  transform: translateY(-1px);
}

.view {
  width: 100%;
  margin: 0 auto;
  padding-top: 18px;
}

.gradient-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--glow);
}

.gradient-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0));
  opacity: 0.35;
}

.kpi-grid,
.grid-3,
.grid-2,
.card-grid {
  gap: 16px;
}

.glass-card,
.stat-card,
.chart-card,
.table-wrap,
.form-card,
.timeline-item,
.empty-state,
.calculator-card,
.peptide-card {
  border-radius: var(--radius-md);
  box-shadow: var(--glow);
}

.glass-card,
.stat-card,
.form-card,
.calculator-card,
.table-wrap,
.chart-card,
.peptide-card {
  backdrop-filter: blur(10px);
}

.stat-card .value {
  letter-spacing: -0.01em;
}

.btn,
.chip,
.tab {
  font-weight: 600;
  border-color: color-mix(in srgb, var(--line) 84%, transparent);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover,
.chip:hover,
.tab:hover {
  box-shadow: 0 12px 24px rgba(15, 6, 33, 0.26);
}

.btn.primary {
  box-shadow: 0 10px 24px rgba(176, 62, 255, 0.28);
}

.peptide-card {
  gap: 11px;
}

.peptide-card:hover {
  transform: translateY(-6px) scale(1.01);
}

.table-wrap {
  border-radius: 20px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--card) 86%, transparent);
}

tbody tr:hover {
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
}

.empty-state {
  padding: 44px 18px;
}

.modal {
  border-radius: 24px;
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
}

.lang-control {
  border-radius: 14px;
}

.lang-label {
  font-size: 1rem;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--bg) 85%, #000 15%);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 77, 166, 0.7), rgba(122, 92, 255, 0.7));
  border-radius: 999px;
}

body.theme-light .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 249, 255, 0.88));
}

body.theme-light .topbar {
  border-bottom-color: #d8e3fa;
}

body.theme-light .glass-card,
body.theme-light .stat-card,
body.theme-light .chart-card,
body.theme-light .table-wrap,
body.theme-light .form-card,
body.theme-light .timeline-item,
body.theme-light .empty-state,
body.theme-light .calculator-card,
body.theme-light .peptide-card {
  box-shadow: 0 16px 32px rgba(54, 88, 153, 0.12), 0 0 0 1px rgba(204, 220, 249, 0.8);
}

body.theme-light thead th {
  background: rgba(247, 250, 255, 0.92);
}

body.theme-light tbody tr:hover {
  background: rgba(122, 92, 255, 0.12);
}

@media (max-width: 1024px) {
  .topbar {
    border-bottom: none;
    background: linear-gradient(180deg, rgba(8, 7, 13, 0.96), rgba(8, 7, 13, 0.8));
  }

  body.theme-light .topbar {
    background: linear-gradient(180deg, rgba(246, 250, 255, 0.98), rgba(246, 250, 255, 0.85));
  }

  .bottom-nav {
    border-radius: 20px;
    padding: 7px;
  }

  .bottom-nav .nav-item {
    min-height: 56px;
  }
}

@media (max-width: 640px) {
  .view {
    gap: 14px;
  }

  .gradient-hero h1 {
    font-size: clamp(1.3rem, 6.2vw, 1.9rem);
  }

  .lang-control {
    height: 38px;
  }

  .btn,
  .chip,
  .tab {
    min-height: 38px;
  }
}

svg {
  width: 16px;
  height: 16px;
}

@keyframes pulse {
  0% {
    opacity: 0.45;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.45;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 220px 1fr;
  }

  .sidebar {
    padding: 20px 12px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .bottom-nav {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    gap: 4px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(12, 10, 22, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
    z-index: 50;
  }

  body.theme-light .bottom-nav {
    border-color: #d7e0f8;
    background: rgba(247, 250, 255, 0.96);
  }

  .bottom-nav .nav-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    grid-column: 1 / -1;
  }

  .bottom-nav .nav-item {
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    min-width: 0;
    min-height: 56px;
    padding: 8px 3px;
    line-height: 1.1;
    text-align: center;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .bottom-nav .nav-item span {
    width: 100%;
    display: block;
    font-size: clamp(0.58rem, 2.25vw, 0.68rem);
    line-height: 1.1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bottom-nav .nav-item svg {
    width: 17px;
    height: 17px;
  }

  .topbar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .top-right {
    display: grid;
    grid-template-columns: minmax(130px, 1.2fr) repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
  }

  .top-right .btn,
  .top-right .lang-control {
    width: 100%;
    justify-content: center;
  }

  .search-wrap {
    width: 100%;
  }

  .view {
    padding: 12px 12px calc(106px + env(safe-area-inset-bottom));
  }

  .grid-3,
  .grid-2,
  .kpi-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .gradient-hero {
    padding: 18px;
    border-radius: 22px;
  }

  .btn,
  .chip,
  .tab {
    padding: 9px 12px;
  }

  .lang-control {
    min-width: 118px;
  }

  .lang-select {
    min-width: 98px;
  }

  .top-right {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .top-right .lang-control {
    grid-column: 1 / -1;
  }

  .bottom-nav {
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    bottom: max(6px, env(safe-area-inset-bottom));
    padding: 5px 4px calc(7px + env(safe-area-inset-bottom));
    gap: 2px;
  }

  .bottom-nav .nav-list {
    gap: 2px;
  }

  .bottom-nav .nav-item {
    min-height: 52px;
    padding: 6px 2px;
  }

  .bottom-nav .nav-item span {
    font-size: clamp(0.54rem, 2.9vw, 0.62rem);
  }

  .view {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  .bottom-nav .nav-item {
    min-height: 50px;
    gap: 2px;
  }

  .bottom-nav .nav-item svg {
    width: 16px;
    height: 16px;
  }

  .bottom-nav .nav-item span {
    font-size: 0.53rem;
  }
}
