:root {
  --bg: #f7f4ec;
  --panel: rgba(255, 252, 245, 0.92);
  --text: #2e2618;
  --muted: #746851;
  --line: rgba(88, 65, 20, 0.14);
  --accent: #17624d;
  --accent-strong: #0e4d3c;
  --danger: #a33b2d;
  --shadow: 0 22px 45px rgba(64, 46, 12, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(209, 180, 122, 0.35), transparent 30%),
    linear-gradient(135deg, #f8f3e8, #f3ead7 55%, #ebe1cb);
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.narrow-shell {
  width: min(560px, calc(100% - 32px));
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.77rem;
  color: var(--accent-strong);
  margin: 0 0 8px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.3rem);
  line-height: 1;
}

.lead {
  color: var(--muted);
  max-width: 68ch;
}

.muted-line {
  color: var(--muted);
  margin: 0 0 12px;
}

.status-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.status-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-card span {
  color: var(--muted);
}

.login-panel {
  width: 100%;
}

.setup-box {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(248, 241, 224, 0.95);
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.panel {
  padding: 22px;
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header h2,
.panel-header p {
  margin: 0;
}

.panel-header p {
  color: var(--muted);
  margin-top: 6px;
}

.stack-form,
.recipe-fields {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
select,
button {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
}

input,
select {
  background: rgba(255, 255, 255, 0.85);
}

button {
  border: 0;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

button.secondary {
  background: #dfd1ae;
  color: var(--text);
}

button.danger {
  background: var(--danger);
}

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

.material-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(246, 238, 222, 0.95));
}

.preview-link {
  display: block;
}

.material-card img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 16px;
  background: #efe6d3;
}

.material-card-body {
  display: grid;
  gap: 4px;
}

.material-card h3,
.material-card p,
.mixing-preview h3 {
  margin: 0;
}

.material-card p {
  color: var(--muted);
}

.mixing-preview {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.list-item.compact {
  padding: 10px 12px;
}

.list-item strong,
.list-item span {
  display: block;
}

.list-item span {
  color: var(--muted);
  margin-top: 4px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #1d1d1d;
  color: white;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.hidden {
  display: none;
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
}

@media (max-width: 920px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .material-card {
    grid-template-columns: 1fr;
  }

  .material-card img {
    width: 100%;
    height: 120px;
  }
}
