:root {
  color-scheme: light;
  --page: #f5f7f2;
  --ink: #151b18;
  --muted: #5c665f;
  --line: #d7ded6;
  --panel: #ffffff;
  --panel-soft: #eef4ed;
  --focus: #146c43;
  --shadow: 0 18px 50px rgba(23, 35, 29, 0.14);
  --result-color: #2fb3e8;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(160deg, rgba(245, 247, 242, 0.96), rgba(230, 238, 229, 0.96)),
    url("https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Combo_2.png/640px-Combo_2.png");
  background-position: center;
  background-size: cover;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  align-items: center;
}

.tool-panel {
  width: 100%;
  padding: 20px;
  border: 1px solid rgba(21, 27, 24, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
}

.chart-mark {
  width: 72px;
  height: 30px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
}

h1 {
  margin: 18px 0 8px;
  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.intro,
.disclaimer,
.form-message {
  color: var(--muted);
  line-height: 1.45;
}

.intro {
  margin: 0 0 20px;
}

.combo-form {
  display: grid;
  gap: 10px;
}

label {
  color: #25302a;
  font-size: 0.88rem;
  font-weight: 800;
}

.field-group {
  display: grid;
  gap: 8px;
}

input,
select {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
}

select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #25302a 50%) calc(100% - 20px) 22px / 7px 7px no-repeat,
    linear-gradient(135deg, #25302a 50%, transparent 50%) calc(100% - 15px) 22px / 7px 7px no-repeat,
    #fbfcfb;
  color: var(--ink);
}

.search-field {
  min-height: 44px;
  background: #f2f6f1;
}

.suggestions {
  display: none;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: -2px;
}

.suggestions.has-items {
  display: flex;
}

.suggestion-button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #26342d;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 750;
}

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

input:focus,
select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(20, 108, 67, 0.14);
}

.swap-button,
.primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.swap-button {
  justify-self: end;
  min-width: 78px;
  padding: 0 14px;
  background: #eef4ed;
  color: #244132;
}

.primary-button {
  width: 100%;
  margin-top: 8px;
  background: #146c43;
  color: #ffffff;
}

.swap-button:active,
.primary-button:active {
  transform: translateY(1px);
}

.result-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(21, 27, 24, 0.08);
  border-left: 8px solid var(--result-color);
  border-radius: 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--result-color) 18%, white), #ffffff 58%);
}

.result-panel.is-hidden {
  display: none;
}

.result-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.result-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.result-category {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  margin: 14px 0 10px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--result-color);
  color: var(--result-text, #111111);
  font-weight: 900;
}

.result-copy {
  margin: 0;
  color: #24302a;
  line-height: 1.45;
}

.form-message {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 0.92rem;
}

.substance-list {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

summary {
  cursor: pointer;
  color: #25302a;
  font-weight: 850;
}

.substance-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.substance-chip {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: #26342d;
  font-size: 0.88rem;
  font-weight: 700;
}

.disclaimer {
  margin: 18px 0 0;
  font-size: 0.88rem;
}

@media (min-width: 680px) {
  .tool-panel {
    padding: 28px;
  }

  h1 {
    font-size: 2.35rem;
  }
}
