.hidden {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, -apple-system, sans-serif;
  background: #f7f3ef;
  color: #2c2419;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 16px 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  align-items: start;
  min-height: 100vh;
}

.nav-sidebar {
  position: sticky;
  top: 12px;
  background: #fffefc;
  border: 1px solid #e8dfd4;
  border-radius: 12px;
  padding: 16px 14px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 1px 3px rgba(44, 36, 25, 0.06);
}

.lang-selector {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee8e0;
}

.lang-selector label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b7355;
  margin-bottom: 4px;
}

.lang-selector select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e8dfd4;
  border-radius: 6px;
  background: #fff;
  color: #2c2419;
  font-size: 13px;
}

.nav-sidebar-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b7355;
}

.auth-box {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee8e0;
}

.btn-google {
  width: 100%;
  border: 1px solid #c4a574;
  background: #b8956b;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 8px;
  min-height: 44px;
  transition: background 0.2s;
}

.btn-google:hover:not(:disabled) {
  background: #a6845a;
}

.btn-google:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-signout {
  width: 100%;
  border: 1px solid #e8dfd4;
  background: #fff;
  color: #8b4513;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 8px;
}

.auth-user-label {
  font-size: 12px;
  color: #5a4a3a;
  font-weight: 600;
  margin: 0 0 6px;
  word-break: break-word;
}

.auth-hint {
  font-size: 11px;
  color: #7a6f62;
  line-height: 1.4;
  margin: 0;
}

.side-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.side-tab {
  flex: 1;
  border: 1px solid #e8dfd4;
  background: #f7f3ef;
  color: #5a4a3a;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.side-tab.active {
  background: #5a6d4c;
  color: #fff;
  border-color: #5a6d4c;
}

.side-panel {
  font-size: 12px;
}

.panel-heading {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b7355;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-list li.history-item {
  padding: 10px 0;
  border-bottom: 1px solid #eee8e0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.history-list li.history-item:last-child {
  border-bottom: none;
}

.history-item-content {
  flex: 1;
  min-width: 0;
}

.history-item-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: #f5e6e0;
  color: #a0524a;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
}

.history-item-remove:hover {
  background: #e8d4ce;
}

.btn-profile, .btn-secondary, .btn-ghost {
  width: 100%;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 6px;
  font-weight: 600;
}

.btn-profile {
  background: #f0ebe3;
  border: 1px solid #e8dfd4;
  color: #5a4a3a;
}

.btn-profile:hover {
  background: #e8dfd4;
}

.btn-secondary {
  background: #f0ebe3;
  border: 1px solid #e8dfd4;
  color: #5a4a3a;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: #7a6f62;
}

.live-session-box {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee8e0;
}

.join-session-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: stretch;
}

.join-session-row input {
  flex: 1;
  min-width: 120px;
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 8px;
  border: 1px solid #e8dfd4;
}

.join-session-row .btn-secondary {
  padding: 14px 20px;
  font-size: 16px;
}

.live-session-code-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee8e0;
}

.live-session-code-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #7a6f62;
  margin-bottom: 6px;
}

.live-session-code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.live-session-code-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  font-size: 20px;
  font-weight: 700;
  color: #5a6d4c;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 2px solid #5a6d4c;
  border-radius: 8px;
  background: #f8faf6;
  font-family: monospace;
}

.btn-copy-code {
  flex-shrink: 0;
  width: 52px;
  padding: 0;
  font-size: 20px;
  border: 1px solid #e8dfd4;
  background: #f0ebe3;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-copy-code:hover {
  background: #e8dfd4;
}

.live-session-lobby {
  margin-top: 10px;
  padding: 10px 0;
  border-top: 1px solid #eee8e0;
}

.lobby-members-label {
  font-size: 12px;
  font-weight: 600;
  color: #7a6f62;
  margin: 0 0 6px;
}

.lobby-members-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

.lobby-members-list li {
  padding: 4px 0;
  color: #5a4a3a;
}

.lobby-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.lobby-modal-actions .btn-primary,
.lobby-modal-actions .btn-ghost {
  flex: 1;
}

#lobby-name-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #e8dfd4;
  margin-top: 8px;
  box-sizing: border-box;
}

.vote-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.vote-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #e8f0e4;
  color: #5a6d4c;
  border-radius: 6px;
  font-size: 12px;
}

.vote-badge .match-pct {
  font-weight: 700;
}

