
:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --accent: #F06732;
  --accent-soft: rgba(240, 103, 50, 0.12);
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.1);
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #e5e7eb 0, #f9fafb 45%);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
}

.app {
  width: 100%;
  max-width: 1000px;
  background: rgba(249, 250, 251, 0.96);
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  padding: 20px 20px 18px;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.title-block h1 {
  margin: 0;
  font-size: 24px;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.lang-toggle {
  display: inline-flex;
  padding: 3px;
  background: #ffffff;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.lang-toggle button {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lang-toggle button.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.flag {
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr;
  gap: 14px;
}

@media (max-width: 820px) {
  body {
    padding: 14px;
  }
  .app {
    padding: 16px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-right {
    align-items: flex-start;
  }
}

.card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 14px 14px 12px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
}

.card-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fed7aa;
}

.card-caption {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 0;
}

.badge {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff7ed;
  color: var(--accent);
}

.field {
  margin-bottom: 10px;
}

label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

select,
input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f9fafb;
  font-size: 13px;
  color: var(--text);
  outline: none;
}

select:focus,
input[type="number"]:focus,
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(240, 103, 50, 0.25);
  background: #ffffff;
}

.ingredient-list {
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fefefe;
  padding: 4px 0;
}

.ingredient-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding: 4px 10px;
  margin-top: 4px;
}

.ingredient-item {
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.ingredient-item:hover {
  background: #fff7ed;
}

.ingredient-item.selected {
  background: #F97316;
  color: #fefce8;
}

.ingredient-main {
  font-weight: 500;
}

.btn {
  margin-top: 4px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #F06732, #FDBA74);
  color: #451a03;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(240, 103, 50, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(240, 103, 50, 0.55);
}

.helper {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.error {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.results {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  background: #fff7ed;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}

.result-name {
  font-size: 13px;
  font-weight: 600;
}

.amount-badge {
  margin-top: 6px;
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: #F97316;
  color: #FEFCE8;
  font-size: 11px;
  font-weight: 600;
}

.amount-badge span {
  display: block;
}

.result-macros {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.macro-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #fee2e2;
  color: var(--muted);
}

.macro-tag strong {
  color: var(--text);
}

.score {
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
}

.empty {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

.hidden {
  display: none !important;
}
