:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --surface: #ffffff;
  --soft: #f6f8fb;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --accent-soft: #dff7f3;
  --gold: #b7791f;
  --rose: #be123c;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 8%, rgba(15, 118, 110, 0.14), transparent 30%),
    radial-gradient(circle at 86% 12%, rgba(37, 99, 235, 0.12), transparent 28%),
    linear-gradient(180deg, #f8fbfa 0%, #eef4f3 42%, #ffffff 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: clamp(2.35rem, 5vw, 5.15rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.12rem;
  letter-spacing: 0;
}

.intro {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.6;
}

.hero-stat {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
  text-align: right;
  backdrop-filter: blur(18px);
}

.hero-stat span {
  display: block;
  font-size: 2.1rem;
  font-weight: 900;
}

.hero-stat small {
  color: var(--muted);
  font-weight: 750;
}

.search-card {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-box {
  display: grid;
  gap: 8px;
}

.search-box span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--ink);
  background: #ffffff;
  font-size: 1.12rem;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.menu-row,
.category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.category-strip button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 750;
}

.cat-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: 0.78rem;
  line-height: 1;
}

.category-strip button.active .cat-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.menu-row {
  align-items: flex-start;
  justify-content: space-between;
}

.category-strip {
  flex: 1;
  margin-top: 0;
}

.missing-menu-link,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #fecdd3;
  border-radius: 999px;
  padding: 0 14px;
  color: #be123c;
  background: #fff1f2;
  font-weight: 850;
  text-decoration: none;
}

.category-strip button.active {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin: 26px 0 14px;
}

.results-header p,
#resultCount {
  margin: 0;
  color: var(--muted);
}

#resultCount {
  flex: 0 0 auto;
  font-weight: 800;
}

.results-tools {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.sort-control {
  display: grid;
  gap: 6px;
  min-width: min(100%, 250px);
}

.sort-control span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.sort-control select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

.results-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.show-more-row {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.show-more-row button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.show-more-row button[hidden] {
  display: none;
}

.recommended-panel {
  margin-bottom: 14px;
}

.recommended-panel:empty {
  display: none;
}

.result-card {
  display: grid;
  gap: 14px;
  min-height: 215px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
}

.result-card.recommended {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  border-color: rgba(15, 118, 110, 0.35);
  background: linear-gradient(135deg, rgba(223, 247, 243, 0.82), rgba(255, 255, 255, 0.96));
}

.result-card.recommended::before {
  content: "Meilleur choix";
  width: max-content;
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.result-name {
  min-width: 0;
}

.result-name strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.result-name small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.score {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 900;
}

.meta-row,
.nutrition-row,
.feedback-actions,
.coach-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.primary {
  color: var(--accent);
  background: var(--accent-soft);
}

.pill.blue {
  color: var(--accent-2);
  background: #e9f1ff;
}

.pill.gold {
  color: var(--gold);
  background: #fff7df;
}

.pill.rose {
  color: var(--rose);
  background: #fff1f2;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 26px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.feedback-actions button,
.coach-actions button,
.request-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 850;
  text-decoration: none;
}

.feedback-actions button.primary-action {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.feedback-actions button.warning-action {
  border-color: #fecdd3;
  color: #be123c;
  background: #fff1f2;
}

.request-action {
  border-color: #fecdd3;
  color: #be123c;
  background: #fff1f2;
}

.coach-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.coach-panel h2 {
  margin-bottom: 4px;
}

.coach-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.feedback-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.feedback-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--soft);
  color: var(--muted);
}

.feedback-item strong {
  color: var(--ink);
}

.missing-form {
  display: grid;
  gap: 14px;
}

.missing-form textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  outline: none;
}

.missing-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

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

.missing-actions button,
.missing-actions a {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 850;
  text-decoration: none;
}

.missing-actions .primary-action {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

@media (max-width: 940px) {
  .hero,
  .results-list,
  .coach-panel {
    grid-template-columns: 1fr;
  }

  .hero-stat {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 26px;
  }

  .search-card,
  .result-card {
    padding: 14px;
  }

  .results-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-top {
    flex-direction: column;
  }
}