.controls-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.location-field-wrap {
  flex: 1;
  min-width: 0;
}

.range-row {
  margin-top: 10px;
}

.range-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #7a6f62;
}

.range-row select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e8dfd4;
  background: #fff;
  color: #2c2419;
  font-size: 14px;
}

.btn-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid #e8dfd4;
  background: #f0ebe3;
  color: #5a4a3a;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.15s;
}

.btn-icon:hover {
  background: #e8dfd4;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: #fffefc;
  border: 1px solid #e8dfd4;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(44, 36, 25, 0.12);
}

.modal-content h3 {
  margin: 0 0 8px;
  font-family: "Lora", serif;
  color: #2c2419;
}

.modal-desc {
  font-size: 13px;
  color: #7a6f62;
  margin: 0 0 16px;
}

.prefs-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 16px;
}

.prefs-grid label {
  font-size: 13px;
  color: #5a4a3a;
}

.prefs-grid input {
  background: #fff;
  border: 1px solid #e8dfd4;
  color: #2c2419;
}

.btn-primary {
  background: #5a6d4c;
  border: none;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 8px;
}

.btn-primary:hover {
  background: #4a5d3c;
}

.btn-vote {
  width: 100%;
  border: 1px solid #5a6d4c;
  background: #f0ebe3;
  color: #5a6d4c;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 6px;
}

.btn-vote:hover {
  background: #e8dfd4;
}

.bubble-speak {
  margin-left: 8px;
  padding: 4px 8px;
  border: none;
  background: #f0ebe3;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  vertical-align: middle;
  opacity: 0.9;
}

.bubble-speak:hover {
  opacity: 1;
  background: #e8dfd4;
}

.btn-mic {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid #e8dfd4;
  background: #f0ebe3;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.15s;
}

.btn-mic.recording {
  background: #f5e6e0;
  animation: pulse-mic 1s ease-in-out infinite;
}

@keyframes pulse-mic {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.dish-highlight {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #5a6d4c;
  padding: 6px 10px;
  background: #eef2ea;
  border-radius: 6px;
}

.history-list li {
  padding: 8px 0;
  border-bottom: 1px solid #eee8e0;
}

.history-list li:last-child {
  border-bottom: none;
}

.history-item-title {
  display: block;
  font-weight: 600;
  color: #2c2419;
  margin-bottom: 4px;
}

.history-item-meta {
  display: block;
  font-size: 11px;
  color: #7a6f62;
  line-height: 1.35;
  margin-bottom: 4px;
}

.history-item-date {
  display: block;
  font-size: 10px;
  color: #8b7f70;
}

.history-empty {
  font-size: 12px;
  color: #8b7f70;
  margin: 0;
  font-style: italic;
}

.app-main {
  min-width: 0;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}

.container--main {
  max-width: none;
  margin: 0;
  padding: 8px 0 48px;
}

h1 {
  margin-bottom: 6px;
  font-family: "Lora", serif;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  line-height: 1.25;
  color: #2c2419;
}

.subtitle {
  margin-top: 0;
  color: #7a6f62;
  font-size: 0.95rem;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.btn-reset {
  border: 1px solid #e8dfd4;
  background: #fff;
  color: #8b4513;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
}

.btn-reset:hover {
  background: #f0ebe3;
}

.local-time {
  margin: 0 0 12px;
  font-size: 13px;
  color: #7a6f62;
}

.main-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 340px);
  gap: 20px;
  align-items: start;
  margin-top: 8px;
}

.chat-column {
  min-width: 0;
}

.controls {
  margin: 0 0 14px;
}

.controls label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #5a4a3a;
}

.location-field {
  position: relative;
}

.location-autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 100;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  background: #fffefc;
  border: 1px solid #e8dfd4;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(44, 36, 25, 0.12);
  max-height: 240px;
  overflow-y: auto;
}

.location-autocomplete-item {
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
  color: #2c2419;
}

.location-autocomplete-item:hover,
.location-autocomplete-item:focus {
  background: #f0ebe3;
  outline: none;
}

input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e8dfd4;
  border-radius: 8px;
  padding: 12px 12px;
  font-size: 16px;
  background: #fff;
  color: #2c2419;
  /* 16px+ avoids iOS zoom-on-focus */
  line-height: 1.3;
}

input::placeholder {
  color: #8b7f70;
}

