:root {
    --brand: #FF6B35;
    --ink: #1A1A2E;
    --bg: #FAFAFA;
    --ia: #6366F1;
    --line: #ECECEF;
    --muted: #6B7280;
  }
  * { -webkit-tap-highlight-color: transparent; }

  /* Essencial para navegação: NÃO depender do Tailwind CDN.
     Sem esta regra, todas as telas ficam visíveis ao mesmo tempo. */
  .hidden { display: none !important; }

  html, body { height: 100%; }
  body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: #E9E9EC;
    color: var(--ink);
    display: flex;
    justify-content: center;
  }
  #app {
    width: 100%;
    max-width: 480px;
    min-height: 100dvh;
    background: var(--bg);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0,0,0,.08);
  }

  /* ---------- Telas ---------- */
  .screen { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--bg); z-index: 10; }
  .screen.active { display: flex; animation: fadeIn .3s ease-out; }
  .screen.overlay { z-index: 20; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  @keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

  .scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 92px; }
  .pad { padding: 0 20px; }

  /* ---------- Componentes ---------- */
  .btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; border-radius: 999px; font-weight: 600; font-size: 15px;
    border: 0; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s;
    width: 100%;
  }
  .btn:active { transform: scale(.97); }
  .btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -8px rgba(255,107,53,.7); }
  .btn-ink { background: var(--ink); color: #fff; }
  .btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
  .btn-ia { background: var(--ia); color: #fff; box-shadow: 0 8px 20px -8px rgba(99,102,241,.7); }

  .card { background: #fff; border: 1px solid var(--line); border-radius: 16px; }
  .chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px; border-radius: 999px; background: #fff;
    border: 1px solid var(--line); font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all .2s; white-space: nowrap;
  }
  .chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
  .chip.on-brand { background: var(--brand); color: #fff; border-color: var(--brand); }

  .badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
  .badge-open { background: #E7F8F4; color: #0E9F8E; }
  .badge-closed { background: #F3F4F6; color: #6B7280; }
  .badge-cat { background: #FFF1EB; color: var(--brand); }
  .badge-premium { background: #EEF0FF; color: var(--ia); }

  .field {
    width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--line);
    background: #fff; padding: 0 16px; font-size: 15px; color: var(--ink); outline: none;
    transition: border .2s, box-shadow .2s;
  }
  .field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,107,53,.14); }

  .section-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

  /* ---------- Bottom nav ---------- */
  .bottom-nav {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgba(255,255,255,.94); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 8px 6px calc(10px + env(safe-area-inset-bottom));
  }
  .nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: 0; cursor: pointer; color: #9CA3AF;
    font-size: 11px; font-weight: 600; padding: 6px 2px; border-radius: 12px;
    transition: color .2s, transform .15s;
  }
  .nav-item:active { transform: scale(.94); }
  .nav-item.on { color: var(--brand); }
  .nav-item.ia.on { color: var(--ia); }
  .nav-item .dot { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
  .nav-item.on .dot { background: currentColor; }

  /* ---------- Splash ---------- */
  #scr-splash { background: linear-gradient(160deg, #1A1A2E 0%, #26264A 55%, #3B2E63 100%); color: #fff; align-items: center; justify-content: center; text-align: center; padding: 32px; }
  .radar-logo { position: relative; width: 128px; height: 128px; margin: 0 auto 28px; }
  .radar-ring { position: absolute; inset: 0; border: 2px solid rgba(255,255,255,.18); border-radius: 50%; }
  .radar-ring:nth-child(2) { inset: 18px; }
  .radar-ring:nth-child(3) { inset: 38px; }
  .radar-sweep {
    position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(255,107,53,.85), rgba(255,107,53,0) 32%);
    animation: sweep 3.2s linear infinite;
    -webkit-mask: radial-gradient(circle, transparent 12%, #000 13%);
            mask: radial-gradient(circle, transparent 12%, #000 13%);
  }
  .radar-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #2EC4B6; top: 34%; left: 62%; box-shadow: 0 0 12px #2EC4B6; animation: blink 1.6s ease-in-out infinite; }
  @keyframes sweep { to { transform: rotate(360deg); } }
  @keyframes blink { 0%,100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

  /* ---------- Categorias ---------- */
  .cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cat-item {
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
    padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink);
    transition: transform .15s, box-shadow .2s, border-color .2s;
  }
  .cat-item:active { transform: scale(.95); }
  .cat-item:hover { box-shadow: 0 8px 18px -12px rgba(0,0,0,.25); border-color: #FFD9C7; }
  .cat-item .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: #FFF1EB; }

  /* ---------- Cards de lugar ---------- */
  .place-card {
    display: flex; gap: 12px; background: #fff; border: 1px solid var(--line);
    border-radius: 16px; padding: 14px; cursor: pointer; margin-bottom: 10px;
    transition: transform .15s, box-shadow .2s; position: relative;
  }
  .place-card:active { transform: scale(.985); }
  .place-card:hover { box-shadow: 0 10px 24px -18px rgba(0,0,0,.4); }
  .place-thumb {
    width: 56px; height: 56px; border-radius: 14px; flex: none;
    display: grid; place-items: center; font-size: 22px;
    background: linear-gradient(135deg, #FFF1EB, #EEF0FF);
  }
  .place-name { font-size: 15px; font-weight: 700; line-height: 1.25; }
  .place-desc { font-size: 13px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .meta-row { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--muted); margin-top: 6px; align-items: center; }

  /* ---------- Horizontal "agora" ---------- */
  .h-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 20px 6px; scroll-snap-type: x mandatory; }
  .h-scroll::-webkit-scrollbar { display: none; }
  .now-card {
    flex: 0 0 232px; scroll-snap-align: start; background: #fff; border: 1px solid var(--line);
    border-radius: 16px; padding: 14px; cursor: pointer; transition: transform .15s;
  }
  .now-card:active { transform: scale(.97); }

  /* ---------- Mordomo ---------- */
  #page-mordomo { display: flex; flex-direction: column; height: 100%; }
  .mordomo-head {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 60%, #A855F7 100%);
    color: #fff; padding: 18px 20px 22px; border-radius: 0 0 24px 24px;
  }
  .avatar-mordomo {
    width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.2);
    display: grid; place-items: center; font-size: 22px; border: 1px solid rgba(255,255,255,.35);
    animation: float 3s ease-in-out infinite;
  }
  @keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
  .chat-area { flex: 1; overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
  .bubble { max-width: 84%; padding: 12px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; animation: slideUp .3s ease-out; }
  .bubble.mordomo { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; align-self: flex-start; }
  .bubble.user { background: var(--ink); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
  .bubble .mini-title { font-weight: 700; font-size: 13px; margin-top: 8px; color: var(--ia); }
  .bubble ul { margin: 6px 0 0; padding-left: 0; list-style: none; }
  .bubble li { font-size: 13px; padding: 5px 0; border-top: 1px dashed var(--line); }
  .chat-input-bar { display: flex; gap: 8px; padding: 10px 14px 14px; background: var(--bg); border-top: 1px solid var(--line); align-items: center; }
  .mic-btn {
    width: 54px; height: 54px; border-radius: 50%; border: 0; flex: none; cursor: pointer;
    background: var(--ia); color: #fff; display: grid; place-items: center;
    box-shadow: 0 10px 24px -10px rgba(99,102,241,.8); transition: transform .15s, background .2s;
  }
  .mic-btn:active { transform: scale(.94); }
  .mic-btn.listening { background: var(--brand); animation: pulse 1.1s ease-in-out infinite; }
  @keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,107,53,.55); } 50% { box-shadow: 0 0 0 14px rgba(255,107,53,0); } }
  .wave { display: none; align-items: flex-end; gap: 3px; height: 22px; position: absolute; left: -46px; bottom: 4px; }
  .wave.on { display: flex; }
  .wave span { width: 4px; background: var(--brand); border-radius: 2px; animation: wv .9s ease-in-out infinite; }
  .wave span:nth-child(1) { animation-delay: 0s; height: 30%; }
  .wave span:nth-child(2) { animation-delay: .15s; height: 70%; }
  .wave span:nth-child(3) { animation-delay: .3s; height: 45%; }
  .wave span:nth-child(4) { animation-delay: .45s; height: 90%; }
  .wave span:nth-child(5) { animation-delay: .6s; height: 55%; }
  @keyframes wv { 0%,100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
  .typing { display: inline-flex; gap: 4px; align-items: center; }
  .typing i { width: 7px; height: 7px; border-radius: 50%; background: #C7C7CC; animation: tp 1s infinite; }
  .typing i:nth-child(2) { animation-delay: .2s; }
  .typing i:nth-child(3) { animation-delay: .4s; }
  @keyframes tp { 0%,100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

  /* ---------- Detalhes ---------- */
  .hero {
    height: 168px; background: linear-gradient(135deg, #1A1A2E, #3B2E63 70%, #6366F1);
    position: relative; display: flex; align-items: flex-end; padding: 18px; color: #fff;
  }
  .icon-btn {
    width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.92);
    display: grid; place-items: center; border: 0; cursor: pointer; color: var(--ink);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
  }
  .lock-box {
    background: linear-gradient(135deg, #EEF0FF, #F5F3FF); border: 1px dashed #C7D2FE;
    border-radius: 16px; padding: 16px; color: #4338CA;
  }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .info-tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
  .info-tile .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
  .info-tile .v { font-size: 14px; font-weight: 600; margin-top: 4px; line-height: 1.3; }

  /* ---------- Toast ---------- */
  #toast {
    position: absolute; left: 50%; bottom: 104px; transform: translate(-50%, 20px);
    background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
    font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none;
    transition: all .3s ease; z-index: 60; white-space: nowrap; max-width: 90%;
  }
  #toast.on { opacity: 1; transform: translate(-50%, 0); }

  .empty { text-align: center; padding: 48px 24px; color: var(--muted); }
  .empty .emoji { font-size: 44px; margin-bottom: 12px; }
  .skeleton { background: linear-gradient(90deg, #F1F1F4 25%, #E7E7EC 37%, #F1F1F4 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 12px; }
  @keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

  /* ==========================================================
     v3 — PWA, B2B, VOZ E SKELETON
     ========================================================== */

  /* Splash: pulso único de 1,5s antes do botão */
  @keyframes splashPulse {
    0%   { opacity: 0; transform: scale(.88); }
    60%  { opacity: 1; transform: scale(1.04); }
    100% { opacity: 1; transform: scale(1); }
  }
  .splash-pulse { animation: splashPulse 1.5s ease-out both; }
  #btn-start { animation: fadeIn .4s ease-out 1.5s both; }

  /* --- Bottom Sheet B2B --- */
  .sheet-overlay {
    position: absolute; inset: 0; z-index: 70;
    background: rgba(26,26,46,.5);
    display: flex; align-items: flex-end;
    animation: fadeIn .25s ease-out both;
  }
  .sheet {
    width: 100%; max-height: 90%; overflow-y: auto;
    background: #fff; border-radius: 24px 24px 0 0;
    padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
    position: relative;
    animation: slideUp .3s ease-in-out both;
    box-shadow: 0 -12px 40px rgba(0,0,0,.18);
  }
  .sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: #D1D5DB; margin: 0 auto 18px; }
  .sheet-close {
    position: absolute; top: 14px; right: 16px;
    width: 34px; height: 34px; border-radius: 50%;
    border: 0; background: #F3F4F6; color: #6B7280;
    font-size: 22px; line-height: 1; cursor: pointer;
    display: grid; place-items: center;
  }
  .sheet .field { background: var(--bg); }
  .sheet button[type="submit"] { transition: transform .3s ease-in-out, opacity .3s ease-in-out; }
  .sheet button[type="submit"]:disabled { opacity: .6; cursor: not-allowed; }

  /* --- Link discreto B2B --- */
  .b2b-link {
    display: block; width: 100%; margin-top: 14px; padding: 12px;
    background: transparent; border: 1px dashed #D1D5DB;
    border-radius: 12px; font-size: 12px; font-weight: 600;
    color: var(--muted); cursor: pointer;
    transition: all .3s ease-in-out;
  }
  .b2b-link:hover { border-color: var(--brand); color: var(--brand); background: #FFF8F5; }
  .b2b-link:active { transform: scale(.98); }

  /* --- Indicador: Mordomo falando --- */
  @keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.38); transform: scale(1); }
    50%      { box-shadow: 0 0 0 12px rgba(255,255,255,0); transform: scale(1.06); }
  }
  .avatar-mordomo.falando { animation: voicePulse 1s ease-in-out infinite; }
  .mordomo-head .wave.falando-wave { position: static; display: flex; margin-left: auto; height: 20px; }
  .mordomo-head .wave.falando-wave span { background: #fff; }
  .mic-btn.desabilitado { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }

  /* --- Skeleton cards --- */
  .skeleton-card {
    display: flex; gap: 12px; padding: 14px;
    background: #fff; border: 1px solid var(--line);
    border-radius: 16px; margin-bottom: 10px;
  }
  .skeleton-card .sk-thumb { width: 56px; height: 56px; border-radius: 14px; flex: none; }
  .skeleton-card .sk-lines { flex: 1; }
  .skeleton-card .sk-line { height: 12px; border-radius: 6px; margin-bottom: 8px; }
  .skeleton-card .sk-line.w70 { width: 70%; }
  .skeleton-card .sk-line.w45 { width: 45%; }
  .skeleton-card .sk-line.w85 { width: 85%; }

  /* Transições suaves (300ms ease-in-out) */
  button, .cat-item, .place-card, .now-card, .chip, .b2b-link {
    transition: transform .3s ease-in-out, box-shadow .3s ease-in-out,
                background .3s ease-in-out, border-color .3s ease-in-out,
                opacity .3s ease-in-out;
  }
