:root {
  --bg-main: #0d1117;
  --bg-card: #161b22;
  --bg-card-elevated: #1f242d;
  --border-color: #30363d;
  --zomato-red: #E23744;
  --zomato-red-hover: #ff4554;
  --zomato-gold: #f59e0b;
  --success-green: #10b981;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
}

body.dark-theme {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Nav */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-box {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.zomato-z {
  font-size: 28px;
  font-weight: 800;
  color: var(--zomato-red);
  letter-spacing: -0.5px;
  text-transform: lowercase;
}

.voice-badge {
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--zomato-red), #ff758c);
  color: white;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.mcp-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
}

.toggle-control input {
  display: none;
}

.slider {
  width: 38px;
  height: 20px;
  background-color: #30363d;
  border-radius: 20px;
  position: relative;
  transition: 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-control input:checked + .slider {
  background-color: var(--zomato-red);
}

.toggle-control input:checked + .slider::before {
  transform: translateX(18px);
}

.btn-secondary {
  background: #21262d;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}

.btn-secondary:hover {
  background: #30363d;
  color: var(--text-main);
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 20px;
  flex: 1;
}

/* Voice Console Column */
.voice-console-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Voice Orb */
.voice-orb-wrapper {
  background: radial-gradient(circle at center, #1b222d 0%, #12161f 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.voice-orb-glow {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 55, 68, 0.25) 0%, transparent 70%);
  filter: blur(25px);
  pointer-events: none;
  transition: all 0.5s ease;
}

.voice-orb {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E23744, #b21f2d);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(226, 55, 68, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 2;
}

.voice-orb:hover {
  transform: scale(1.06);
}

.orb-inner {
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-inner i {
  width: 36px;
  height: 36px;
}

/* Orb Active State (Listening) */
.voice-orb.listening {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.6);
  animation: orbPulse 1.5s infinite;
}

/* Orb Speaking State */
.voice-orb.speaking {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.6);
  animation: orbSpeaking 1.2s infinite;
}

@keyframes orbPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes orbSpeaking {
  0%, 100% { transform: scale(1.02); }
  50% { transform: scale(1.1); }
}

/* Concentric Rings */
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(226, 55, 68, 0.3);
  pointer-events: none;
  opacity: 0;
}

.voice-orb.listening .ring-1 {
  width: 120px;
  height: 120px;
  animation: ringExpand 2s infinite ease-out;
}
.voice-orb.listening .ring-2 {
  width: 150px;
  height: 150px;
  animation: ringExpand 2s infinite ease-out 0.4s;
}
.voice-orb.listening .ring-3 {
  width: 180px;
  height: 180px;
  animation: ringExpand 2s infinite ease-out 0.8s;
}

@keyframes ringExpand {
  0% { transform: scale(0.6); opacity: 0.8; border-color: #10b981; }
  100% { transform: scale(1.3); opacity: 0; border-color: #10b981; }
}

.voice-status-text {
  margin-top: 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  z-index: 2;
}

/* Waveform */
.waveform-bars {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  margin-top: 12px;
}

.bar {
  width: 4px;
  height: 6px;
  background-color: #30363d;
  border-radius: 4px;
  transition: height 0.15s ease;
}

.waveform-bars.active .bar {
  background-color: var(--zomato-red);
  animation: waveAnim 1s infinite ease-in-out;
}

.waveform-bars.active .bar:nth-child(2) { animation-delay: 0.1s; }
.waveform-bars.active .bar:nth-child(3) { animation-delay: 0.2s; }
.waveform-bars.active .bar:nth-child(4) { animation-delay: 0.3s; }
.waveform-bars.active .bar:nth-child(5) { animation-delay: 0.4s; }
.waveform-bars.active .bar:nth-child(6) { animation-delay: 0.5s; }
.waveform-bars.active .bar:nth-child(7) { animation-delay: 0.3s; }
.waveform-bars.active .bar:nth-child(8) { animation-delay: 0.2s; }
.waveform-bars.active .bar:nth-child(9) { animation-delay: 0.1s; }

@keyframes waveAnim {
  0%, 100% { height: 6px; }
  50% { height: 22px; }
}

/* Suggestion Chips */
.suggestion-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chips-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--zomato-red);
  background: rgba(226, 55, 68, 0.1);
  color: #ff758c;
}

/* Clarification Banner */
.alert-clarification {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.alert-clarification.hidden {
  display: none;
}

.alert-icon {
  color: #f59e0b;
  margin-top: 2px;
}

.alert-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 4px;
}

.alert-content p {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 10px;
}

.quick-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-opt-btn {
  background: #252b36;
  border: 1px solid #f59e0b;
  color: white;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.quick-opt-btn:hover {
  background: #f59e0b;
  color: black;
}

/* Transcript */
.transcript-container {
  flex: 1;
  min-height: 280px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message-bubble {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.message-bubble.user-bubble {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #252d3a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.user-bubble .avatar {
  background: var(--zomato-red);
  color: white;
}

.bubble-content {
  background: #1f2530;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-main);
  position: relative;
}

.user-bubble .bubble-content {
  background: #293241;
  border-top-right-radius: 4px;
}

.bot-bubble .bubble-content {
  border-top-left-radius: 4px;
}

.replay-audio-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 6px;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
}

.replay-audio-btn:hover {
  color: var(--zomato-red);
}

/* Input Bar */
.input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
}

.mic-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--zomato-red);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.mic-button:hover {
  background: var(--zomato-red-hover);
  transform: scale(1.05);
}

.mic-button.recording {
  background: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.7);
  animation: pulseDot 1.5s infinite;
}

.input-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 14px;
}

