:root {
  color-scheme: dark;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #2e2b28;
  color: #f4f2ec;
  --bg: #2e2b28;
  --sidebar: #252320;
  --panel: #34312d;
  --panel-2: #2c2a27;
  --card: #3a3632;
  --panel-strong: #372f3b;
  --border: #45403a;
  --border-soft: #514a43;
  --text: #f4f2ec;
  --muted: #b8b0a4;
  --accent: #81b64c;
  --accent-strong: #6aa23d;
  --accent-soft: #3c4c2f;
  --danger: #d46a5e;
  --good: #81d37f;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(129, 182, 76, 0.1), transparent 24%),
    linear-gradient(180deg, #322f2c 0%, #2b2926 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin-top: 0;
}

p,
li,
span,
label,
output {
  line-height: 1.6;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 18px 16px;
  border-right: 1px solid var(--border);
  background: #262320;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 6px 18px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #1f231a;
  font-weight: 800;
  font-size: 1.2rem;
}

.brand-eyebrow,
.sidebar-label,
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: #c9c1b4;
}

.brand strong {
  display: block;
  font-size: 1.1rem;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  border-radius: 12px;
  color: #ddd6cb;
  font-weight: 700;
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: #3a3632;
  color: #efe8db;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}

.nav-item.active,
.nav-item:hover {
  background: #312d29;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #1f231a;
}

.sidebar-card {
  margin-top: auto;
  padding: 16px 14px;
  border-radius: 16px;
  background: #302d2a;
  border: 1px solid var(--border);
}

.sidebar-card.muted {
  margin-top: 0;
}

.sidebar-card strong {
  display: block;
  margin-top: 6px;
  margin-bottom: 6px;
}

.sidebar-card p:last-child {
  margin-bottom: 0;
}

.page {
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.panel,
.profile-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel) 0%, #262129 100%);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 26px;
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 320px;
  gap: 20px;
  align-items: start;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  line-height: 0.94;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.intro,
.objective-copy,
#reaction-copy,
.profile-note,
.chem-list li,
.log-list li {
  color: var(--muted);
}

.profile-card {
  padding: 18px;
  background: linear-gradient(180deg, #3b3833 0%, #2f2c28 100%);
}

.profile-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.profile-note {
  margin: 12px 0 0;
  min-height: 44px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 360px;
  gap: 18px;
  margin-top: 18px;
}

.left-column,
.right-column {
  display: grid;
  gap: 18px;
}

.lab-panel,
.reaction-panel,
.score-panel,
.ingredients-panel,
.log-panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.round-chip,
.reaction-tags span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: #d7edb8;
  font-weight: 800;
}

.mix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.control {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.96rem;
}

.control select,
.control input[type="range"] {
  width: 100%;
}

.control select {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: #3b3833;
  color: var(--text);
  font: inherit;
}

.slider-control {
  margin-top: 18px;
}

.slider-control input[type="range"] {
  accent-color: var(--accent-strong);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #1f231a;
}

.secondary-button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.reaction-stage {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr 110px;
  gap: 16px;
  align-items: end;
  min-height: 140px;
  margin-bottom: 18px;
}

.beaker {
  height: 104px;
  border: 4px solid #d6c6d8;
  border-radius: 0 0 24px 24px;
  background:
    linear-gradient(180deg, transparent 0 36%, rgba(129, 182, 76, 0.18) 36% 100%);
  position: relative;
}

.beaker::before {
  content: "";
  position: absolute;
  inset: 12px 12px 0;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(129, 182, 76, 0.28));
}

.burst {
  height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, rgba(129, 182, 76, 0.95) 0 14%, rgba(106, 162, 61, 0.88) 14% 34%, rgba(212, 106, 94, 0.62) 34% 56%, transparent 56%),
    radial-gradient(circle at 34% 62%, rgba(129, 211, 127, 0.5) 0 12%, transparent 14%),
    radial-gradient(circle at 68% 64%, rgba(226, 187, 98, 0.46) 0 10%, transparent 12%);
  filter: drop-shadow(0 0 26px rgba(129, 182, 76, 0.26));
}

.reaction-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.stat-card {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #383530 0%, #302d29 100%);
  border: 1px solid var(--border);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.7rem;
}

.chem-list,
.log-list {
  padding-left: 18px;
  margin-bottom: 0;
}

.log-list li + li,
.chem-list li + li {
  margin-top: 8px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .hero-top,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .mix-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 14px;
  }

  .hero-card,
  .lab-panel,
  .reaction-panel,
  .score-panel,
  .ingredients-panel,
  .log-panel {
    padding: 18px;
  }

  .reaction-stage {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}
