:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #687076;
  --line: #d8ddd4;
  --paper: #fffdf7;
  --panel: #ffffff;
  --sage: #2f6b4f;
  --sage-soft: #e6f1eb;
  --tomato: #bd452d;
  --gold: #f5c75d;
  --sky: #d9ecf7;
  --shadow: 0 22px 55px rgba(41, 44, 38, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(245, 199, 93, 0.34), transparent 34%),
    linear-gradient(315deg, rgba(217, 236, 247, 0.7), transparent 38%), var(--paper);
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.chat-panel {
  width: min(920px, 100%);
  height: min(820px, calc(100vh - 56px));
  min-height: 620px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(47, 107, 79, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--tomato);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2.1rem);
  letter-spacing: 0;
}

.status-pill {
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage);
  text-align: center;
  font-weight: 800;
  white-space: nowrap;
}

.messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  overflow-y: auto;
}

.message {
  max-width: 82%;
  border-radius: 8px;
  padding: 14px 16px;
  line-height: 1.5;
}

.message.user {
  align-self: flex-end;
  background: var(--sage);
  color: white;
}

.message.bot {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
}

.answer-text {
  margin: 0 0 14px;
}

.truck-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.truck-card > div {
  min-width: 0;
  padding: 12px;
  background: var(--sage-soft);
  border-radius: 8px;
}

.label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.truck-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.menu-section,
.links-section,
.truck-more-section {
  margin-top: 16px;
}

.truck-card .featured-links-section {
  grid-column: 1 / -1;
}

.truck-more-section {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.truck-more-section summary {
  width: fit-content;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(47, 107, 79, 0.24);
  border-radius: 999px;
  padding: 0 12px;
  background: white;
  color: var(--sage);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  list-style: none;
}

.truck-more-section summary::-webkit-details-marker {
  display: none;
}

.truck-more-section summary::after {
  content: "+";
  font-weight: 900;
}

.truck-more-section[open] summary::after {
  content: "−";
}

.truck-more-content {
  margin-top: 10px;
}

h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.compact-link {
  display: grid;
  gap: 3px;
}

.featured-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.featured-links li {
  border-top: 0;
  padding: 0;
}

.link-icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(47, 107, 79, 0.24);
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage);
  text-decoration: none;
}

.link-icon-button:hover,
.link-icon-button:focus-visible {
  background: var(--sage);
  color: white;
}

.link-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
}

.link-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
}

.link-icon.facebook svg {
  stroke-width: 0;
}

.link-icon.instagram svg,
.link-icon.official-website svg {
  fill: none;
}

.link-icon-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.menu-name {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  font-weight: 800;
}

.menu-price {
  color: var(--tomato);
  white-space: nowrap;
}

.menu-description,
.snippet {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.link-domain {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

a {
  color: var(--sage);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.source-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.9rem;
}

.quick-actions {
  display: flex;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
}

.quick-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(47, 107, 79, 0.28);
  border-radius: 999px;
  background: white;
  color: var(--sage);
  cursor: pointer;
  font-weight: 800;
}

.quick-actions button:hover {
  background: var(--sage-soft);
}

.composer {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 10px;
  padding: 0 24px 24px;
}

.composer input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: white;
  color: var(--ink);
}

.composer input:focus {
  outline: 3px solid rgba(245, 199, 93, 0.48);
  border-color: var(--gold);
}

.composer button {
  min-width: 52px;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--tomato);
  color: white;
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 900;
}

.composer button:hover {
  filter: brightness(0.96);
}

.hidden {
  display: none;
}

@media (max-width: 680px) {
  body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
  }

  .chat-panel {
    min-height: 100vh;
    height: 100vh;
    min-height: 100dvh;
    height: 100dvh;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    border: 0;
    border-radius: 0;
  }

  .quick-actions {
    grid-row: 2;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }

  .messages {
    grid-row: 3;
  }

  .composer {
    grid-row: 4;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .topbar,
  .messages,
  .quick-actions,
  .composer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .message {
    max-width: 94%;
  }

  .truck-card {
    grid-template-columns: 1fr;
  }

  .truck-more-section summary {
    max-width: 100%;
  }
}