.input-bar input::placeholder {
  color: var(--text-dim);
}

.send-button {
  background: #21262d;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}

.send-button:hover {
  background: var(--zomato-red);
  border-color: var(--zomato-red);
}

/* Sidebar Column */
.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
}

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

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.badge {
  background: #21262d;
  border: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--text-muted);
}

.restaurant-info {
  background: #1d232e;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.restaurant-info.hidden {
  display: none;
}

.rest-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
}

.rest-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rest-meta .rating {
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
}

/* Empty Cart */
.empty-cart {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-dim);
}

.empty-cart i {
  width: 42px;
  height: 42px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.empty-cart p {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.empty-cart span {
  font-size: 12px;
  display: block;
  margin-top: 4px;
}

.empty-cart.hidden {
  display: none;
}

/* Cart Items */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.cart-items-list.hidden {
  display: none;
}

.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1c222b;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.veg-icon {
  width: 14px;
  height: 14px;
  border: 1.5px solid #10b981;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.veg-icon::after {
  content: "";
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

.non-veg-icon {
  width: 14px;
  height: 14px;
  border: 1.5px solid #ef4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.non-veg-icon::after {
  content: "";
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
}

.item-qty {
  font-weight: 700;
  color: var(--zomato-red);
}

.item-name {
  color: var(--text-main);
  font-weight: 500;
}

.item-price {
  font-weight: 600;
  color: var(--text-main);
}

/* Best Offer Box */
.best-offer-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  border: 1px dashed #10b981;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.best-offer-box.hidden {
  display: none;
}

.offer-badge {
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 4px;
}

.offer-code {
  font-weight: 800;
  font-size: 13px;
  color: white;
  background: #065f46;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

.offer-saved {
  font-size: 12px;
  color: #34d399;
  font-weight: 600;
}

/* Bill Details */
.bill-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.bill-details.hidden {
  display: none;
}

.bill-row {
  display: flex;
  justify-content: space-between;
}

.discount-row {
  color: #34d399;
  font-weight: 600;
}

.bill-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}

.total-row {
  color: var(--text-main);
  font-size: 15px;
  font-weight: 700;
  align-items: baseline;
}

.total-label small {
  display: block;
  font-size: 11px;
  color: #34d399;
  font-weight: 500;
}

.total-amount {
  font-size: 20px;
  color: var(--zomato-red);
  font-weight: 800;
}

/* Confirmation Banner */
.confirmation-banner {
  background: rgba(226, 55, 68, 0.12);
  border: 1px solid var(--zomato-red);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.confirmation-banner.hidden {
  display: none;
}

.confirm-pulse {
  width: 12px;
  height: 12px;
  background-color: var(--zomato-red);
  border-radius: 50%;
  animation: pulseDot 1.5s infinite;
  flex-shrink: 0;
}

.confirm-text strong {
  color: #ff758c;
  font-size: 13px;
  display: block;
}

.confirm-text p {
  font-size: 12px;
  color: var(--text-main);
}

.confirm-text .highlight {
  color: #34d399;
  font-weight: 700;
}

/* MCP Tool Inspector */
.mcp-card {
  max-height: 250px;
  display: flex;
  flex-direction: column;
}

.mcp-live-tag {
  background: #232a37;
  color: #60a5fa;
  font-size: 11px;
  font-family: monospace;
  padding: 2px 6px;
  border-radius: 4px;
}

.mcp-logs-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: monospace;
  font-size: 11.5px;
}

.mcp-empty-log {
  color: var(--text-dim);
  font-style: italic;
  padding: 10px 0;
}

.mcp-log-item {
  background: #11151c;
  border: 1px solid #28303e;
  border-radius: 6px;
  padding: 8px 10px;
}

.mcp-log-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.mcp-tool-name {
  color: #f472b6;
  font-weight: 700;
}

.mcp-tool-status {
  color: #34d399;
  font-weight: 600;
}

.mcp-log-args {
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 440px;
  padding: 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.success-icon i {
  width: 36px;
  height: 36px;
}

.modal-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: white;
  margin-bottom: 6px;
}

.order-id-tag {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.order-id-tag strong {
  color: #34d399;
  letter-spacing: 0.5px;
}

.order-summary {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 20px;
}

.qr-box {
  background: white;
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-mock {
  width: 140px;
  height: 140px;
  background: repeating-linear-gradient(0deg, #111, #111 5px, #fff 5px, #fff 10px),
              repeating-linear-gradient(90deg, #111, #111 5px, #fff 5px, #fff 10px);
  background-blend-mode: difference;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.qr-center-logo {
  background: var(--zomato-red);
  color: white;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
}

.qr-caption {
  font-size: 12px;
  color: #1f242d;
  font-weight: 600;
  margin-top: 8px;
}

.btn-primary {
  background: var(--zomato-red);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  transition: 0.2s;
}

.btn-primary:hover {
  background: var(--zomato-red-hover);
}

/* Connect Real Zomato Button */
.btn-connect-real {
  background: #1e293b;
  border: 1px solid #3b82f6;
  color: #60a5fa;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}

.btn-connect-real:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* Address Selector Styling */
.address-selector-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1c222b;
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  margin-left: 12px;
}

.pin-icon {
  width: 15px;
  height: 15px;
  color: var(--zomato-red);
}

.addr-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.address-dropdown {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  max-width: 250px;
}

.address-dropdown option {
  background: #161b22;
  color: var(--text-main);
}

/* Production DB Sync & Navigation Badges */
.db-sync-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.db-sync-badge i {
  width: 13px;
  height: 13px;
}

.order-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  margin: 16px 0;
  padding-right: 4px;
}

.order-card-row {
  background: #161b22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-card-rest {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-main);
}

.order-card-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-completed, .status-delivered {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.order-card-items {
  font-size: 13px;
  color: var(--text-muted);
}

.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  margin-top: 4px;
}

.order-card-total {
  font-weight: 700;
  color: var(--text-main);
}

.order-card-actions {
  display: flex;
  gap: 8px;
}

.btn-small-pay {
  background: var(--zomato-red);
  color: white;
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-small-reorder {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-small-reorder:hover {
  background: #30363d;
}

.memory-pref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: left;
  margin: 16px 0;
}

.pref-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pref-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.pref-field select, .pref-field input {
  background: #161b22;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}


/* ==========================================================================
   Conversation & layout refinements
   ========================================================================== */

/* --- Quick replies -------------------------------------------------------- */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.suggestion-chips .chip {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: var(--font-family);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.suggestion-chips .chip:hover {
  background: rgba(226, 55, 68, .12);
  border-color: var(--zomato-red);
  color: var(--text-main);
  transform: translateY(-1px);
}

/* --- Typing indicator ----------------------------------------------------- */
.typing-dots {
  display: flex;
  gap: 5px;
  padding: 6px 2px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* --- Message content ------------------------------------------------------ */
.bubble-time {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .02em;
}

.msg-bullet {
  display: block;
  padding-left: 14px;
  position: relative;
  margin: 3px 0;
}

.msg-bullet::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--zomato-red);
}

.msg-amount {
  font-weight: 700;
  color: var(--zomato-gold);
}

.msg-link {
  color: #60a5fa;
  text-decoration: underline;
  font-weight: 500;
  word-break: break-all;
}

/* --- Busy state ----------------------------------------------------------- */
body.is-busy .mic-button,
body.is-busy .send-button {
  opacity: .5;
  cursor: not-allowed;
}

#textInput:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* --- Toasts --------------------------------------------------------------- */
.toast-host {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}

.toast {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--text-dim);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  animation: toast-in .2s ease-out;
}

.toast-error { border-left-color: var(--zomato-red); }
.toast-success { border-left-color: var(--success-green); }
.toast-out { opacity: 0; transition: opacity .4s ease; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Clarification quick options ------------------------------------------ */
.quick-opt-muted {
  border-color: var(--text-dim) !important;
  color: var(--text-muted);
}

/* --- Mobile cart drawer trigger ------------------------------------------- */
.cart-toggle {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 900;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--zomato-red);
  border: none;
  color: #fff;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(226, 55, 68, .45);
  cursor: pointer;
}

.cart-toggle-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bg-main);
  border: 2px solid var(--zomato-red);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 950;
}

/* --- Accessibility -------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--zomato-red);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ==========================================================================
   Responsive: the layout was desktop-only
   ========================================================================== */

/* Tablet: sidebar becomes a slide-in drawer. */
@media (max-width: 980px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .cart-toggle {
    display: flex;
  }

  .sidebar-column {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, 88vw);
    z-index: 960;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-main);
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    transition: transform .25s ease;
  }

  .sidebar-column.drawer-open {
    transform: translateX(0);
  }

  .top-nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .db-sync-badge {
    display: none;
  }
}

/* Phone: trim chrome, shrink the orb, keep the conversation the focus. */
@media (max-width: 640px) {
  .app-container {
    padding: 10px;
  }

  .top-nav {
    padding: 10px 12px;
  }

  .brand {
    flex-wrap: wrap;
    gap: 8px;
  }

  .address-selector-box {
    width: 100%;
  }

  .address-dropdown {
    max-width: 100%;
  }

  .header-actions .btn-secondary span,
  .btn-connect-real span {
    display: none;
  }

  .speech-controls .label-text {
    display: none;
  }

  .voice-orb-wrapper {
    padding: 10px 0;
  }

  .voice-orb {
    width: 96px;
    height: 96px;
  }

  .ring-1, .ring-2, .ring-3 {
    display: none;
  }

  .transcript-container {
    max-height: none;
  }

  .message-bubble {
    max-width: 100%;
  }

  .suggestion-chips .chip {
    font-size: 12px;
    padding: 6px 11px;
  }

  .modal-card {
    max-width: calc(100vw - 24px) !important;
    padding: 18px;
  }

  .memory-pref-grid {
    grid-template-columns: 1fr;
  }

  .memory-pref-grid .pref-field {
    grid-column: span 1 !important;
  }

  .input-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg-main);
    padding-bottom: 8px;
  }

  .cart-toggle {
    bottom: 78px;
    right: 14px;
  }
}

/* The stylesheet only ever defined `.hidden` scoped to specific components, so
   newer elements toggling the same class stayed visible. */
.hidden {
  display: none !important;
}

/* Header chips were wrapping onto three lines at desktop widths. */
.mcp-badge,
.db-sync-badge,
.btn-secondary,
.btn-connect-real,
.toggle-control .label-text {
  white-space: nowrap;
}

.top-nav .header-actions {
  align-items: center;
}

/* With nowrap on the items themselves, the rows have to be the thing that
   wraps - otherwise the trailing controls overflow past the header edge. */
.top-nav {
  flex-wrap: wrap;
  gap: 12px 16px;
}

.top-nav .brand,
.top-nav .header-actions {
  flex-wrap: wrap;
  gap: 10px 12px;
  min-width: 0;
}

.address-dropdown {
  max-width: 220px;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle-control .label-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

/* ==========================================================================
   Manual cart controls, COD checkout, live tracking
   ========================================================================== */

.item-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.qty-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.qty-btn:hover {
  background: rgba(226, 55, 68, .15);
  color: var(--zomato-red);
}

.qty-value {
  min-width: 18px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.item-remove {
  border: none;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  display: flex;
}

.item-remove:hover { color: var(--zomato-red); }
.item-remove i { width: 14px; height: 14px; }

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.btn-place-order {
  flex: 1 1 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--zomato-red);
  background: var(--zomato-red);
  color: #fff;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-place-order:hover { background: var(--zomato-red-hover); }
.btn-place-order i { width: 15px; height: 15px; }

.btn-cod {
  background: transparent;
  color: var(--success-green);
  border-color: var(--success-green);
}

.btn-cod:hover { background: rgba(16, 185, 129, .14); }

/* --- Tracking card -------------------------------------------------------- */
.track-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.track-pay-tag {
  background: rgba(16, 185, 129, .15);
  border: 1px solid var(--success-green);
  color: var(--success-green);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
}

.track-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.track-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 14px;
  position: relative;
}

.track-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.track-step.done:not(:last-child)::before { background: var(--success-green); }

.track-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  flex-shrink: 0;
  margin-top: 2px;
  z-index: 1;
}

.track-step.done .track-dot {
  background: var(--success-green);
  border-color: var(--success-green);
}

.track-step.active .track-dot {
  background: var(--zomato-red);
  border-color: var(--zomato-red);
  animation: track-pulse 1.6s infinite;
}

@keyframes track-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 55, 68, .5); }
  50%      { box-shadow: 0 0 0 6px rgba(226, 55, 68, 0); }
}

.track-label {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.3;
}

.track-step.done .track-label { color: var(--text-muted); }

.track-step.active .track-label {
  color: var(--text-main);
  font-weight: 700;
}

.track-status {
  font-size: 12px;
  color: var(--zomato-gold);
  font-weight: 600;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}