.chat {
  background: #fffefc;
  border: 1px solid #e8dfd4;
  border-radius: 10px;
  height: 360px;
  max-height: min(360px, 50vh);
  min-height: 200px;
  padding: 14px;
  margin-bottom: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 1px 3px rgba(44, 36, 25, 0.04);
}

.quick-replies {
  margin-bottom: 12px;
  padding: 12px;
  background: #f7f3ef;
  border: 1px solid #e8dfd4;
  border-radius: 8px;
}

.quick-replies-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #5a4a3a;
}

.quick-replies-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-reply-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
  color: #2c2419;
}

.quick-reply-row input {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
  min-width: 18px;
  min-height: 18px;
  accent-color: #5a6d4c;
}

.quick-replies-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-replies-btn {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
}

.quick-replies-btn.primary {
  border: none;
  background: #2563eb;
  color: white;
}

.quick-replies-btn.secondary {
  border: 1px solid #cbd5e1;
  background: white;
  color: #334155;
}

.quick-replies-btn.ghost {
  border: none;
  background: transparent;
  color: #64748b;
  text-decoration: underline;
  min-height: auto;
  padding: 8px 10px;
}

.bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 6px 0;
  line-height: 1.35;
}

.user {
  margin-left: auto;
  background: #5a6d4c;
  color: #fff;
}

.assistant {
  margin-right: auto;
  background: #f0ebe3;
  border: 1px solid #e8dfd4;
  color: #2c2419;
}

.chat-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.chat-form input#message {
  flex: 1 1 160px;
  min-width: 0;
}

.chat-form button[type="submit"] {
  border: none;
  background: #5a6d4c;
  color: white;
  border-radius: 8px;
  padding: 12px 18px;
  min-height: 44px;
  min-width: 72px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s;
}

.chat-form button[type="submit"]:hover {
  background: #4a5d3c;
}

/* Right panel + carousel */
.results-panel {
  background: #fffefc;
  border: 1px solid #e8dfd4;
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: 16px;
  box-shadow: 0 1px 3px rgba(44, 36, 25, 0.06);
}

.results-heading {
  margin: 0 0 4px;
  font-family: "Lora", serif;
  font-size: 1.15rem;
  color: #2c2419;
}

.carousel-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: #7a6f62;
}

.carousel-empty {
  font-size: 13px;
  color: #7a6f62;
  line-height: 1.5;
  padding: 12px 8px;
  text-align: center;
}

.carousel-ui.hidden {
  display: none;
}

.carousel-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.carousel-btn {
  flex: 0 0 40px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #374151;
  transition: background 0.15s;
  touch-action: manipulation;
}

.carousel-btn:hover {
  background: #e5e7eb;
}

.carousel-btn:focus-visible {
  outline: 2px solid #5a6d4c;
  outline-offset: 2px;
}

