/* ═══════════════════════════════════════════════════════════════
   TinkySpeak — All Styles
   Extracted from index.html <style> block
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --f-sans: 'General Sans', system-ui, -apple-system, sans-serif;
  --surface-deep: #0d0b10;
  --amber: #e8a33d;
  --amber-light: #f4c97b;
  --green: #22c55e;
  --purple: #8b5cf6;
  --purple-soft: #a78bfa;
  --fk-verb: #f0862e;
  --fk-noun: #f2c624;
  --fk-adj: #3b82f6;
  --fk-social: #ec5fa0;
  --fk-question: #8b5cf6;
  --fk-negation: #ef4444;
  --fk-help: #22c55e;
  --fk-nav: #9ca3af;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html, body {
  height: 100%;
  font-family: var(--f-sans);
  background: var(--surface-deep);
  color: #fff;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  -webkit-font-smoothing: antialiased;
}

/* ═══ Single Column Layout ═══ */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ═══ Header ═══ */
.app-header {
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.app-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

/* ── Mode toggle: Stroke vs Rich ── */
.mode-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.06); border-radius: 20px; padding: 3px 4px;
}
.mode-toggle button {
  border: none; background: transparent; color: rgba(255,255,255,0.4);
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase; padding: 4px 6px; border-radius: 16px;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.mode-toggle button:hover { color: rgba(255,255,255,0.7); }
.mode-toggle button.active {
  background: rgba(232,163,61,0.25); color: #e8a33d;
}
.mode-divider {
  width: 1px; height: 16px; background: rgba(255,255,255,0.15); flex-shrink: 0;
}

.header-controls {
  display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.header-controls::-webkit-scrollbar { display: none; }
.header-actions {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0; white-space: nowrap;
}
.lang-arrow { margin: 0 -1px; }

.menu-toggle-btn {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.7rem; border-radius: 8px;
  border: 1px solid rgba(232,163,61,0.3);
  background: rgba(232,163,61,0.15);
  cursor: pointer; font-family: var(--f-sans);
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--amber); transition: all 0.25s;
}
.menu-toggle-btn:hover { background: rgba(232,163,61,0.25); }
.menu-toggle-btn svg { width: 14px; height: 14px; fill: currentColor; }

/* ═══ Transcript area ═══ */
/* ═══ Transcript Toggle ═══ */
.transcript-toggle {
  display: block; margin: 8px auto 0; padding: 4px 14px;
  background: none; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  color: rgba(255,255,255,0.3); font-family: var(--f-sans); font-size: 0.65rem;
  font-weight: 600; letter-spacing: 0.04em; cursor: pointer; transition: all 0.2s;
}
.transcript-toggle:hover { color: rgba(255,255,255,0.5); border-color: rgba(255,255,255,0.2); }
.transcript-toggle.open { color: var(--amber); border-color: rgba(232,163,61,0.3); }
.light-mode .transcript-toggle { color: rgba(0,0,0,0.3); border-color: rgba(0,0,0,0.1); }
.light-mode .transcript-toggle.open { color: #c17d1e; border-color: rgba(193,125,30,0.3); }

.transcript-area {
  flex-shrink: 0;
  max-height: 45vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: none; /* BUG-15: default hidden; JS toggles to flex when open */
  flex-direction: column;
  gap: 10px;
  padding: 0.75rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: bubbleIn 0.3s var(--ease-spring);
  margin: 0 0 8px 0;
}
.chat-bubble:last-child { margin-bottom: 0; }

/* Demo lockdown — disable every interactive control while demo plays,
   but leave scrolling intact so users can follow history. */
body.demo-running .demo-tile,
body.demo-running #micBtn,
body.demo-running #questionInput,
body.demo-running #clearBtn,
body.demo-running #submitBtn,
body.demo-running #transcriptToggle,
body.demo-running .mode-toggle,
body.demo-running .lang-select,
body.demo-running #sentenceBarUrl,
body.demo-running .ask-wrap,
body.demo-running .header-icon-btn {
  pointer-events: none !important;
  user-select: none !important;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.bubble-question {
  align-self: flex-start;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border-bottom-left-radius: 4px;
}
.bubble-response {
  align-self: flex-end;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}
.bubble-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}
.bubble-question .bubble-label { color: rgba(255,255,255,0.3); }
.bubble-response .bubble-label { color: rgba(255,255,255,0.6); }

/* ═══ Sentence Bar ═══ */
.sentence-bar-wrap {
  position: relative; width: 100%; margin-top: 25px;
}
.sentence-bar {
  min-height: 48px; padding: 0.6rem 1.2rem;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; width: 100%;
  font-size: 1.1rem; font-weight: 600; color: var(--amber-light);
  text-align: center; display: flex; align-items: center; justify-content: center;
}
.sentence-bar:empty { display: none; }
/* Legacy elements removed — hide if stale cached HTML still has them */
.url-row, .home-btn, .sentence-bar-url { display: none !important; }

/* ═══ Tile Grid ═══ */
.tablet-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; width: 100%;
  padding: 0.75rem 0 1rem; margin-top: 25px; margin-bottom: 15px;
}
.tablet-grid.grid-compact .demo-tile { aspect-ratio: auto; min-height: 130px; }
.tablet-grid.grid-compact .demo-tile-emoji { font-size: 44px; padding: 8px 0; flex: 1; }
.tablet-grid.grid-compact .demo-tile-label { font-size: 0.68rem; padding: 7px 5px; }

.demo-tile {
  aspect-ratio: 1; border-radius: 18px; display: flex; flex-direction: column; overflow: hidden;
  cursor: pointer; transition: transform 0.3s var(--ease-spring), opacity 0.25s ease;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.demo-tile:hover { transform: scale(1.06); }
.demo-tile:active { transform: scale(0.95); }
.demo-tile-emoji { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 80px; line-height: 1; }
.demo-tile-label {
  background: rgba(0,0,0,0.2); padding: 8px 5px; text-align: center;
  font-size: 0.78rem; font-weight: 800; color: #fff; text-transform: uppercase;
  letter-spacing: 0.05em; line-height: 1.1;
  word-wrap: break-word; overflow-wrap: break-word;
}

/* ── Rich mode: horizontal bars ── */
.tablet-grid.rich-mode {
  grid-template-columns: 1fr !important;
  gap: 8px;
}
.tablet-grid.rich-mode .demo-tile {
  aspect-ratio: auto; flex-direction: row; align-items: center;
  border-radius: 12px; min-height: 0; padding: 0;
}
.tablet-grid.rich-mode .demo-tile-emoji {
  font-size: 1.5rem; padding: 10px 14px; flex-shrink: 0;
}
.tablet-grid.rich-mode .demo-tile-label {
  font-size: 0.85rem; font-weight: 600; text-transform: none;
  letter-spacing: 0; line-height: 1.3; padding: 10px 14px 10px 0;
  text-align: left; background: none; flex: 1;
}

.tile-verb { background: var(--fk-verb); }
.tile-noun { background: var(--fk-noun); }
.tile-adj { background: var(--fk-adj); }
.tile-social { background: var(--fk-social); }
.tile-help { background: var(--fk-help); }
.tile-question { background: var(--fk-question); }
.tile-negation { background: var(--fk-negation); }
.tile-nav { background: var(--fk-nav); }

.tile-speak-flash { animation: tilePulse 0.3s ease; }
@keyframes tilePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
  50% { transform: scale(0.92); box-shadow: 0 0 0 6px rgba(255,255,255,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* AI loading shimmer */
.tablet-grid.ai-loading {
  animation: aiGridPulse 1.4s ease-in-out infinite;
}
@keyframes aiGridPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25); }
  50% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.65); }
}

/* ── Emergency panic tile pulse ── */
@keyframes panicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(211,47,47,0.4); }
  50% { box-shadow: 0 0 20px 6px rgba(211,47,47,0.6); }
}
.panic-tile { animation: panicPulse 2s ease infinite !important; }

/* ── Outline tile style ── */
.tablet-grid.outline-mode .demo-tile {
  background: rgba(255,255,255,0.04) !important;
  border: 3px solid currentColor;
}
.tablet-grid.outline-mode .demo-tile.tile-verb { border-color: var(--fk-verb); color: var(--fk-verb); }
.tablet-grid.outline-mode .demo-tile.tile-noun { border-color: var(--fk-noun); color: var(--fk-noun); }
.tablet-grid.outline-mode .demo-tile.tile-adj { border-color: var(--fk-adj); color: var(--fk-adj); }
.tablet-grid.outline-mode .demo-tile.tile-social { border-color: var(--fk-social); color: var(--fk-social); }
.tablet-grid.outline-mode .demo-tile.tile-help { border-color: var(--fk-help); color: var(--fk-help); }
.tablet-grid.outline-mode .demo-tile.tile-negation { border-color: var(--fk-negation); color: var(--fk-negation); }
.tablet-grid.outline-mode .demo-tile.tile-nav { border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.5); }
.tablet-grid.outline-mode .demo-tile-label {
  background: none; color: #fff;
}
.tablet-grid.outline-mode .demo-tile-emoji { filter: none; }

