:root {
  --bg: #f6f1e8;
  --ink: #1c1916;
  --muted: #6b6258;
  --card: #fffdf8;
  --line: #e4d8c8;
  --swiggy: #fc8019;
  --zomato: #cb202d;
  --ok: #2f7d4a;
  --warn: #9a6b12;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  background: radial-gradient(circle at top, #fff7ea, var(--bg));
  color: var(--ink);
}

.shell {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1.1rem 3rem;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

h1,
h2 {
  margin: 0.15rem 0 0;
  font-weight: 650;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
}

.lead,
.note,
p {
  color: var(--muted);
  line-height: 1.45;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.badge {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
}

.badge.on {
  border-color: var(--ok);
  color: var(--ok);
}

.badge.warn {
  border-color: var(--warn);
  color: var(--warn);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.btn.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  background: #efe6d8;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
}

.panel,
.transcript,
.composer,
.banner {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.panel {
  padding: 1rem;
}

.panel label {
  display: block;
  margin: 0.7rem 0;
  color: var(--ink);
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  font: inherit;
  background: #fff;
}

.transcript {
  min-height: 18rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.bubble {
  max-width: 90%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.9rem;
  white-space: pre-wrap;
}

.bubble.user {
  align-self: flex-end;
  background: #1c1916;
  color: #fff;
}

.bubble.assistant {
  align-self: flex-start;
  background: #f3ece1;
}

.bubble.waiting {
  white-space: normal;
  color: var(--muted);
  animation: waiting-bubble 1.6s ease-in-out infinite;
}

.waiting-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.waiting-label {
  font-size: 0.95rem;
}

.waiting-dots span {
  display: inline-block;
  width: 0.38rem;
  height: 0.38rem;
  margin: 0 0.07rem;
  border-radius: 999px;
  background: var(--swiggy);
  animation: waiting-pulse 1.1s ease-in-out infinite;
}

.waiting-dots span:nth-child(2) {
  animation-delay: 0.15s;
  background: var(--ink);
  opacity: 0.55;
}

.waiting-dots span:nth-child(3) {
  animation-delay: 0.3s;
  background: var(--zomato);
}

@keyframes waiting-pulse {
  0%,
  80%,
  100% {
    transform: scale(0.7);
    opacity: 0.35;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes waiting-bubble {
  0%,
  100% {
    background: #f3ece1;
  }
  50% {
    background: #efe4d4;
  }
}

.bubble.error {
  border: 1px solid #e4d0a8;
}

.composer.busy textarea {
  opacity: 0.72;
}

.composer.busy .btn[type="submit"] {
  opacity: 0.7;
}

.timing {
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: normal;
}

.timing summary {
  cursor: pointer;
  list-style: none;
}

.timing summary::-webkit-details-marker {
  display: none;
}

.timing ul {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
}

.timing li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.8rem;
}

.timing-steps {
  flex-basis: 100%;
  margin: 0.15rem 0 0.25rem;
  padding-left: 0.9rem;
  opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
  .bubble.waiting,
  .waiting-dots span {
    animation: none;
  }
}

.timing summary::before {
  content: "▸ ";
}

.timing[open] summary::before {
  content: "▾ ";
}

.composer {
  margin-top: 0.8rem;
  padding: 0.7rem;
  display: grid;
  gap: 0.6rem;
}

.banner {
  padding: 0.7rem 0.9rem;
  border-color: var(--swiggy);
  color: var(--ink);
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 640px) {
  .top {
    flex-direction: column;
  }

  .badges {
    justify-content: flex-start;
  }
}

.checkout {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
}

.checkout-summary {
  white-space: pre-wrap;
  color: var(--ink);
  margin: 0.4rem 0;
}

.checkout-total {
  font-weight: 650;
  color: var(--ink);
  margin: 0.25rem 0 0.75rem;
}

.btn.danger {
  background: var(--zomato);
  border-color: var(--zomato);
  color: #fff;
}

.btn.danger:disabled {
  opacity: 0.55;
}

.sep {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1rem 0;
}

.bubble-img {
  display: block;
  max-width: min(100%, 16rem);
  max-height: 12rem;
  width: auto;
  height: auto;
  object-fit: cover;
  border-radius: 0.75rem;
  margin: 0.45rem 0;
  background: #efe6d8;
}

.bubble strong {
  font-weight: 650;
}


.bubble-h {
  margin: 0.55rem 0 0.25rem;
  font-size: 1.02rem;
}
.bubble-list {
  margin: 0.35rem 0 0.55rem 1.1rem;
  padding: 0;
}
.bubble-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.75rem 0;
}
.dish-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.dish-card {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  overflow: hidden;
  background: #fffdf8;
}
.dish-card-img {
  width: 7.5rem;
  height: 7.5rem;
  object-fit: cover;
  background: #efe6d8;
}
.dish-card-body {
  padding: 0.65rem 0.7rem 0.7rem 0;
}
.dish-card-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.dish-card-meta {
  margin: 0.15rem 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}
.dish-card-meta span {
  display: inline-block;
  min-width: 5.2rem;
  color: var(--ink);
  font-weight: 650;
  text-transform: capitalize;
}
@media (max-width: 520px) {
  .dish-card {
    grid-template-columns: 1fr;
  }
  .dish-card-img {
    width: 100%;
    height: 10rem;
  }
  .dish-card-body {
    padding: 0.7rem;
  }
}


.badge.spend {
  font-variant-numeric: tabular-nums;
}

.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

@media (max-width: 560px) {
  .price-grid {
    grid-template-columns: 1fr;
  }
}

.rate-row {
  margin: 0.15rem 0 0.7rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.rate-row .chip {
  margin-right: 0.25rem;
}

details.advanced {
  margin: 0.4rem 0 0.8rem;
  border: 1px dashed var(--line);
  border-radius: 0.8rem;
  padding: 0.45rem 0.7rem;
}

details.advanced summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--muted);
}

.address-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: stretch;
  margin: 0.85rem 0 0.7rem;
}

.addr-row {
  flex: 1 1 14rem;
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.55rem 0.7rem;
  min-width: 0;
}

.addr-copy {
  min-width: 0;
}

.addr-copy strong {
  display: block;
  color: var(--ink);
  font-size: 0.86rem;
}

.addr-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Structured food cards v6 — dense horizontal */
.card-grid {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.7rem;
}

.food-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(60, 40, 10, 0.05);
  min-height: 112px;
}

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

.card-gallery {
  background: #efe6d8;
  width: 112px;
  height: 112px;
  position: relative;
  overflow: hidden;
}

.card-gallery.empty {
  background:
    linear-gradient(135deg, #f3ebe0, #e7d8c4);
}

.card-gallery img,
.gallery-slide {
  width: 112px;
  height: 112px;
  object-fit: cover;
  display: block;
}

.card-gallery.multi .gallery-slide {
  display: none;
}

.card-gallery.multi .gallery-slide.active {
  display: block;
}

.gallery-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
  gap: 0.2rem;
}

.gallery-prev,
.gallery-next,
.gallery-dot {
  border: 0;
  background: rgba(28, 25, 22, 0.55);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
}

.gallery-prev,
.gallery-next {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.9rem;
  line-height: 1;
}

.gallery-dots {
  display: flex;
  gap: 0.18rem;
}

.gallery-dot {
  width: 0.35rem;
  height: 0.35rem;
  padding: 0;
  opacity: 0.55;
}

.gallery-dot.active {
  opacity: 1;
  background: #fff;
}

.card-body {
  padding: 0.5rem 0.7rem 0.55rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.card-top {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: space-between;
}

.card-top h3,
.card-body h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.25;
  color: var(--ink);
}

.card-price {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  flex: none;
}

.pill {
  flex: none;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #eee4d6;
  color: var(--muted);
}

.pill.swiggy {
  background: rgba(252, 128, 25, 0.15);
  color: #b85a00;
}

.pill.zomato {
  background: rgba(203, 32, 45, 0.12);
  color: #9a1520;
}

.card-rest {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.chip {
  font-size: 0.7rem;
  line-height: 1.2;
  background: #f3ece1;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
}

.card-offer {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  color: var(--ok);
  line-height: 1.3;
}

.card-offer span {
  display: block;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.62rem;
  color: var(--ok);
}

.card-desc {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 2.6em;
}

.compare-wrap {
  padding: 0.7rem 0.75rem 0.8rem;
  overflow-x: auto;
}

.compare-wrap h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.compare-table th {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.compare-table .to-pay {
  font-weight: 700;
}

.compare-note td {
  white-space: normal;
  color: var(--muted);
  font-size: 0.72rem;
}

@media (max-width: 560px) {
  .food-card:not(.compare) {
    grid-template-columns: 96px 1fr;
  }
  .card-gallery,
  .card-gallery img,
  .gallery-slide {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 400px) {
  .food-card:not(.compare) {
    grid-template-columns: 1fr;
  }
  .card-gallery {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .card-gallery img,
  .gallery-slide {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
  }
}


/* mobile-shell-fix */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.shell {
  width: 100%;
  max-width: min(42rem, 100%);
  padding-left: max(0.85rem, env(safe-area-inset-left));
  padding-right: max(0.85rem, env(safe-area-inset-right));
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.actions .btn,
.actions a.btn {
  flex: 1 1 auto;
  min-width: min(100%, 9.5rem);
  text-align: center;
  justify-content: center;
}

.panel,
.checkout,
.address-bar,
.transcript,
.composer,
.model-panel {
  width: 100%;
  max-width: 100%;
}

.composer textarea,
.panel input,
.panel select,
.panel textarea {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 640px) {
  .shell {
    padding-top: 1rem;
    padding-bottom: 2rem;
  }
  .actions .btn,
  .actions a.btn {
    min-width: calc(50% - 0.35rem);
  }
  .ui-card,
  .dish-card,
  .restaurant-card {
    width: 100%;
    max-width: 100%;
  }
}