.carousel-viewport {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  /* Let horizontal swipes scroll the carousel instead of the page (mobile Safari / Chrome). */
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.carousel-track {
  display: flex;
  height: 100%;
}

.carousel-track .restaurant-card {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-sizing: border-box;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  padding: 14px;
  margin: -14px 0;
  box-sizing: content-box;
  background: #d1d5db;
  background-clip: content-box;
  cursor: pointer;
  touch-action: manipulation;
}

.carousel-dot[aria-current="true"] {
  background: #5a6d4c;
}

.restaurant-card {
  background: #fffefc;
  border: 1px solid #e8dfd4;
  border-radius: 10px;
  padding: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(44, 36, 25, 0.04);
}

.restaurant-card--selected {
  border-color: #5a6d4c;
  box-shadow: 0 0 0 2px rgba(90, 109, 76, 0.2);
  background: #f8faf5;
}

.restaurant-actions-row {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.restaurant-select-row {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.btn-save-restaurant {
  width: 100%;
  border: 1px solid #c4a574;
  background: #f8f5f0;
  color: #5a4a3a;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-save-restaurant:hover:not(:disabled) {
  background: #f0ebe3;
}

.btn-save-restaurant:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-select-restaurant {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #5a6d4c;
  color: #fff;
  touch-action: manipulation;
}

.btn-select-restaurant:hover:not(:disabled) {
  background: #4a5d3c;
}

.btn-select-restaurant:disabled {
  cursor: default;
  background: #b8c4b0;
  color: #fff;
}

.btn-select-restaurant--muted {
  background: #e8dfd4 !important;
  color: #7a6f62 !important;
  font-weight: 600;
}

body.chat-ended .chat-form input[disabled],
body.chat-ended .chat-form button[type="submit"][disabled] {
  opacity: 0.85;
}

.restaurant-photo {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #e5e7eb;
}

.inner-carousel-wrap {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 8px;
}

.inner-carousel-viewport {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.inner-carousel-viewport::-webkit-scrollbar {
  display: none;
}

.inner-carousel-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  height: 100%;
}

.inner-slide {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.inner-slide img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  background: #eee8e0;
  pointer-events: none;
}

.inner-carousel-btn {
  flex: 0 0 32px;
  min-width: 36px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #374151;
  touch-action: manipulation;
}

.hours-plain {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: #7a6f62;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-plain {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #5a4a3a;
}

.restaurant-card h3 {
  margin: 4px 0;
  font-family: "Lora", serif;
  font-size: 15px;
  line-height: 1.3;
  color: #2c2419;
}

.rank-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #5a6d4c;
  background: #eef2ea;
  border-radius: 6px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

.match-pct {
  display: inline-block;
  background: #eef2ea;
  color: #5a6d4c;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

.muted {
  color: #7a6f62;
  font-size: 12px;
}

.travel-estimate {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #5a6d4c;
}

@media (max-width: 900px) {
  /* Chat + results first; account sidebar last */
  .app-shell {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    gap: 12px;
    padding: 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    min-height: 100dvh;
  }

  .app-main {
    order: 1;
    width: 100%;
    min-width: 0;
  }

  .nav-sidebar {
    order: 2;
    position: static;
    max-height: 280px;
    overflow-y: auto;
    width: 100%;
  }

  .container--main {
    padding: 4px 0 32px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-reset {
    width: 100%;
    align-self: stretch;
  }

  .main-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .results-panel {
    position: static;
    order: 2;
    top: auto;
    margin-top: 8px;
  }

  .chat-column {
    order: 1;
  }

  .chat {
    height: min(280px, 45vh);
    max-height: min(360px, 50vh);
    min-height: 200px;
  }

  .carousel-viewport {
    min-height: min(300px, 50vh);
    scroll-snap-type: x mandatory;
  }

  .carousel-track .restaurant-card {
    flex: 0 0 100%;
    min-width: 100%;
  }

  .carousel-wrap {
    gap: 6px;
  }

  /* On mobile: show only first photo per restaurant to avoid list/stack layout issues */
  .inner-carousel-wrap .inner-prev,
  .inner-carousel-wrap .inner-next {
    display: none;
  }

  .inner-carousel-viewport {
    overflow: hidden;
  }

  .inner-carousel-track .inner-slide:not(:first-child) {
    display: none;
  }

  .inner-slide img {
    height: 180px;
    min-height: 160px;
  }

  .location-autocomplete {
    max-height: min(200px, 35vh);
  }

  .bubble {
    max-width: 92%;
    font-size: 15px;
  }

  .controls-row {
    flex-wrap: wrap;
  }

  .btn-icon {
    width: 100%;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .inner-carousel-wrap .inner-prev,
  .inner-carousel-wrap .inner-next {
    display: flex;
  }

  .inner-carousel-viewport {
    overflow-x: auto;
  }

  .inner-carousel-track .inner-slide:not(:first-child) {
    display: flex;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 12px 10px 24px;
  }

  .container--main {
    padding: 0 0 20px;
  }

  h1 {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .subtitle {
    font-size: 13px;
    line-height: 1.4;
  }

  .chat-form {
    flex-direction: row;
    gap: 8px;
    align-items: center;
  }

  .chat-form input#message {
    flex: 1 1 0;
    min-width: 0;
  }

  .chat-form button[type="submit"] {
    flex-shrink: 0;
    min-width: 64px;
  }

  .btn-mic {
    flex-shrink: 0;
  }

  .quick-replies {
    padding: 10px;
  }

  .quick-replies-actions {
    flex-direction: row;
  }

  .btn-save-restaurant,
  .btn-select-restaurant,
  .btn-vote {
    min-height: 48px;
    font-size: 15px;
  }

  .carousel-btn {
    min-width: 48px;
    min-height: 48px;
  }

  .restaurant-card {
    padding: 12px;
  }

  .inner-slide img {
    height: 200px;
  }

  .join-session-row {
    flex-direction: column;
  }

  .live-session-box .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 10px;
  }

  .nav-sidebar {
    max-height: 240px;
  }
}
