:root {
  color-scheme: light;
  --bg: #f6efe6;
  --card: #ffffff;
  --accent: #d35d3c;
  --accent-2: #0f7a75;
  --text: #1f2430;
  --muted: #5d6677;
  --border: #e6ddd1;
  --chip: #f3ebe2;
  --success: #1f8a53;
  font-family: "Trebuchet MS", "Gill Sans MT", "Avenir Next", "Candara", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(211, 93, 60, 0.16), transparent 45%),
    radial-gradient(circle at 88% 18%, rgba(15, 122, 117, 0.14), transparent 42%),
    radial-gradient(circle at 15% 85%, rgba(255, 198, 102, 0.18), transparent 40%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.7), rgba(246, 239, 230, 0.9));
  color: var(--text);
  min-height: 100vh;
}

#app-root {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
}

.app-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.app-shell > * {
  position: relative;
  z-index: 1;
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 20px 10px auto auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(15, 122, 117, 0.18), transparent 70%);
  filter: blur(2px);
  z-index: 0;
  pointer-events: none;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(29, 36, 48, 0.08);
}

.title {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.2px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  border: none;
  background: linear-gradient(135deg, var(--accent), #f08a4b);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 18px rgba(211, 93, 60, 0.18);
}

button.secondary {
  background: #fdf7f0;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed #d6c8bb;
  box-shadow: none;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 26px rgba(31, 36, 48, 0.08);
  animation: fadeUp 0.35s ease;
}

.stepper {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.7);
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
  color: var(--muted);
  white-space: nowrap;
}

.step-pill.active {
  border-color: var(--accent);
  color: #fff;
  background: linear-gradient(130deg, var(--accent), #f08a4b);
}

.step-pill.done {
  border-color: var(--success);
  color: var(--success);
  background: rgba(31, 138, 83, 0.12);
}

.section-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.helper {
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.form-grid {
  display: grid;
  gap: 16px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--text);
  cursor: pointer;
  transition: all 0.1s ease;
  line-height: 1.2;
}

.chip[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--accent-2), #1a9b8a);
  color: #fff;
  border-color: var(--accent-2);
  box-shadow: 0 6px 14px rgba(15, 122, 117, 0.25);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(15, 122, 117, 0.45);
  outline-offset: 2px;
}

.chip.small {
  font-size: 0.9rem;
  padding: 6px 10px;
}

.chip.removable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.search-box {
  position: relative;
}

.search-box input {
  padding-left: 12px;
}

.multi-select {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.categories {
  display: grid;
  gap: 12px;
}

.category {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.category-title {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.95rem;
}

.selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tannin-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.selected-chips .chip {
  background: #fff4ec;
  border-color: #f6c4a4;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.note-box {
  width: 100%;
  background: #fffdf8;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-height: 150px;
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
}

.warning {
  background: #fff7e6;
  color: #8a5b00;
  border: 1px solid #ffe7ba;
  padding: 10px;
  border-radius: 12px;
  margin: 10px 0;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.small-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.overview-list {
  display: grid;
  gap: 8px;
}

.overview-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}

.overview-row strong {
  min-width: 120px;
}

@media (min-width: 768px) {
  #app-root {
    padding: 28px;
  }

  .form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