/* ── Light mode ── */
.light-mode { background: #f5f5f5 !important; color: #1a1a1a !important; }
.light-mode .app-header { border-bottom-color: #e0e0e0; }
.light-mode .app-title { color: #1a1a1a; }
.light-mode .mode-toggle { background: rgba(0,0,0,0.06); }
.light-mode .mode-toggle button { color: rgba(0,0,0,0.4); }
.light-mode .mode-toggle button.active { background: rgba(232,163,61,0.2); color: #b8860b; }
.light-mode .mode-divider { background: rgba(0,0,0,0.12); }
.light-mode .sentence-bar { background: #fff; border-color: #e0e0e0; color: #b8860b; }
.light-mode .sentence-bar:empty::after { color: rgba(0,0,0,0.25); }
.light-mode .hero-chat-hint { color: rgba(0,0,0,0.3); }
.light-mode .hero-chat-hint span { color: rgba(0,0,0,0.5); border-bottom-color: rgba(0,0,0,0.2); }
.light-mode .chat-bubble { background: #e8e8e8; color: #1a1a1a; }
.light-mode .bubble-response { background: #d4edff; }

/* Light outline tiles */
.light-mode .tablet-grid.outline-mode .demo-tile {
  background: #fff !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.light-mode .tablet-grid.outline-mode .demo-tile-label { color: #1a1a1a; }

/* Light filled tiles */
.light-mode .demo-tile { box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.light-mode .demo-tile-label { color: #fff; }

/* ═══ Input area ═══ */
.ask-wrap { width: 100%; display: flex; flex-direction: column; gap: 8px; padding-bottom: 1rem; flex-shrink: 0; }

/* ── Tap to Speak button ── */
.tap-to-speak-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 20px; margin-bottom: 5px;
  background: linear-gradient(135deg, #4A90D9, #2979D6);
  color: #fff; font-weight: 700; font-size: 0.95rem;
  border: none; border-radius: 28px; cursor: pointer;
  font-family: var(--f-sans); transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(41,121,214,0.3);
}
.tap-to-speak-btn:hover { background: linear-gradient(135deg, #5A9FE6, #3388E8); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(41,121,214,0.4); }
.tap-to-speak-btn:active { transform: translateY(0); }
.tap-to-speak-btn.listening {
  background: linear-gradient(135deg, #E53935, #D32F2F);
  box-shadow: 0 2px 8px rgba(229,57,53,0.4);
  animation: micPulse 1.2s ease infinite;
}
.tap-to-speak-btn svg { width: 20px; height: 20px; fill: #fff; }
@keyframes micPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes demoReadyGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(76,175,80,0.4), 0 0 40px rgba(76,175,80,0.15); }
  50% { box-shadow: 0 0 30px rgba(76,175,80,0.6), 0 0 60px rgba(76,175,80,0.25); }
}

/* ── Text input row ── */
.hero-chat {
  display: flex; width: 100%; gap: 8px; align-items: center;
}
.hero-chat input {
  flex: 1; padding: 12px 16px;
  background: rgba(255,255,255,0.95); border: 2px solid rgba(0,0,0,0.1);
  border-radius: 12px; outline: none;
  color: #1a1a1a; font-family: var(--f-sans); font-size: 0.95rem; min-width: 0;
  transition: border-color 0.2s;
}
.hero-chat input:focus { border-color: #4A90D9; }
.hero-chat input::placeholder { color: rgba(0,0,0,0.35); }

.hero-clear-btn {
  padding: 12px 16px; background: #E53935; color: #fff; font-weight: 700;
  font-size: 0.78rem; letter-spacing: 0.04em;
  border: none; border-radius: 10px; cursor: pointer;
  font-family: var(--f-sans); transition: background 0.2s; white-space: nowrap;
}
.hero-clear-btn:hover { background: #C62828; }

.hero-send-btn {
  width: 46px; height: 46px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #4A90D9; border: none; border-radius: 10px;
  cursor: pointer; transition: background 0.2s;
}
.hero-send-btn:hover { background: #3388E8; }
.hero-send-btn svg { width: 22px; height: 22px; fill: #fff; }

.hero-chat-hint {
  font-size: 0.7rem; color: rgba(255,255,255,0.25); margin-top: 0.3rem; text-align: center;
}
.hero-chat-hint span {
  color: rgba(255,255,255,0.45); cursor: pointer;
  border-bottom: 1px dotted rgba(255,255,255,0.25); transition: color 0.2s;
}
.hero-chat-hint span:hover { color: var(--amber-light); }

/* ── Mic popup card ── */
.mic-popup {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}
.mic-popup.open { display: flex; }
.mic-popup-card {
  background: #1e1c24; border-radius: 20px; padding: 22px 26px;
  text-align: center; min-width: 300px; max-width: 400px; width: 86%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.mic-popup-icon {
  font-size: 54px; margin-bottom: 8px;
  animation: micPopupPulse 1.5s ease infinite;
}
@keyframes micPopupPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.75; }
}
.mic-popup-status {
  font-size: 0.85rem; font-weight: 700; color: #E53935;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px;
}
.mic-popup-record {
  width: 60px; height: 60px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #4A90D9, #2979D6);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; margin: 0 auto 6px;
  box-shadow: 0 4px 14px rgba(41,121,214,0.4);
}
.mic-popup-record svg { width: 28px; height: 28px; fill: #fff; }
.mic-popup-record:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(41,121,214,0.5); }
.mic-popup-record.recording {
  background: linear-gradient(135deg, #E53935, #C62828);
  box-shadow: 0 4px 14px rgba(229,57,53,0.5);
  animation: micPopupPulse 1.2s ease infinite;
}
.mic-popup-input {
  width: 100%; padding: 12px 14px; margin-top: 8px;
  min-height: 56px; max-height: 110px;
  background: rgba(255,255,255,0.97); border: 2px solid rgba(0,0,0,0.1);
  border-radius: 10px; outline: none;
  color: #1a1a1a; font-family: var(--f-sans); font-size: 1rem; font-weight: 600;
  line-height: 1.35; resize: none; overflow-y: auto;
  text-align: center; transition: border-color 0.2s;
  box-sizing: border-box;
}
.mic-popup-input:focus { border-color: #4A90D9; }
.mic-popup-input::placeholder { color: rgba(0,0,0,0.3); font-weight: 400; }
.mic-popup-actions {
  display: flex; gap: 10px; margin-top: 14px; justify-content: center;
}
.mic-popup-cancel {
  padding: 9px 22px;
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6);
  border: none; border-radius: 12px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.mic-popup-cancel:hover { background: rgba(255,255,255,0.15); color: #fff; }
.mic-popup-done {
  padding: 9px 28px;
  background: linear-gradient(135deg, #4A90D9, #2979D6); color: #fff;
  border: none; border-radius: 12px; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(41,121,214,0.3);
}
.mic-popup-done:hover { background: linear-gradient(135deg, #5A9FE6, #3388E8); }
.mic-popup-status.active { color: #E53935; }
.mic-popup-status.paused { color: rgba(255,255,255,0.4); }

/* ── "Their Turn" listening overlay ── */
.listen-overlay {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; padding: 40px 20px; gap: 16px;
}
.listen-overlay.active { display: flex; }
.listen-overlay-icon { font-size: 100px; animation: micPopupPulse 1.5s ease infinite; }
.listen-overlay-label {
  font-size: 1.2rem; font-weight: 700; color: #4A90D9;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.listen-overlay-transcript {
  font-size: 1.1rem; color: rgba(255,255,255,0.6); min-height: 32px; text-align: center;
}
.listen-overlay-transcript:empty::after {
  content: 'Waiting for them to speak...'; color: rgba(255,255,255,0.25);
}
.listen-text-input {
  display: flex; flex-direction: column; gap: 8px; margin-top: 16px; width: 100%; max-width: 360px;
}
.listen-text-label {
  font-size: 0.72rem; color: rgba(255,255,255,0.4); text-align: center;
}
.listen-text-input input {
  width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08); color: #fff; font-family: var(--f-sans); font-size: 0.9rem;
  outline: none; text-align: center;
}
.listen-text-input input:focus { border-color: var(--amber); }
.listen-text-input input::placeholder { color: rgba(255,255,255,0.25); }
.listen-text-submit {
  padding: 10px 20px; border: none; border-radius: 12px; background: #2E7D32; color: #fff;
  font-family: var(--f-sans); font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.listen-text-submit:hover { background: #388E3C; }
.listen-mic-submit {
  margin-top: 18px; width: 76px; height: 76px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #43A047, #2E7D32); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 6px 20px rgba(67,160,71,0.35); transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.listen-mic-submit:hover { transform: scale(1.06); box-shadow: 0 8px 24px rgba(67,160,71,0.5); }
.listen-mic-submit svg { width: 30px; height: 30px; fill: #fff; }
.listen-mic-submit .listen-mic-check {
  position: absolute; right: 8px; bottom: 6px; font-size: 0.95rem; font-weight: 800;
  background: #fff; color: #2E7D32; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.listen-skip-btn {
  margin-top: 14px; padding: 8px 20px; border: 1px solid rgba(255,255,255,0.15); border-radius: 20px;
  background: none; color: rgba(255,255,255,0.4); font-family: var(--f-sans); font-size: 0.7rem;
  cursor: pointer;
}
.listen-skip-btn:hover { color: rgba(255,255,255,0.6); border-color: rgba(255,255,255,0.3); }

/* ── Menu Builder Panel — Apple glass popup card ── */
/* ═══ Settings — centered glass card (Apple style) ═══ */
.menu-builder {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 100px;
  background: rgba(0,0,0,0.55);
  animation: mbOverlayIn 0.2s ease-out;
}
@keyframes mbOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.menu-builder-card {
  width: calc(100% - 40px); max-width: 480px;
  max-height: 82vh; overflow-y: auto;
  background: rgba(28, 28, 32, 0.88);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 22px;
  padding: 6px 24px 28px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.6), 0 0 0 0.5px rgba(255,255,255,0.08) inset;
  animation: mbCardPop 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  -webkit-overflow-scrolling: touch;
}
@keyframes mbCardPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.menu-builder-handle {
  width: 36px; height: 5px; border-radius: 3px;
  background: rgba(255,255,255,0.2);
  margin: 8px auto 4px;
}

.menu-builder-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0 14px;
  font-size: 1.1rem; font-weight: 700; color: #fff;
  letter-spacing: -0.01em;
}
.menu-builder-close {
  background: rgba(255,255,255,0.1); border: none; color: rgba(255,255,255,0.6);
  width: 28px; height: 28px; border-radius: 50%; font-size: 0.8rem;
  cursor: pointer; transition: background 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.menu-builder-close:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ── Sections ── */
.mb-section {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px;
}
.mb-section-title {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: rgba(255,255,255,0.35);
  margin-bottom: 10px;
}

/* ── Display option rows ── */
.mb-grid { display: flex; flex-direction: column; gap: 10px; }
.mb-option-group {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.mb-label {
  font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.55);
  min-width: 48px;
}
.mb-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.mb-pill {
  padding: 5px 12px; border-radius: 8px; border: none;
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7);
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.mb-pill:hover { background: rgba(255,255,255,0.14); color: #fff; }
.mb-pill.active { background: var(--amber); color: #000; }

/* ── Tool buttons ── */
.mb-tools-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px;
}
.mb-tool-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px; border-radius: 12px; border: none;
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.65);
  font-size: 0.68rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.mb-tool-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.mb-tool-icon { font-size: 1.3rem; }

/* ── Status ── */
.menu-builder-status {
  text-align: center; font-size: 0.75rem;
  color: rgba(255,255,255,0.35); padding: 6px 0 0;
  min-height: 14px;
}

/* ── Force-hide legacy elements from stale cached HTML ── */
.menu-settings-row, .menu-settings-label, .mode-toggle, .mode-setting-btn { display: none !important; }
.menu-builder-name {
  padding: 12px 14px; border-radius: 10px; border: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06); color: #fff; font-size: 0.95rem;
  font-family: var(--f-sans); outline: none; transition: border-color 0.2s;
}
.menu-builder-name:focus { border-color: var(--amber); }
.menu-builder-name::placeholder { color: rgba(255,255,255,0.3); }
.menu-builder-text {
  flex: 1; min-height: 160px; padding: 14px; border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.06);
  color: #fff; font-size: 0.9rem; font-family: var(--f-sans);
  outline: none; resize: none; transition: border-color 0.2s;
}
.menu-builder-text:focus { border-color: var(--amber); }
.menu-builder-text::placeholder { color: rgba(255,255,255,0.25); }
.menu-builder-url-row {
  display: flex; gap: 8px;
}
.menu-builder-url {
  flex: 1; padding: 12px 14px; border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.06);
  color: #fff; font-size: 0.9rem; font-family: var(--f-sans); outline: none;
  transition: border-color 0.2s;
}
.menu-builder-url:focus { border-color: var(--amber); }
.menu-builder-url::placeholder { color: rgba(255,255,255,0.3); }
.menu-builder-url-go {
  padding: 12px 20px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #2E7D32, #1B5E20); color: #fff;
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
  transition: background 0.2s; white-space: nowrap;
}
.menu-builder-url-go:hover { background: linear-gradient(135deg, #388E3C, #2E7D32); }
.menu-builder-url-go:disabled { opacity: 0.5; cursor: not-allowed; }
.menu-builder-or {
  text-align: center; color: rgba(255,255,255,0.25); font-size: 0.8rem; font-weight: 600;
}
.menu-builder-upload {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: 12px; border: 2px dashed rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.5);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.menu-builder-upload:hover { border-color: var(--amber); color: var(--amber); background: rgba(232,163,61,0.05); }
.menu-builder-preview { text-align: center; }
.menu-builder-go {
  padding: 16px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #4A90D9, #2979D6); color: #fff;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(41,121,214,0.3); transition: all 0.2s;
}
.menu-builder-go:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(41,121,214,0.4); }
.menu-builder-go:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.menu-builder-status {
  text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.5); min-height: 20px;
}

/* ═══ Offline banner ═══ */
#offlineBanner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0.45rem 1.2rem;
  background: #92400e;
  border-bottom: 1px solid #b45309;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fde68a;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  animation: bannerSlideIn 0.25s ease;
}
#offlineBanner.visible { display: block; }
@keyframes bannerSlideIn {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

/* ═══ Keyboard accessibility ═══ */
.demo-tile:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(232, 163, 61, 0.35);
}
.demo-tile:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* ═══ Kiosk Cart Bar ═══ */
.kiosk-cart-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: none; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  color: #fff; cursor: pointer;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  transition: transform 0.3s var(--ease-spring);
  font-family: var(--f-sans);
}
.kiosk-cart-bar.visible { display: flex; }
.kiosk-cart-bar:hover { filter: brightness(1.1); }
.kiosk-cart-bar-left {
  display: flex; align-items: center; gap: 10px;
  font-size: 1rem; font-weight: 700;
}
.kiosk-cart-bar-right {
  display: flex; align-items: center; gap: 8px;
}
.kiosk-cart-bar-total {
  font-size: 1.1rem; font-weight: 800; color: #a5d6a7;
}
.kiosk-cart-bar-btn {
  padding: 8px 16px; border: none; border-radius: 8px;
  font-family: var(--f-sans); font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kiosk-cart-bar-place {
  background: #fff; color: #1b5e20;
}
.kiosk-cart-bar-place:hover { background: #e8f5e9; }
.kiosk-cart-bar-clear {
  background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.8);
}
.kiosk-cart-bar-clear:hover { background: rgba(255,255,255,0.25); color: #fff; }

/* ═══ Kiosk Cart Overlay ═══ */
.kiosk-cart-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: none; flex-direction: column;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(12px);
  animation: cartSlideUp 0.3s ease;
}
.kiosk-cart-overlay.open { display: flex; }
@keyframes cartSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.kiosk-cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.kiosk-cart-title {
  font-size: 1.3rem; font-weight: 800; color: #fff;
}
.kiosk-cart-close {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.1); border: none;
  color: #fff; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.kiosk-cart-close:hover { background: rgba(255,255,255,0.2); }
.kiosk-cart-items {
  flex: 1; overflow-y: auto; padding: 12px 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.kiosk-cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 0.2s;
}
.kiosk-cart-item:hover { background: rgba(255,255,255,0.12); }
.kiosk-cart-item-emoji { font-size: 1.8rem; flex-shrink: 0; }
.kiosk-cart-item-info { flex: 1; min-width: 0; }
.kiosk-cart-item-name {
  font-size: 0.95rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kiosk-cart-item-price {
  font-size: 0.8rem; color: #a5d6a7; font-weight: 600;
}
.kiosk-cart-item-qty {
  display: flex; align-items: center; gap: 6px;
}
.kiosk-cart-item-qty button {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08);
  color: #fff; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.kiosk-cart-item-qty button:hover { background: rgba(255,255,255,0.2); }
.kiosk-cart-item-qty span {
  font-size: 0.9rem; font-weight: 700; color: #fff; min-width: 20px; text-align: center;
}
.kiosk-cart-item-remove {
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: rgba(229,57,53,0.2); color: #ef5350;
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.kiosk-cart-item-remove:hover { background: rgba(229,57,53,0.4); }
.kiosk-cart-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px; color: rgba(255,255,255,0.3);
}
.kiosk-cart-empty-icon { font-size: 3rem; }
.kiosk-cart-empty-text { font-size: 1rem; font-weight: 600; }
.kiosk-cart-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; gap: 12px;
}
.kiosk-cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
}
.kiosk-cart-total-label {
  font-size: 1rem; font-weight: 600; color: rgba(255,255,255,0.6);
}
.kiosk-cart-total-amount {
  font-size: 1.4rem; font-weight: 800; color: #a5d6a7;
}
.kiosk-cart-actions {
  display: flex; gap: 10px;
}
.kiosk-cart-actions button {
  flex: 1; padding: 14px; border: none; border-radius: 12px;
  font-family: var(--f-sans); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* BUG-28: added flex:1 + white-space:nowrap so buttons fill row without wrapping */
.kiosk-cart-add-more {
  flex: 1; padding: 14px;
  background: rgba(255,255,255,0.1); color: #fff;
  white-space: nowrap;
}
.kiosk-cart-add-more:hover { background: rgba(255,255,255,0.18); }
.kiosk-cart-place-order {
  flex: 1; padding: 14px;
  background: linear-gradient(135deg, #2e7d32, #1b5e20); color: #fff;
  box-shadow: 0 4px 12px rgba(46,125,50,0.4);
  white-space: nowrap;
}
.kiosk-cart-place-order:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ═══ Kiosk Toast Notification ═══ */
.kiosk-toast {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%) translateY(-20px);
  z-index: 200; padding: 10px 24px; border-radius: 12px;
  background: #2e7d32; color: #fff;
  font-family: var(--f-sans); font-size: 0.85rem; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}
.kiosk-toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto;
}

/* ═══ Kiosk Order Confirmation ═══ */
.kiosk-confirmation {
  position: fixed; inset: 0; z-index: 110;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.9); backdrop-filter: blur(16px);
  gap: 16px; padding: 40px;
}
.kiosk-confirmation.open { display: flex; }
.kiosk-confirm-icon { font-size: 5rem; animation: confirmBounce 0.6s var(--ease-spring); }
@keyframes confirmBounce {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}
.kiosk-confirm-title {
  font-size: 1.8rem; font-weight: 800; color: #a5d6a7;
}
.kiosk-confirm-order-num {
  font-size: 1rem; font-weight: 600; color: rgba(255,255,255,0.5);
}
.kiosk-confirm-summary {
  max-width: 400px; text-align: center;
  font-size: 0.9rem; color: rgba(255,255,255,0.6); line-height: 1.5;
}
.kiosk-confirm-new-order {
  margin-top: 12px; padding: 16px 40px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #4A90D9, #2979D6); color: #fff;
  font-family: var(--f-sans); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(41,121,214,0.3);
}
.kiosk-confirm-new-order:hover { filter: brightness(1.1); transform: translateY(-2px); }

/* ═══ Light mode — kiosk overrides ═══ */
.light-mode .kiosk-cart-bar { box-shadow: 0 -4px 16px rgba(0,0,0,0.15); }
.light-mode .kiosk-cart-overlay { background: rgba(245,245,245,0.95); }
.light-mode .kiosk-cart-header { border-bottom-color: #e0e0e0; }
.light-mode .kiosk-cart-title { color: #1a1a1a; }
.light-mode .kiosk-cart-close { background: rgba(0,0,0,0.06); color: #1a1a1a; }
.light-mode .kiosk-cart-item { background: #fff; border-color: #e0e0e0; }
.light-mode .kiosk-cart-item-name { color: #1a1a1a; }
.light-mode .kiosk-cart-item-price { color: #2e7d32; }
.light-mode .kiosk-cart-item-qty button { background: #f5f5f5; border-color: #e0e0e0; color: #1a1a1a; }
.light-mode .kiosk-cart-item-qty span { color: #1a1a1a; }
.light-mode .kiosk-cart-footer { border-top-color: #e0e0e0; }
.light-mode .kiosk-cart-total-label { color: #666; }
.light-mode .kiosk-cart-total-amount { color: #2e7d32; }
.light-mode .kiosk-cart-add-more { background: #e0e0e0; color: #1a1a1a; }
.light-mode .kiosk-cart-empty { color: #999; }
.light-mode .kiosk-confirmation { background: rgba(245,245,245,0.95); }
.light-mode .kiosk-confirm-title { color: #2e7d32; }
.light-mode .kiosk-confirm-order-num { color: #666; }
.light-mode .kiosk-confirm-summary { color: #555; }

/* ═══ Kiosk — extra bottom padding when cart bar visible ═══ */
body.kiosk-active .ask-wrap { padding-bottom: 70px; }
body.kiosk-active .tablet-grid { padding-bottom: 60px; }

/* ═══ Compliance Popup ═══ */
.compliance-popup { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.compliance-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; padding: 32px; max-width: 480px; width: 90%; max-height: 80vh; overflow-y: auto; position: relative; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.compliance-qr-block {
  margin-top: 20px;
  padding: 18px;
  background: #fff;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.compliance-qr-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.compliance-qr-img {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto 10px;
  image-rendering: pixelated;
}
.compliance-qr-url {
  font-size: 0.62rem;
  color: #666;
  word-break: break-all;
  font-family: ui-monospace, Menlo, monospace;
}
.compliance-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: rgba(255,255,255,0.4); font-size: 1.4rem; cursor: pointer; }

/* ═══ Builder Mode Toggle ═══ */
.builder-mode-toggle {
  display: flex; gap: 4px; margin-bottom: 12px;
  background: rgba(255,255,255,0.04); border-radius: 10px; padding: 3px;
}
.builder-mode-btn {
  flex: 1; border: none; background: transparent; color: rgba(255,255,255,0.4);
  font-size: 0.72rem; font-weight: 700; padding: 8px 12px; border-radius: 8px;
  cursor: pointer; transition: all 0.2s; font-family: var(--f-sans);
}
.builder-mode-btn:hover { color: rgba(255,255,255,0.6); }
.builder-mode-btn.active {
  background: rgba(232,163,61,0.2); color: var(--amber);
}
.builder-site-desc {
  font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-bottom: 10px; line-height: 1.4;
}
.light-mode .builder-mode-toggle { background: rgba(0,0,0,0.04); }
.light-mode .builder-mode-btn { color: #999; }
.light-mode .builder-mode-btn.active { background: rgba(232,163,61,0.15); color: #c17d1e; }
.light-mode .builder-site-desc { color: #888; }

.qr-header-btn {
  border: none; background: none; color: rgba(255,255,255,0.4); font-size: 1.1rem;
  cursor: pointer; padding: 2px 4px; line-height: 1; transition: color 0.2s;
}
.qr-header-btn:hover { color: var(--amber); }
.light-mode .qr-header-btn { color: rgba(0,0,0,0.3); }
.light-mode .qr-header-btn:hover { color: #c17d1e; }

/* ═══ Geo Location Button ═══ */
.geo-header-btn {
  border: none; background: none; color: rgba(255,255,255,0.4); font-size: 1.1rem;
  cursor: pointer; padding: 2px 4px; line-height: 1; transition: color 0.2s;
}
.geo-header-btn:hover { color: var(--amber); }
.geo-header-btn.active { color: var(--green); animation: geoPulse 2s ease-in-out infinite; }
.light-mode .geo-header-btn { color: rgba(0,0,0,0.3); }
.light-mode .geo-header-btn:hover { color: #c17d1e; }
.light-mode .geo-header-btn.active { color: #16a34a; }
@keyframes geoPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ═══ Real Image Toggle Button ═══ */
.image-toggle-btn {
  border: none; background: none; color: rgba(255,255,255,0.4); font-size: 1.1rem;
  cursor: pointer; padding: 2px 4px; line-height: 1; transition: color 0.2s;
}
.image-toggle-btn:hover { color: var(--amber); }
.image-toggle-btn.active { color: #3b82f6; }
.light-mode .image-toggle-btn { color: rgba(0,0,0,0.3); }
.light-mode .image-toggle-btn:hover { color: #c17d1e; }
.light-mode .image-toggle-btn.active { color: #2563eb; }

/* Tile photo image inside emoji span */
.tile-photo {
  width: 70px; height: 70px; border-radius: 12px; object-fit: cover;
  display: block; margin: 0 auto;
}

/* ═══ QR Code Output ═══ */
.qr-output {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-top: 12px; padding: 16px; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; background: rgba(255,255,255,0.04);
}
.qr-output-title { font-size: 0.85rem; font-weight: 700; color: var(--amber); }
.qr-output-img {
  width: 200px; height: 200px; border-radius: 8px; background: #fff; padding: 8px;
}
.qr-output-desc { font-size: 0.7rem; color: rgba(255,255,255,0.4); text-align: center; }
.qr-output-download {
  padding: 8px 20px; border: none; border-radius: 8px;
  background: var(--amber); color: #000; font-family: var(--f-sans);
  font-size: 0.75rem; font-weight: 700; cursor: pointer;
}
.qr-output-download:hover { opacity: 0.9; }
.light-mode .qr-output { border-color: #e0e0e0; background: rgba(0,0,0,0.02); }
.light-mode .qr-output-desc { color: #999; }

/* ═══ Language Picker ═══ */
.lang-select {
  background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; padding: 4px 6px; font-family: var(--f-sans); font-size: 0.65rem;
  font-weight: 600; cursor: pointer; outline: none; max-width: 75px;
}
.lang-select:hover { border-color: var(--amber); }
.lang-select option { background: #1a1a2e; color: #fff; }
.lang-arrow { color: rgba(255,255,255,0.3); font-size: 0.7rem; font-weight: 700; }
.their-lang { border-color: rgba(139,92,246,0.3); }
.their-lang:hover { border-color: var(--purple); }
.light-mode .lang-arrow { color: rgba(0,0,0,0.3); }
.light-mode .lang-select { background: rgba(0,0,0,0.05); color: #333; border-color: #ddd; }
.light-mode .lang-select option { background: #fff; color: #333; }

/* Rich mode sentence shown below label in grid view */
.demo-tile-sentence {
  font-size: 0.6rem; color: rgba(255,255,255,0.7); padding: 2px 6px 4px;
  text-align: center; line-height: 1.3; font-weight: 400;
  text-transform: none; letter-spacing: 0; background: rgba(0,0,0,0.2);
}
.light-mode .demo-tile-sentence { color: rgba(255,255,255,0.8); }

/* Translation sub-label on tiles */
.demo-tile-translated {
  font-size: 0.55rem; color: rgba(255,255,255,0.5); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center; padding: 0 4px; background: rgba(0,0,0,0.2);
}
.light-mode .demo-tile-translated { color: rgba(0,0,0,0.4); }

/* Translation loading indicator */
.lang-loading { opacity: 0.5; pointer-events: none; }
.lang-loading::after {
  content: ''; display: inline-block; width: 12px; height: 12px; border: 2px solid var(--amber);
  border-top-color: transparent; border-radius: 50%; animation: spin 0.6s linear infinite;
  margin-left: 6px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ Board Building Loader ═══ */
.board-loader {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 3rem 1rem; width: 100%; min-height: calc(100vh - 350px);
  grid-column: 1 / -1;
}
.board-loader-icon {
  font-size: 3rem; animation: hourglass 2s ease-in-out infinite;
}
@keyframes hourglass {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
}
.board-loader-text {
  font-size: 0.9rem; font-weight: 600; color: var(--amber); text-align: center;
}
.board-loader-sub {
  font-size: 0.72rem; color: rgba(255,255,255,0.35); text-align: center; max-width: 280px;
}
.board-loader-dots::after {
  content: ''; animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}
.board-loader-progress {
  width: 200px; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden;
}
.board-loader-progress-bar {
  height: 100%; width: 0%; background: var(--amber); border-radius: 2px;
  animation: progress-indeterminate 2.5s ease-in-out infinite;
}
@keyframes progress-indeterminate {
  0% { width: 0%; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}
.light-mode .board-loader-sub { color: rgba(0,0,0,0.35); }

/* ═══ Action System ═══ */
.action-iframe-panel {
  position: fixed; bottom: 0; left: 0; right: 0; height: 65vh;
  background: var(--surface-deep); border-top: 2px solid var(--amber);
  border-radius: 16px 16px 0 0; z-index: 1000;
  display: flex; flex-direction: column;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.5);
}
.action-iframe-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem; font-weight: 700; color: var(--amber);
}
.action-iframe-header button {
  background: none; border: 1px solid rgba(255,255,255,0.15); color: #fff;
  padding: 4px 12px; border-radius: 8px; font-size: 0.7rem; cursor: pointer;
}
.action-confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.action-confirm-card {
  background: var(--surface-deep); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 24px; text-align: center; max-width: 320px; width: 90%;
}
.action-confirm-title { font-size: 1.1rem; font-weight: 700; color: var(--amber); margin-bottom: 12px; }
.action-confirm-desc { font-size: 0.9rem; color: rgba(255,255,255,0.7); margin-bottom: 20px; }
.action-confirm-buttons { display: flex; gap: 12px; }
.action-confirm-yes, .action-confirm-no {
  flex: 1; padding: 16px; border: none; border-radius: 12px; font-size: 1.2rem;
  font-weight: 700; cursor: pointer;
}
.action-confirm-yes { background: #2E7D32; color: #fff; }
.action-confirm-no { background: #C62828; color: #fff; }
.action-audit-card {
  background: var(--surface-deep); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 20px; max-width: 400px; width: 90%; max-height: 70vh; overflow-y: auto;
}
.action-audit-title { font-size: 1rem; font-weight: 700; color: var(--amber); margin-bottom: 12px; }
.action-audit-item { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.75rem; color: rgba(255,255,255,0.6); }
.action-audit-item small { color: rgba(255,255,255,0.3); }
.action-audit-empty { color: rgba(255,255,255,0.3); font-size: 0.8rem; }
.action-audit-close { margin-top: 12px; width: 100%; padding: 10px; border: none; border-radius: 8px; background: rgba(255,255,255,0.1); color: #fff; cursor: pointer; }
.light-mode .action-confirm-card, .light-mode .action-audit-card { background: #fff; border-color: #e0e0e0; }
.light-mode .action-confirm-desc { color: #666; }
.light-mode .action-audit-item { color: #666; border-color: #f0f0f0; }

/* ═══ Product/Shopping Tiles ═══ */
.tile-price-tag {
  position: absolute; top: 6px; right: 6px; background: #2E7D32; color: #fff;
  padding: 2px 8px; border-radius: 10px; font-size: 0.65rem; font-weight: 700;
  z-index: 1;
}
.demo-tile[data-has-image="true"] {
  background-size: cover; background-position: center; position: relative;
}
.demo-tile[data-has-image="true"] .demo-tile-label {
  text-shadow: 0 1px 4px rgba(0,0,0,0.8); background: rgba(0,0,0,0.5);
  border-radius: 0 0 12px 12px; padding: 6px 8px;
}
.light-mode .demo-tile[data-has-image="true"] .demo-tile-label {
  text-shadow: 0 1px 4px rgba(0,0,0,0.6); background: rgba(255,255,255,0.7); color: #222;
}

/* ═══ Healthcare — pain scale gradient, modal styles ═══ */
.health-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.85); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.health-modal-overlay input:focus {
  outline: 2px solid var(--amber); border-color: var(--amber);
}
.light-mode .health-modal-overlay { background: rgba(0,0,0,0.6); }
.light-mode .health-modal-overlay > div { background: #fff; color: #1a1a2e; }
.light-mode .health-modal-overlay input { background: #f5f5f5; color: #1a1a2e; border-color: #ccc; }
.light-mode .health-modal-overlay span { color: #666; }

/* ═══ Embed Mode ═══ */
.embed-mode .app-header { display: none; }
.embed-mode .sentence-bar-url { display: none; }
.embed-mode .app-layout { padding-top: 0; }

/* ═══ Board Editor ═══ */
.board-editor-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.board-editor-container {
  background: var(--surface-deep); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; width: 95%; max-width: 700px; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.board-editor-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.board-editor-title { font-size: 1rem; font-weight: 700; color: var(--amber); }
.board-editor-header-actions { display: flex; gap: 8px; align-items: center; }
.board-editor-header-actions button {
  background: none; border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.7);
  padding: 4px 10px; border-radius: 8px; font-size: 0.7rem; cursor: pointer;
}
.board-editor-close {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 14px; cursor: pointer;
}
.board-editor-body {
  display: flex; flex: 1; min-height: 0; overflow: hidden;
}
.board-editor-sidebar {
  width: 180px; min-width: 140px; border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; overflow-y: auto;
}
.editor-board-list { flex: 1; overflow-y: auto; padding: 8px; }
.editor-board-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; font-size: 0.75rem; color: rgba(255,255,255,0.7);
  transition: background 0.15s;
}
.editor-board-item:hover { background: rgba(255,255,255,0.06); }
.editor-board-item.active { background: rgba(232,163,61,0.15); color: var(--amber); }
.editor-board-emoji { font-size: 1.1rem; }
.editor-board-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-board-count {
  background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 8px; font-size: 0.6rem;
}
.editor-add-board-btn {
  margin: 8px; padding: 8px; border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 8px; background: none; color: var(--amber); font-size: 0.72rem;
  cursor: pointer; text-align: center;
}
.board-editor-main {
  flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding: 12px;
}
.editor-no-board-selected {
  display: flex; align-items: center; justify-content: center; flex: 1;
  color: rgba(255,255,255,0.3); font-size: 0.8rem;
}
.editor-board-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; font-size: 0.9rem; font-weight: 600; color: #fff;
}
.editor-board-header div { display: flex; gap: 8px; }
.editor-use-board-btn, .editor-delete-board-btn {
  background: none; border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.7);
  padding: 4px 10px; border-radius: 8px; font-size: 0.65rem; cursor: pointer;
}
.editor-delete-board-btn { border-color: rgba(239,68,68,0.3); color: #ef4444; }
.editor-tile-list { display: flex; flex-direction: column; gap: 6px; }
.editor-tile-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: rgba(255,255,255,0.04); border-radius: 10px; cursor: grab;
  transition: background 0.15s, box-shadow 0.15s;
}
.editor-tile-item:hover { background: rgba(255,255,255,0.08); }
.editor-tile-item.dragging { opacity: 0.4; }
.editor-tile-item.drag-over { box-shadow: 0 -2px 0 0 var(--amber); }
.editor-tile-emoji { font-size: 1.3rem; }
.editor-tile-info { flex: 1; min-width: 0; }
.editor-tile-label { font-size: 0.8rem; font-weight: 600; color: #fff; }
.editor-tile-sentence { font-size: 0.65rem; color: rgba(255,255,255,0.4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-tile-actions { display: flex; gap: 4px; }
.editor-tile-actions button {
  background: none; border: none; cursor: pointer; font-size: 0.8rem; padding: 4px;
  opacity: 0.5; transition: opacity 0.15s;
}
.editor-tile-actions button:hover { opacity: 1; }
.editor-add-tile-btn {
  margin-top: 10px; padding: 10px; border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 10px; background: none; color: var(--amber); font-size: 0.75rem;
  cursor: pointer; text-align: center;
}

/* ═══ Tile Editor Modal ═══ */
.tile-editor-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2500;
  display: flex; align-items: center; justify-content: center;
}
.tile-editor-modal {
  background: var(--surface-deep); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 20px; max-width: 380px; width: 92%;
  max-height: 85vh; overflow-y: auto;
}
.tile-editor-title { font-size: 1rem; font-weight: 700; color: var(--amber); margin-bottom: 16px; }
.tile-editor-field { margin-bottom: 14px; }
.tile-editor-field label { display: block; font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.5); margin-bottom: 6px; }
.tile-editor-field label small { font-weight: 400; }
.tile-editor-field input, .tile-editor-field select {
  width: 100%; padding: 8px 12px; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; background: rgba(255,255,255,0.05); color: #fff;
  font-size: 0.8rem; font-family: var(--f-sans);
}
.tile-editor-field select { cursor: pointer; }
.tile-editor-emoji-grid {
  display: flex; flex-wrap: wrap; gap: 4px; max-height: 120px; overflow-y: auto;
  padding: 4px; background: rgba(255,255,255,0.03); border-radius: 8px;
}
.emoji-pick {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; cursor: pointer; border-radius: 6px; transition: background 0.1s;
}
.emoji-pick:hover { background: rgba(255,255,255,0.1); }
.emoji-pick.selected { background: rgba(232,163,61,0.3); outline: 2px solid var(--amber); }
.tile-editor-selected-emoji { text-align: center; font-size: 2rem; margin: 8px 0; }
.tile-editor-color-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.color-pick {
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  transition: transform 0.1s; display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; color: rgba(255,255,255,0.5);
}
.color-pick:hover { transform: scale(1.15); }
.color-pick.selected { outline: 2px solid #fff; outline-offset: 2px; }
.tile-editor-preview {
  display: flex; justify-content: center; margin: 16px 0 12px; padding: 12px;
  background: rgba(255,255,255,0.03); border-radius: 10px;
}
.tile-editor-preview .demo-tile { max-width: 140px; }
.tile-editor-buttons { display: flex; gap: 10px; }
.tile-editor-cancel, .tile-editor-save {
  flex: 1; padding: 10px; border: none; border-radius: 10px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer;
}
.tile-editor-cancel { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.tile-editor-save { background: var(--amber); color: #000; }

/* ═══ Analytics Dashboard ═══ */
.analytics-dashboard-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.analytics-dashboard {
  background: var(--surface-deep); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 20px; max-width: 420px; width: 92%;
  max-height: 85vh; overflow-y: auto;
}
.analytics-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.analytics-title { font-size: 1rem; font-weight: 700; color: var(--amber); }
.analytics-close {
  width: 28px; height: 28px; border-radius: 50%; background: none;
  border: 1px solid rgba(255,255,255,0.12); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.analytics-stats {
  display: flex; gap: 12px; margin-bottom: 20px;
}
.analytics-stat {
  flex: 1; text-align: center; padding: 12px 8px;
  background: rgba(255,255,255,0.04); border-radius: 10px;
}
.analytics-stat-num { font-size: 1.5rem; font-weight: 800; color: var(--amber); }
.analytics-stat-label { font-size: 0.65rem; color: rgba(255,255,255,0.4); margin-top: 4px; }
.analytics-section { margin-bottom: 18px; }
.analytics-section-title {
  font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.5);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.analytics-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.analytics-bar-label { width: 80px; font-size: 0.7rem; color: rgba(255,255,255,0.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-bar-track { flex: 1; height: 14px; background: rgba(255,255,255,0.05); border-radius: 7px; overflow: hidden; }
.analytics-bar-fill { height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-light)); border-radius: 7px; transition: width 0.3s ease; }
.analytics-bar-count { font-size: 0.65rem; color: rgba(255,255,255,0.4); width: 30px; text-align: right; }
.analytics-board-item {
  display: flex; justify-content: space-between; padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.72rem;
}
.analytics-board-name { color: rgba(255,255,255,0.7); }
.analytics-board-count { color: var(--amber); font-weight: 600; }
.analytics-empty { color: rgba(255,255,255,0.3); font-size: 0.8rem; text-align: center; padding: 20px; }
.analytics-clear-btn {
  width: 100%; padding: 10px; border: 1px solid rgba(239,68,68,0.2);
  border-radius: 10px; background: none; color: #ef4444; font-size: 0.75rem;
  cursor: pointer; margin-top: 8px;
}

/* ═══ Profile Switcher ═══ */
.profile-switcher-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.profile-switcher {
  background: var(--surface-deep); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 20px; max-width: 380px; width: 92%;
  max-height: 85vh; overflow-y: auto;
}
.profile-switcher-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.profile-switcher-title { font-size: 1rem; font-weight: 700; color: var(--amber); }
.profile-switcher-close {
  width: 28px; height: 28px; border-radius: 50%; background: none;
  border: 1px solid rgba(255,255,255,0.12); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.profile-list { margin-bottom: 14px; }
.profile-card {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: rgba(255,255,255,0.04); border-radius: 10px; margin-bottom: 8px;
  cursor: pointer; transition: background 0.15s; position: relative;
}
.profile-card:hover { background: rgba(255,255,255,0.08); }
.profile-card.active { background: rgba(232,163,61,0.12); border: 1px solid rgba(232,163,61,0.3); }
.profile-card-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--amber), var(--amber-light));
  color: #000; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
}
.profile-card-info { flex: 1; }
.profile-card-name { font-size: 0.85rem; font-weight: 600; color: #fff; }
.profile-card-lang { font-size: 0.65rem; color: rgba(255,255,255,0.4); }
.profile-card-delete {
  background: none; border: none; color: rgba(255,255,255,0.3); cursor: pointer;
  font-size: 0.8rem; padding: 4px;
}
.profile-card-delete:hover { color: #ef4444; }
.profile-empty { color: rgba(255,255,255,0.3); font-size: 0.8rem; text-align: center; padding: 16px; }
.profile-add-row { display: flex; gap: 8px; margin-bottom: 12px; }
.profile-add-input {
  flex: 1; padding: 8px 12px; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; background: rgba(255,255,255,0.05); color: #fff;
  font-size: 0.8rem; font-family: var(--f-sans);
}
.profile-add-btn {
  padding: 8px 14px; border: none; border-radius: 8px;
  background: var(--amber); color: #000; font-weight: 600; font-size: 0.75rem; cursor: pointer;
}
.profile-pin-section { text-align: center; }
.profile-pin-btn {
  padding: 8px 16px; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
  background: none; color: rgba(255,255,255,0.7); font-size: 0.75rem; cursor: pointer;
}

/* ═══ PIN Entry ═══ */
.pin-entry-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 2500;
  display: flex; align-items: center; justify-content: center;
}
.pin-entry {
  background: var(--surface-deep); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 28px; max-width: 300px; width: 88%; text-align: center;
}
.pin-entry-title { font-size: 1rem; font-weight: 700; color: var(--amber); margin-bottom: 18px; }
.pin-entry-input {
  width: 100%; padding: 14px; border: 2px solid rgba(255,255,255,0.15);
  border-radius: 12px; background: rgba(255,255,255,0.05); color: #fff;
  font-size: 1.5rem; text-align: center; letter-spacing: 12px;
  font-family: var(--f-sans); margin-bottom: 8px;
}
.pin-entry-input:focus { border-color: var(--amber); outline: none; }
.pin-entry-error { color: #ef4444; font-size: 0.75rem; margin-bottom: 8px; }
.pin-entry-hint { color: rgba(255,255,255,0.3); font-size: 0.65rem; margin-bottom: 14px; }
.pin-entry-buttons { display: flex; gap: 10px; }
.pin-entry-cancel, .pin-entry-submit {
  flex: 1; padding: 10px; border: none; border-radius: 10px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer;
}
.pin-entry-cancel { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.pin-entry-submit { background: var(--amber); color: #000; }

/* ═══ Light Mode overrides for new overlays ═══ */
.light-mode .board-editor-container,
.light-mode .tile-editor-modal,
.light-mode .analytics-dashboard,
.light-mode .profile-switcher,
.light-mode .pin-entry { background: #fff; border-color: #e0e0e0; }
.light-mode .editor-tile-item { background: #f5f5f5; }
.light-mode .editor-tile-label { color: #1a1a2e; }
.light-mode .editor-tile-sentence { color: #888; }
.light-mode .analytics-stat { background: #f5f5f5; }
.light-mode .analytics-bar-track { background: #eee; }
.light-mode .analytics-bar-label { color: #333; }
.light-mode .profile-card { background: #f5f5f5; }
.light-mode .profile-card-name { color: #1a1a2e; }
.light-mode .pin-entry-input { background: #f5f5f5; color: #1a1a2e; border-color: #ccc; }
.light-mode .tile-editor-field input,
.light-mode .tile-editor-field select,
.light-mode .profile-add-input { background: #f5f5f5; color: #1a1a2e; border-color: #ccc; }

/* ═══ Responsive ═══ */
@media (max-width: 600px) {
  .app-layout { padding: 0 0.5rem; }
  /* Phone: 2-column tile grid (tiles mode, not 1-line bar) */
  .tablet-grid { gap: 10px; grid-template-columns: repeat(2, 1fr) !important; }
  .demo-tile-emoji { font-size: 52px; }
  .demo-tile-label { font-size: 0.85rem; padding: 7px 4px; }
  .app-header { padding: 0.5rem 0; }
  .mic-popup-card { min-width: 280px; padding: 24px 20px; width: 94%; }
  .mic-popup-input { font-size: 1rem; min-height: 60px; padding: 12px 14px; }
  .kiosk-cart-bar { padding: 10px 16px; }
  .kiosk-cart-bar-left { font-size: 0.85rem; }
  .kiosk-cart-items { padding: 12px 16px; }
  .kiosk-cart-footer { padding: 12px 16px 20px; }
  .board-editor-body { flex-direction: column; }
  .board-editor-sidebar { width: 100%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); max-height: 150px; }
}

/* ═══════════════════════════════════════════════════════════════
   DEMO WIZARD — "One Device. Every Conversation."
   Keynote-grade interactive walkthrough
   ═══════════════════════════════════════════════════════════════ */

/* ── Cinematic Demo: Disney magic — thinking → sparkles → burst ── */

/* Thinking tile — question mark that pulses */
.demo-thinking-tile {
  aspect-ratio: 1; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  animation: demoThinkFade 1.5s ease-in-out infinite;
}
.demo-thinking-icon {
  font-size: 40px; opacity: 0.3; transition: all 0.3s ease;
}
.demo-brain-pulse {
  opacity: 0.8 !important; animation: demoBrainPulse 0.8s ease-in-out infinite;
}
@keyframes demoThinkFade {
  0%, 100% { opacity: 0.3; border-color: rgba(255,255,255,0.04); }
  50% { opacity: 0.7; border-color: rgba(232,163,61,0.2); }
}
@keyframes demoBrainPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Burst animation — tiles appear from nothing */
.demo-tile {
  animation: demoBurst 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes demoBurst {
  0% { opacity: 0; transform: scale(0.3) rotate(-5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Empty stage between narration steps */
.demo-empty-stage {
  grid-column: 1 / -1; min-height: 200px;
  display: flex; align-items: center; justify-content: center;
}

/* Skip button */
.demo-skip-btn {
  position: fixed; top: 12px; right: 12px; z-index: 9999;
  padding: 6px 16px; border: 1px solid rgba(255,255,255,0.2); border-radius: 20px;
  background: rgba(0,0,0,0.5); color: rgba(255,255,255,0.5); font-size: 0.7rem;
  font-weight: 600; cursor: pointer; font-family: var(--f-sans);
}
.demo-skip-btn:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

/* Conversation bubble — "they said" moment in demo */
.demo-conversation-bubble {
  grid-column: 1 / -1; padding: 20px; text-align: center;
  font-size: 1.1rem; color: rgba(255,255,255,0.8); font-style: italic;
  background: rgba(139,92,246,0.15); border: 1px solid rgba(139,92,246,0.3);
  border-radius: 16px; animation: demoBubbleIn 0.5s ease-out;
}
@keyframes demoBubbleIn {
  0% { opacity: 0; transform: scale(0.8) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Sparkle particles — Disney magic dust */
.demo-sparkle {
  position: absolute; font-size: 16px; pointer-events: none; z-index: 10;
  animation: demoSparkle 1s ease-out forwards;
}
@keyframes demoSparkle {
  0% { opacity: 1; transform: scale(0) translateY(0); }
  50% { opacity: 1; transform: scale(1.2) translateY(-20px); }
  100% { opacity: 0; transform: scale(0.5) translateY(-40px) rotate(180deg); }
}

/* Burst tile animation — spring in from nothing */
.demo-burst-tile {
  aspect-ratio: 1; border-radius: 18px; display: flex; flex-direction: column;
  overflow: hidden; cursor: pointer;
  animation: demoBurstIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.demo-burst-tile .demo-tile-emoji { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 60px; }
.demo-burst-tile .demo-tile-label { background: rgba(0,0,0,0.2); padding: 8px 5px; text-align: center; font-size: 0.75rem; font-weight: 800; color: #fff; text-transform: uppercase; }
@keyframes demoBurstIn {
  0% { opacity: 0; transform: scale(0.2) rotate(-10deg); }
  60% { opacity: 1; transform: scale(1.1) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Demo QR phone scan (from tinkyspeak.com/schools) */
.dqr-phone { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.dqr-phone::before, .dqr-phone::after, .dqr-corner::before, .dqr-corner::after {
  content: ''; position: absolute; width: 36px; height: 36px;
  border-color: rgba(90,171,118,0.6); border-style: solid;
}
.dqr-phone::before { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.dqr-phone::after { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.dqr-corner { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.dqr-corner::before { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.dqr-corner::after { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
.dqr-scanline {
  position: absolute; left: 20px; right: 20px; height: 3px; z-index: 7;
  background: linear-gradient(90deg, transparent, rgba(90,171,118,0.6), #5aab76, rgba(90,171,118,0.6), transparent);
  box-shadow: 0 0 12px #5aab76, 0 0 30px rgba(90,171,118,0.3);
  animation: dqrSweep 3s ease-in-out forwards;
}
@keyframes dqrSweep { 0% { top: 10px; opacity: 1; } 100% { top: 85%; opacity: 0.3; } }
.dqr-indicator {
  position: absolute; top: 8px; right: 14px; display: flex; align-items: center; gap: 6px; z-index: 6;
}
.dqr-indicator::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: #5aab76; animation: dqrBlink 1s ease infinite;
}
.dqr-indicator-text { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em; color: rgba(255,255,255,0.5); }
@keyframes dqrBlink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0.3; } }
.dqr-flash {
  position: absolute; inset: 0; background: #5aab76;
  border-radius: 16px; opacity: 0; z-index: 10; pointer-events: none;
}

/* Legacy QR scan animation */
.demo-qr-frame { position: relative; width: 200px; height: 200px; display: flex; align-items: center; justify-content: center; }
.demo-qr-corner { position: absolute; width: 28px; height: 28px; border-color: #e8a33d; border-style: solid; }
.demo-qr-tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.demo-qr-tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.demo-qr-bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.demo-qr-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
.demo-qr-scanline {
  position: absolute; left: 20px; right: 20px; height: 3px;
  background: linear-gradient(90deg, transparent, rgba(232,163,61,0.5), #e8a33d, rgba(232,163,61,0.5), transparent);
  border-radius: 2px; z-index: 7;
  box-shadow: 0 0 12px #e8a33d, 0 0 30px rgba(232,163,61,0.3);
  animation: demoScanSweep 3s ease infinite;
}
.demo-qr-indicator { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.demo-qr-dot { width: 6px; height: 6px; border-radius: 50%; background: #e8a33d; animation: demoScanBlink 1s ease infinite; }
.demo-qr-text { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em; color: rgba(255,255,255,0.5); }
@keyframes demoScanSweep {
  0% { top: 10px; opacity: 0; }
  5% { top: 10px; opacity: 1; }
  45% { top: 170px; opacity: 1; }
  50% { top: 180px; opacity: 0; }
  100% { top: 180px; opacity: 0; }
}
@keyframes demoScanBlink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0.3; } }
.demo-flash {
  grid-column: 1 / -1; min-height: 200px;
  background: radial-gradient(circle, rgba(232,163,61,0.6) 0%, transparent 70%);
  animation: demoFlashPulse 0.8s ease-out forwards;
}
@keyframes demoFlashPulse {
  0% { opacity: 0; transform: scale(0.5); }
  30% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* Glow thread — connects sentence bar to tiles */
.sentence-bar-wrap::after {
  content: ''; display: block; height: 0; transition: height 0.5s ease;
}
.demo-glow .sentence-bar {
  box-shadow: 0 4px 20px rgba(232,163,61,0.3);
  transition: box-shadow 0.5s ease;
}

/* ── Full-screen overlay ── */
.demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, background 0.8s ease;
}
.demo-dark {
  background: #000;
}
.demo-glass {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.demo-transparent {
  background: transparent;
  pointer-events: none;
}
.demo-transparent .demo-skip-btn {
  pointer-events: auto;
}

/* ── Fade animations ── */
.demo-fade-in {
  animation: demoFadeIn 0.8s ease forwards;
  opacity: 0;
}
.demo-delay-1 { animation-delay: 0.5s; }
.demo-delay-2 { animation-delay: 1.2s; }
.demo-delay-3 { animation-delay: 1.8s; }
.demo-delay-4 { animation-delay: 2.4s; }

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

.demo-fade-out {
  animation: demoFadeOut 0.5s ease forwards;
}
@keyframes demoFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ── Center column layout ── */
.demo-center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  max-width: 480px;
}

/* ── Step 0: The darkness ── */
.demo-headline {
  font-family: var(--f-sans);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1.2rem;
}
.demo-subline {
  font-family: var(--f-sans);
  font-size: 1.15rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 2rem;
}
.demo-tap-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ── Step 1-4: Prompts ── */
.demo-prompt {
  font-family: var(--f-sans);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--amber);
  margin-bottom: 0.8rem;
}
.demo-sub {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

/* ── Demo card (explanation overlay) ── */
.demo-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2rem 2.2rem;
  max-width: 400px;
  text-align: left;
}
.demo-card-title {
  font-family: var(--f-sans);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.8rem;
  letter-spacing: -0.01em;
}
.demo-card-body {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.demo-card-accent {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 1.4rem;
  font-style: italic;
}
.demo-card-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--amber);
  color: #000;
  font-family: var(--f-sans);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}
.demo-card-btn:hover {
  transform: scale(1.02);
}
.demo-card-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* ── Step 5: The reveal ── */
.demo-reveal-line {
  font-family: var(--f-sans);
  font-size: 1.8rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.2rem;
  letter-spacing: -0.01em;
}
.demo-final-reveal {
  font-family: var(--f-sans);
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}
.demo-tagline {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--amber);
  margin-bottom: 2.4rem;
  letter-spacing: 0.02em;
}
.demo-start-btn {
  padding: 16px 64px;
  border: none;
  border-radius: 14px;
  background: var(--amber);
  color: #000;
  font-family: var(--f-sans);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.demo-start-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 24px rgba(232, 163, 61, 0.3);
}

/* ── Skip button ── */
.demo-skip-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10001;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.4);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--f-sans);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.demo-skip-btn:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ── Floating prompt (shown during interactive steps) ── */
.demo-floating-prompt {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  background: var(--amber);
  color: #000;
  padding: 10px 24px;
  border-radius: 12px;
  font-family: var(--f-sans);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(232, 163, 61, 0.4);
  pointer-events: none;
  white-space: nowrap;
}

/* ── Element highlight (pulsing ring) ── */
.demo-highlight {
  outline: 2px solid var(--amber) !important;
  outline-offset: 3px;
  animation: demoPulse 1.5s ease-in-out infinite;
  position: relative;
  z-index: 10001;
}
@keyframes demoPulse {
  0%, 100% { outline-color: var(--amber); }
  50% { outline-color: rgba(232, 163, 61, 0.3); }
}

/* ── Tooltip (below highlighted elements) ── */
.demo-tooltip {
  z-index: 10003;
  background: var(--amber);
  color: #000;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--f-sans);
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Mobile adjustments ── */
@media (max-width: 600px) {
  .demo-headline { font-size: 1.6rem; }
  .demo-card { padding: 1.5rem; margin: 0 1rem; }
  .demo-card-title { font-size: 1.2rem; }
  .demo-reveal-line { font-size: 1.4rem; }
  .demo-final-reveal { font-size: 2rem; }
  .demo-floating-prompt { top: 80px; font-size: 0.75rem; padding: 8px 16px; }
}

/* ═══ Voice Mode Indicator ═══ */
.voice-mode-indicator {
  position: fixed; bottom: 140px; left: 50%; transform: translateX(-50%);
  background: rgba(232,163,61,0.2); border: 1px solid rgba(232,163,61,0.4);
  color: #e8a33d; padding: 6px 16px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 600; z-index: 100;
  animation: voicePulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes voicePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ═══ Restaurant Entry Overlay ═══ */
#restaurantEntryOverlay {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  animation: restEntryFadeIn 0.25s ease;
}
@keyframes restEntryFadeIn { from { opacity: 0; } to { opacity: 1; } }
.rest-entry-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 6, 12, 0.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.rest-entry-card {
  position: relative;
  width: min(460px, 92vw);
  max-height: 92vh; overflow-y: auto;
  background: linear-gradient(180deg, #1a1620, #120f18);
  border: 1px solid rgba(232,163,61,0.25);
  border-radius: 20px;
  padding: 28px 26px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(232,163,61,0.08);
  color: #fff;
}
.rest-entry-close {
  position: absolute; top: 10px; right: 14px;
  background: transparent; border: none; color: rgba(255,255,255,0.5);
  font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 4px 10px;
  border-radius: 50%; transition: background 0.2s, color 0.2s;
}
.rest-entry-close:hover { background: rgba(255,255,255,0.08); color: #fff; }
.rest-entry-title {
  font-size: 1.35rem; font-weight: 700;
  margin-bottom: 6px; color: #e8a33d;
}
.rest-entry-sub {
  font-size: 0.88rem; color: rgba(255,255,255,0.65);
  margin-bottom: 18px; line-height: 1.45;
}
.rest-entry-scan-btn {
  width: 100%; padding: 14px 18px;
  background: linear-gradient(135deg, #e8a33d, #d48a2a);
  color: #18121b; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(232,163,61,0.3);
  transition: transform 0.15s, box-shadow 0.2s;
}
.rest-entry-scan-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(232,163,61,0.4); }
.rest-entry-scan-btn:active { transform: translateY(0); }
#restScanBox {
  position: relative;
  margin-top: 16px;
  border-radius: 14px; overflow: hidden;
  background: #000;
  aspect-ratio: 4 / 3;
  border: 2px solid rgba(232,163,61,0.4);
}
#restScanVideo { width: 100%; height: 100%; object-fit: cover; display: block; }
.rest-scan-reticle {
  position: absolute; top: 50%; left: 50%;
  width: 60%; aspect-ratio: 1;
  transform: translate(-50%,-50%);
  border: 3px solid rgba(232,163,61,0.9);
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.35);
  pointer-events: none;
  animation: restReticlePulse 1.6s ease-in-out infinite;
}
@keyframes restReticlePulse { 0%,100% { box-shadow: 0 0 0 9999px rgba(0,0,0,0.35), 0 0 24px rgba(232,163,61,0.5); } 50% { box-shadow: 0 0 0 9999px rgba(0,0,0,0.35), 0 0 40px rgba(232,163,61,0.9); } }
.rest-entry-or {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 14px;
  color: rgba(255,255,255,0.4);
  font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.rest-entry-or::before, .rest-entry-or::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.1);
}
.rest-entry-url-row { display: flex; gap: 8px; }
#restEntryUrl {
  flex: 1; padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s, background 0.2s;
}
#restEntryUrl:focus { border-color: rgba(232,163,61,0.5); background: rgba(255,255,255,0.08); }
#restEntryUrl::placeholder { color: rgba(255,255,255,0.35); }
#restEntryBuildBtn {
  padding: 12px 20px;
  background: rgba(232,163,61,0.15);
  color: #e8a33d;
  border: 1px solid rgba(232,163,61,0.4);
  border-radius: 10px;
  font-weight: 700; font-size: 0.88rem; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
#restEntryBuildBtn:hover { background: rgba(232,163,61,0.25); }
#restEntryBuildBtn:active { transform: scale(0.96); }
.rest-entry-status {
  margin-top: 14px;
  font-size: 0.85rem; line-height: 1.4;
  color: rgba(255,255,255,0.7);
  min-height: 1.2em;
}

/* Typewriter caret for demo staff bubbles */
.tw-caret {
  display: inline-block;
  margin-left: 1px;
  color: #e8a33d;
  animation: twCaretBlink 0.9s steps(1) infinite;
}
@keyframes twCaretBlink { 50% { opacity: 0; } }

/* Shopping entry overlay — reuses .rest-entry-* classes; only the
   scan box uses a distinct id because #restScanBox is id-scoped. */
#shoppingEntryOverlay {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  animation: restEntryFadeIn 0.25s ease;
}
#shopScanBox {
  position: relative;
  margin-top: 16px;
  border-radius: 14px; overflow: hidden;
  background: #000;
  aspect-ratio: 4 / 3;
  border: 2px solid rgba(232,163,61,0.4);
}
#shopScanVideo { width: 100%; height: 100%; object-fit: cover; display: block; }
#shopEntryUrl {
  flex: 1; padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s, background 0.2s;
}
#shopEntryUrl:focus { border-color: rgba(232,163,61,0.5); background: rgba(255,255,255,0.08); }
#shopEntryUrl::placeholder { color: rgba(255,255,255,0.35); }
#shopEntryBuildBtn {
  padding: 12px 20px;
  background: rgba(232,163,61,0.15);
  color: #e8a33d;
  border: 1px solid rgba(232,163,61,0.4);
  border-radius: 10px;
  font-weight: 700; font-size: 0.88rem; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
#shopEntryBuildBtn:hover { background: rgba(232,163,61,0.25); }
#shopEntryBuildBtn:active { transform: scale(0.96); }

/* ── Shop Anywhere — retailer picker + search ─────────────── */
.shop-entry-card { max-width: 680px; }
.shop-retailer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.shop-retailer-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 14px 8px;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  font-weight: 700; cursor: pointer;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
  min-height: 86px;
}
.shop-retailer-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.04);
}
.shop-retailer-btn.selected {
  background: rgba(232,163,61,0.08);
  box-shadow: 0 0 0 3px rgba(232,163,61,0.35);
}
.shop-retailer-emoji { font-size: 1.8rem; line-height: 1; }
.shop-retailer-name { font-size: 0.78rem; }

.shop-search-row {
  display: flex; gap: 8px; margin: 10px 0 6px;
}
#shopSearchInput {
  flex: 1; padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  color: #fff; font-size: 0.95rem;
}
#shopSearchInput::placeholder { color: rgba(255,255,255,0.35); }
#shopSearchBtn {
  padding: 12px 22px;
  background: #e8a33d; color: #1b1b1b;
  border: none; border-radius: 10px;
  font-weight: 800; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
#shopSearchBtn:hover { background: #f3b352; }
#shopSearchBtn:active { transform: scale(0.96); }

.shop-mylist-row { margin: 8px 0 4px; }
.shop-mylist-btn {
  width: 100%; padding: 11px;
  background: rgba(102,187,106,0.12);
  color: #81c784;
  border: 1px solid rgba(102,187,106,0.35);
  border-radius: 10px;
  font-weight: 700; font-size: 0.9rem; cursor: pointer;
  transition: background 0.2s;
}
.shop-mylist-btn:hover { background: rgba(102,187,106,0.2); }

.shop-scan-box { margin-top: 10px; position: relative; border-radius: 10px; overflow: hidden; }
.shop-scan-box video { width: 100%; display: block; }

/* ── Cart badge on SHOPPING tile ──────────────────────────── */
.shop-cart-badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 22px; height: 22px; padding: 0 6px;
  background: #ef5350; color: #fff;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  z-index: 5;
}

/* ── Product action sheet ─────────────────────────────────── */
.shop-action-sheet-overlay {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: flex-end; justify-content: center;
}
.shop-action-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
.shop-action-sheet-card {
  position: relative;
  width: 100%; max-width: 460px;
  background: #1f1f24;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px 18px 0 0;
  padding: 22px 18px 26px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.5);
  animation: shopSheetUp 0.25s ease;
}
@keyframes shopSheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.shop-action-sheet-close {
  position: absolute; top: 8px; right: 12px;
  background: transparent; border: none; color: rgba(255,255,255,0.6);
  font-size: 1.6rem; cursor: pointer;
}
.shop-action-sheet-title {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding-right: 26px;
}
.shop-action-sheet-emoji { font-size: 2rem; }
.shop-action-sheet-name { color: #fff; font-weight: 700; font-size: 1.05rem; flex: 1; }
.shop-action-btn {
  display: block; width: 100%;
  padding: 14px 16px; margin-bottom: 8px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  font-size: 1rem; font-weight: 700; text-align: left;
  cursor: pointer; transition: background 0.15s;
}
.shop-action-btn:hover { background: rgba(255,255,255,0.12); }
.shop-action-add { background: rgba(67,160,71,0.15); border-color: rgba(67,160,71,0.4); color: #81c784; }
.shop-action-add:hover { background: rgba(67,160,71,0.25); }
.shop-action-open { background: rgba(25,118,210,0.15); border-color: rgba(25,118,210,0.4); color: #64b5f6; }
.shop-action-open:hover { background: rgba(25,118,210,0.25); }
.shop-action-ask { background: rgba(156,39,176,0.12); border-color: rgba(156,39,176,0.35); color: #ba68c8; }
.shop-action-ask:hover { background: rgba(156,39,176,0.22); }

/* ── Shopping list overlay ────────────────────────────────── */
.shop-list-overlay {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: center; justify-content: center;
}
.shop-list-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.shop-list-card {
  position: relative;
  width: 92%; max-width: 520px; max-height: 86vh;
  background: #1f1f24;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  overflow-y: auto;
}
.shop-list-close {
  position: absolute; top: 8px; right: 12px;
  background: transparent; border: none; color: rgba(255,255,255,0.6);
  font-size: 1.6rem; cursor: pointer;
}
.shop-list-title {
  color: #fff; font-size: 1.2rem; font-weight: 800;
  margin-bottom: 14px; padding-right: 26px;
}
.shop-list-rows { margin-bottom: 14px; }
.shop-list-empty {
  padding: 30px 10px; text-align: center;
  color: rgba(255,255,255,0.6);
}
.shop-list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.shop-list-emoji { font-size: 1.6rem; }
.shop-list-body { flex: 1; min-width: 0; }
.shop-list-name { color: #fff; font-weight: 700; font-size: 0.92rem; }
.shop-list-name small { font-weight: 400; color: rgba(255,255,255,0.6); }
.shop-list-price { color: #81c784; font-size: 0.82rem; margin-top: 2px; }
.shop-list-open, .shop-list-del {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 34px; height: 34px; border-radius: 8px;
  cursor: pointer; font-size: 1rem;
}
.shop-list-open { color: #64b5f6; border-color: rgba(25,118,210,0.4); }
.shop-list-del { color: #ef5350; border-color: rgba(239,83,80,0.4); font-size: 1.3rem; }
.shop-list-total {
  padding: 10px 8px; margin-top: 6px;
  color: #fff; font-size: 1rem; text-align: right;
}
.shop-list-actions { display: flex; flex-direction: column; gap: 8px; }
.shop-list-speak-all, .shop-list-open-all, .shop-list-clear {
  padding: 12px; border-radius: 10px;
  font-weight: 700; font-size: 0.9rem; cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s;
}
.shop-list-speak-all {
  background: rgba(232,163,61,0.15); color: #e8a33d;
  border-color: rgba(232,163,61,0.4);
}
.shop-list-speak-all:hover { background: rgba(232,163,61,0.25); }
.shop-list-open-all {
  background: rgba(25,118,210,0.15); color: #64b5f6;
  border-color: rgba(25,118,210,0.4);
}
.shop-list-open-all:hover { background: rgba(25,118,210,0.25); }
.shop-list-clear {
  background: rgba(239,83,80,0.12); color: #ef5350;
  border-color: rgba(239,83,80,0.35);
}
.shop-list-clear:hover { background: rgba(239,83,80,0.2); }

/* ── Toast ────────────────────────────────────────────────── */
.shop-toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,34,0.96);
  color: #fff;
  padding: 12px 22px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.12);
  font-weight: 700; font-size: 0.92rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 10060;
  pointer-events: none;
}
.shop-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Demo end-of-flow handout + QR buttons ───────────────── */
.demo-handout-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 24px auto 10px;
}
.demo-qr-btn {
  background: linear-gradient(135deg, #3b9eff 0%, #64b5f6 100%) !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(59,158,255,0.35) !important;
}
.demo-qr-btn:hover {
  box-shadow: 0 10px 26px rgba(59,158,255,0.45) !important;
}

/* ── QR Code Modal Overlay ───────────────────────────────── */
.demo-qr-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 8, 12, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
  padding: 20px;
  animation: demoQrFade 0.2s ease-out;
}
@keyframes demoQrFade { from { opacity: 0; } to { opacity: 1; } }
.demo-qr-card {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 28px 28px 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 30px 90px rgba(0,0,0,0.6);
  text-align: center;
  animation: demoQrPop 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes demoQrPop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.demo-qr-close {
  position: absolute; top: 12px; right: 14px;
  width: 36px; height: 36px;
  border: none; background: #f0f0f0; color: #333;
  font-size: 18px; font-weight: 700;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.demo-qr-close:hover { background: #e2e2e2; }
.demo-qr-title {
  font-size: 1.15rem; font-weight: 700;
  color: #1b1b1b; margin-bottom: 16px;
}
.demo-qr-img {
  display: block;
  width: 100%; max-width: 340px;
  height: auto;
  margin: 0 auto 14px;
  border-radius: 12px;
  image-rendering: pixelated;
}
.demo-qr-url {
  font-size: 0.78rem; color: #666;
  word-break: break-all;
  margin-bottom: 18px;
  font-family: ui-monospace, Menlo, monospace;
}
.demo-qr-save {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, #3b9eff 0%, #64b5f6 100%);
  color: #fff;
  border: none; border-radius: 12px;
  font-size: 0.95rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59,158,255,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.demo-qr-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(59,158,255,0.45);
}
@media (max-width: 600px) {
  .demo-qr-card { padding: 24px 18px 20px; }
  .demo-qr-title { font-size: 1rem; }
  .demo-qr-url { font-size: 0.7rem; }
}

/* ── Demo "Download Handout PDF" button ───────────────────── */
.demo-pdf-btn {
  display: inline-block;
  margin: 0;
  padding: 14px 28px;
  background: linear-gradient(135deg, #e8a33d 0%, #f3b352 100%);
  color: #1b1b1b;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(232,163,61,0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}
.demo-pdf-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(232,163,61,0.45);
}
.demo-pdf-btn:active { transform: scale(0.97); }
.demo-pdf-btn:disabled { opacity: 0.7; cursor: wait; }

/* Brain-thinking indicator shown in the tile grid while AI follow-ups load */
.tiles-thinking {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 14px;
}
.tiles-thinking-brain {
  font-size: 4.5rem;
  animation: thinkingPulse 1.4s ease-in-out infinite;
}
.tiles-thinking-label {
  color: #e8a33d;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.85;
}
@keyframes thinkingPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 1; }
}
