/* TVDE+ · App do cliente — mesmas cores e letras do site www (src/styles/global.css) */
:root {
  --ink: #0f0f10;
  --ink-soft: #3d3d42;
  --muted: #6b6b72;
  --line: #e6e6e9;
  --paper: #ffffff;
  --cream: #f4f1ec;
  --hairline: #d9d5cd;
  --night: #0b0b0c;
  --graphite: #161618;
  --brand: #ff9019;
  --brand-dark: #8a4a00;
  --brand-soft: #fff1e2;
  --ok: #1e8e4e;
  --danger: #c62828;
  --dest: #e8341e; /* destino: vermelho do marcador https://tvdemais.b-cdn.net/marker.png */
  --font: "General Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --dur: 0.44s;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --app-h: 100dvh;
}
/* Dentro da app (BuildNatively) com a "safe area" desativada: a página ocupa o ecrã todo (o mapa vai até
   ao topo) e o sistema pode devolver 0 nas margens seguras. Garante-se um mínimo para os botões e textos não
   ficarem por baixo do relógio / Dynamic Island nem da barra inicial (classes postas por js/native.js).
   Se o sistema der um valor maior, usa-se esse. Para testar no computador: ?safe=ios ou ?safe=android */
html.is-ios-app {
  --safe-t: max(env(safe-area-inset-top, 0px), 50px);
  --safe-b: max(env(safe-area-inset-bottom, 0px), 28px);
}
/* iPhone sem notch (SE, 8…): barra de estado mais baixa e sem barra inicial */
html.is-ios-app.ios-legacy {
  --safe-t: max(env(safe-area-inset-top, 0px), 22px);
  --safe-b: max(env(safe-area-inset-bottom, 0px), 10px);
}
html.is-android-app {
  --safe-t: max(env(safe-area-inset-top, 0px), 28px);
  --safe-b: max(env(safe-area-inset-bottom, 0px), 12px);
}
:root {
  --kb: 0px; /* altura do teclado (js/ui.js) */
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body {
  position: fixed;
  inset: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input { -webkit-user-select: text; user-select: text; }
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Campos de texto: sem o contorno laranja retangular (as caixas arredondadas já mudam a borda no focus) */
input:focus, input:focus-visible, textarea:focus, textarea:focus-visible, select:focus, select:focus-visible { outline: none; }
.nowrap { white-space: nowrap; }

/* ---------- Tipografia ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-dark);
}
.eyebrow-dark { color: rgba(244, 241, 236, 0.55); }
.display {
  font-size: clamp(38px, 11.5vw, 48px);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.045em;
}
.headline {
  margin-top: 10px;
  font-size: clamp(30px, 8.6vw, 36px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.sub { margin-top: 12px; color: var(--muted); font-size: 16px; }
.sub b { color: var(--ink); font-weight: 600; }
.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.link { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hairline); }

/* ---------- Botões ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.18s var(--ease), background-color 0.2s ease, opacity 0.2s ease;
}
.btn svg { width: 20px; height: 20px; stroke-width: 2; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.32; cursor: default; }
.btn-block { width: 100%; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-brand { background: var(--brand); color: var(--ink); box-shadow: 0 10px 30px -10px rgba(255, 144, 25, 0.6); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-plain { color: var(--ink-soft); min-height: 48px; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn-brand.is-loading::after { border-color: rgba(15, 15, 16, 0.25); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Ecrãs e transições (empilhados como numa app nativa) ---------- */
.app { position: absolute; inset: 0 0 auto 0; height: var(--app-h); overflow: hidden; background: var(--night); }
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  transform: translate3d(100%, 0, 0);
  visibility: hidden;
  transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur), opacity var(--dur) ease;
}
.screen.is-active { transform: none; visibility: visible; transition: transform var(--dur) var(--ease), visibility 0s, opacity var(--dur) ease; z-index: 2; }
.screen.is-behind { transform: translate3d(-28%, 0, 0); z-index: 1; }
.screen::after { content: ""; position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); }
.screen.is-behind::after { opacity: 0.18; }
/* Transição suave (sem deslizar): splash → apresentação, entrada no ecrã principal */
.screen.fade { transform: none !important; opacity: 0; }
.screen.fade.is-active { opacity: 1; }
.screen-dark { background: var(--night); color: var(--cream); }

/* Barra de navegação dos ecrãs de formulário */
.nav {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: calc(var(--safe-t) + 6px) 12px 0;
}
.nav-back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: auto;
  border-radius: 50%;
  transition: background-color 0.15s ease;
}
.nav-back:active { background: var(--cream); }
.nav-back svg { width: 26px; height: 26px; stroke-width: 2; }
.nav-skip { margin-left: auto; min-height: 44px; padding: 0 10px; color: var(--ink-soft); font-weight: 600; font-size: 15px; }
.nav { position: relative; }
.steps { position: absolute; left: 50%; top: calc(var(--safe-t) + 32px); transform: translate(-50%, -50%); display: flex; gap: 6px; }
.steps i { width: 22px; height: 4px; border-radius: 4px; background: var(--line); transition: background-color 0.3s ease; }
.steps i.is-on { background: var(--ink); }

.body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 24px 24px;
}
/* Centrado na vertical, mas sem cortar o topo quando o conteúdo não cabe */
.body-center { display: flex; flex-direction: column; padding-top: calc(var(--safe-t) + 24px); }
.body-center > :first-child { margin-top: auto; }
.body-center > :last-child { margin-bottom: auto; }
.foot {
  flex: none;
  padding: 12px 24px calc(16px + max(var(--safe-b), 0px));
  background: linear-gradient(to top, var(--paper) 70%, rgba(255, 255, 255, 0));
}
.app.kb-open .foot { padding-bottom: 12px; }
.foot-stack { display: grid; gap: 4px; }

/* ---------- Splash ---------- */
.splash { flex: 1; display: grid; place-items: center; }
.logo { display: block; width: auto; aspect-ratio: 420 / 171; stroke: none; }
.splash-logo { height: 58px; }
.splash-logo .logo-frame { animation: splash-frame 0.9s var(--ease) both; transform-origin: 196px 85px; }
.splash-logo text { animation: splash-in 0.7s var(--ease) 0.1s both; }
.splash-logo .logo-plus { animation: splash-plus 0.8s var(--ease) 0.35s both; transform-origin: 387px 85px; }
@keyframes splash-frame { from { opacity: 0; transform: scaleX(0.6); } }
@keyframes splash-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes splash-plus { from { opacity: 0; transform: rotate(-90deg) scale(0.4); } }

/* ---------- Apresentação ---------- */
.intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    radial-gradient(120% 60% at 85% 0%, rgba(255, 144, 25, 0.16), transparent 60%),
    radial-gradient(90% 50% at 0% 35%, rgba(27, 43, 184, 0.14), transparent 65%),
    var(--night);
}
.intro-top { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 16px) 24px 0; }
.intro-logo { height: 30px; }
.made-in { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(244, 241, 236, 0.5); }
.slides {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.slides::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 24px 8px;
}
.slide .eyebrow { margin-bottom: 14px; }
.lead { margin-top: 16px; font-size: 16.5px; line-height: 1.5; color: rgba(244, 241, 236, 0.66); max-width: 34ch; }

.intro-foot { padding: 18px 24px calc(18px + var(--safe-b)); }
.dots { display: flex; gap: 6px; margin-bottom: 20px; }
.dots i { width: 6px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.22); transition: width 0.35s var(--ease), background-color 0.35s ease; }
.dots i.is-on { width: 22px; background: var(--brand); }
.legal { margin-top: 14px; font-size: 12.5px; line-height: 1.5; color: rgba(244, 241, 236, 0.45); text-align: center; }
.legal a, .legal-link { color: rgba(244, 241, 236, 0.8); text-decoration: underline; text-decoration-color: rgba(244, 241, 236, 0.3); text-underline-offset: 2px; font: inherit; }

/* Ilustrações das 3 páginas */
.art { position: relative; flex: 1; min-height: 210px; max-height: 340px; margin-bottom: 28px; }
.dav {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-weight: 600;
  font-size: 17px;
  color: #fff;
}
.dav-a { background: linear-gradient(135deg, #ff9f3d, #d96a00); }
.dav-b { background: linear-gradient(135deg, #6a7cff, #2a37b8); }
.dav-c { background: linear-gradient(135deg, #4bbf86, #1c7a4c); }
.dav-lg { width: 76px; height: 76px; font-size: 30px; }

.art-drivers { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.dcard {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.dcard-3 { opacity: 0.5; transform: scale(0.92); }
.dcard-2 { opacity: 0.75; transform: scale(0.96); }
.dcard.is-picked { background: #fff; color: var(--ink); border-color: #fff; box-shadow: 0 24px 50px -18px rgba(255, 144, 25, 0.55); }
.dtx { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.dtx b { font-weight: 600; font-size: 16px; }
.dtx i { font-style: normal; font-size: 13px; opacity: 0.62; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dpr { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.dcheck { position: absolute; top: -8px; right: -6px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--ink); box-shadow: 0 0 0 3px var(--night); }
.dcheck svg { width: 15px; height: 15px; stroke-width: 2.6; }
.slide.is-current .dcard { animation: rise 0.6s var(--ease) both; }
.slide.is-current .dcard-2 { animation-delay: 0.08s; }
.slide.is-current .dcard-1 { animation-delay: 0.16s; }
@keyframes rise { from { opacity: 0; translate: 0 18px; } }

.art-price { display: grid; place-items: center; }
.ticket {
  display: flex;
  flex-direction: column;
  width: min(100%, 290px);
  padding: 22px 22px 18px;
  border-radius: 26px;
  background: linear-gradient(160deg, #1d1d20, #121214);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.9);
}
.ticket-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(244, 241, 236, 0.5); }
.ticket-price { margin-top: 6px; font-size: 60px; font-weight: 600; letter-spacing: -0.05em; line-height: 1; color: #fff; }
.ticket-price small { font-size: 34px; color: rgba(255, 255, 255, 0.6); }
.ticket-route { display: flex; align-items: center; gap: 8px; margin-top: 20px; font-size: 13.5px; color: rgba(244, 241, 236, 0.75); white-space: nowrap; }
.tdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.tdot-end { background: var(--brand); }
.tline { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 4px, transparent 4px 8px); }
.ticket-foot { margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(255, 255, 255, 0.14); font-size: 13px; color: rgba(244, 241, 236, 0.55); }
.lock { position: absolute; top: 12%; right: 12%; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: var(--brand); color: var(--ink); box-shadow: 0 16px 40px -10px rgba(255, 144, 25, 0.7); transform: rotate(10deg); }
.lock svg { width: 26px; height: 26px; stroke-width: 2; }
.slide.is-current .ticket { animation: rise 0.6s var(--ease) both; }
.slide.is-current .lock { animation: pop 0.6s var(--ease) 0.25s both; }
@keyframes pop { from { opacity: 0; transform: rotate(-20deg) scale(0.5); } }

.art-again { display: grid; place-items: center; }
.again-ring { position: absolute; width: 230px; height: 230px; border-radius: 50%; border: 1px solid rgba(255, 144, 25, 0.25); animation: ring 3.2s ease-out infinite; }
.again-ring-2 { animation-delay: 1.6s; }
@keyframes ring { from { transform: scale(0.55); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.again-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 28px 20px;
  border-radius: 26px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9);
}
.again-card b { margin-top: 8px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.again-tag { padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12.5px; font-weight: 600; }
.again-near { margin-top: 2px; font-size: 13px; color: var(--muted); }

/* ---------- Telemóvel ---------- */
.phone-field {
  display: flex;
  align-items: stretch;
  margin-top: 28px;
  height: 64px;
  border-radius: 18px;
  background: var(--cream);
  border: 1.5px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.phone-field:focus-within { border-color: var(--ink); background: #fff; }
.phone-field.is-error { border-color: var(--danger); }
.cc { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 16px; border-right: 1px solid var(--hairline); font-size: 18px; font-weight: 600; }
.cc-flag { font-size: 22px; line-height: 1; }
.cc svg { width: 18px; height: 18px; color: var(--muted); }
.phone-input {
  flex: 1;
  min-width: 0;
  padding: 0 16px;
  border: 0;
  background: transparent;
  font: 600 21px var(--font);
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.phone-input::placeholder { color: #b4b0a8; font-weight: 500; }
.field-error { min-height: 22px; margin-top: 10px; font-size: 14.5px; color: var(--danger); }

/* ---------- Código (OTP) ---------- */
.otp { position: relative; display: block; margin-top: 30px; }
.otp-input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  border: 0;
  font-size: 16px; /* evita zoom do iOS */
  color: transparent;
  caret-color: transparent;
  z-index: 2;
}
.otp-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-cells i {
  position: relative;
  display: grid;
  place-items: center;
  height: 64px;
  border-radius: 16px;
  background: var(--cream);
  border: 1.5px solid transparent;
  font-style: normal;
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.2s var(--ease);
}
.otp-cells i.is-filled { background: #fff; border-color: var(--line); animation: cell 0.22s var(--ease); }
.otp-cells i.is-caret { border-color: var(--ink); background: #fff; }
.otp-cells i.is-caret::after { content: ""; width: 2px; height: 28px; background: var(--ink); animation: blink 1s steps(1) infinite; }
.otp.is-error .otp-cells i { border-color: var(--danger); background: #fff5f5; }
.otp.is-ok .otp-cells i { border-color: var(--ok); background: #f0faf4; color: var(--ok); }
.otp.shake { animation: shake 0.42s ease; }
@keyframes cell { from { transform: scale(0.88); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.otp-meta { margin-top: 4px; }
.chip-btn { min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--cream); font-size: 14.5px; font-weight: 600; transition: opacity 0.2s ease; }
.chip-btn:disabled { opacity: 0.55; cursor: default; color: var(--muted); }
.sim-hint {
  display: inline-block;
  margin-top: 24px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 13.5px;
}
.sim-hint b { font-family: var(--mono); font-weight: 500; }
.app:not(.is-sim) [data-sim] { display: none !important; }

/* ---------- Campos ---------- */
/* minmax(0, 1fr): a largura natural dos campos não pode alargar a coluna (evita scroll horizontal) */
.fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 28px; }
.fields > * { min-width: 0; }
.field {
  display: block;
  padding: 10px 16px 8px;
  border-radius: 18px;
  background: var(--cream);
  border: 1.5px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.field:focus-within { border-color: var(--ink); background: #fff; }
.field.is-error { border-color: var(--danger); }
.field > span { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field input { display: block; width: 100%; height: 34px; padding: 0; border: 0; background: transparent; font: 600 19px var(--font); color: var(--ink); }
.field input::placeholder { color: #b4b0a8; font-weight: 500; }
.field-code { margin-top: 28px; }
.field-code input { font-family: var(--mono); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }
.ok-card { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 14px 16px; border-radius: 18px; background: #eef8f2; color: var(--ink); animation: rise 0.4s var(--ease) both; }
.ok-card > span:last-child { display: flex; flex-direction: column; font-size: 14.5px; color: var(--ink-soft); }
.ok-card b { color: var(--ink); font-size: 15.5px; }
.ok-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ok); color: #fff; }
.ok-icon svg { width: 18px; height: 18px; stroke-width: 2.6; }
.perks { list-style: none; margin: 22px 0 22px; padding: 0; display: grid; gap: 12px; }
.perks li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; color: var(--ink-soft); }
.perks svg { flex: none; width: 22px; height: 22px; color: var(--brand-dark); }

/* ---------- Localização ---------- */

/* ---------- Ecrã principal ---------- */
.screen-home { background: #e8ecef; }
/* O mapa termina exatamente onde começa a folha (sem nada do mapa escondido por baixo) */
.map { position: absolute; inset: 0 0 var(--sheet-h, 320px) 0; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; background: #e8ecef; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(0, 0, 0, 0.1); border-top-color: var(--ink); animation: spin 0.8s linear infinite; }
.home-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-t) + 12px) 16px 0;
  pointer-events: none;
}
.home-top > * { pointer-events: auto; }
.fab {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s var(--ease);
}
.fab:active { transform: scale(0.92); }
/* Botão do menu: retângulo branco de cantos arredondados só com o logótipo TVDE+ */
.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--ink); /* preto, com o logótipo para fundo escuro */
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.18s var(--ease);
}
.menu-btn:active { transform: scale(0.95); }
.menu-logo { height: 24px; }
.fab-icon svg { width: 24px; height: 24px; }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 10px 20px calc(36px + var(--safe-b)); /* espaço generoso por baixo dos cartões (era 18) */
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px -10px rgba(0, 0, 0, 0.18);
  transform: translateY(0);
  transition: transform 0.6s var(--ease);
}
.screen-home:not(.is-ready) .sheet, .screen-home.has-dest .sheet { transform: translateY(105%) !important; }
.grabber { display: block; width: 38px; height: 5px; margin: 0 auto 14px; border-radius: 5px; background: #dcdce0; }
.where {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 0;
  height: 62px;
  padding: 0 8px 0 18px;
  border-radius: 20px;
  background: var(--cream);
  text-align: left;
  transition: transform 0.18s var(--ease), background-color 0.2s ease;
}
.where:active { transform: scale(0.98); background: #ece8e1; }
.where-dot { flex: none; width: 12px; height: 12px; border-radius: 2px; background: var(--dest); box-shadow: 0 0 0 4px rgba(232, 52, 30, 0.18); } /* destino: quadrado vermelho */
.where-text { flex: 1; font-size: 20px; font-weight: 600; letter-spacing: -0.025em; }
.nearby { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.sheet .where { margin-top: 12px; }
/* Local de recolha (centro do mapa), atualizado quando o cliente move o mapa */
.pickup { display: flex; align-items: center; gap: 10px; min-height: 24px; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.pickup-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(255, 144, 25, 0.2); }
.pickup-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; transition: opacity 0.2s ease; }
.pickup.is-loading .pickup-v { opacity: 0.45; }
/* Sem localização e sem recolha definida: a linha é um botão "Define o local de recolha" e o pin fica esbatido */
.screen-home.no-pickup .pickup { cursor: pointer; }
.screen-home.no-pickup .pickup-v { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-dark); }
.screen-home.no-pickup .pickup-v::after { content: "›"; font-size: 20px; line-height: 1; }
.screen-home.no-pickup #pickup-pin { opacity: 0.45; }

/* Marcador fixo do local de recolha: a ponta fica no centro da área visível do mapa */
.pin {
  position: absolute;
  left: 50%;
  top: calc((100% - var(--sheet-h, 320px)) / 2);
  z-index: 2;
  width: 34px;
  height: 52px;
  margin-left: -17px;
  margin-top: -52px;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.pin-label { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); transition: transform 0.25s var(--ease); }
.pin.is-moving .pin-label { transform: translate(-50%, -10px); }
.pin-label[hidden] { display: none; } /* escolher a morada de Casa/Trabalho/local: sem etiqueta */
.pin-head { position: absolute; top: 0; left: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); border: 4px solid #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); transition: transform 0.25s var(--ease); }
.pin-head::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }
.pin-stem { position: absolute; left: 15px; top: 32px; width: 4px; height: 20px; border-radius: 2px; background: var(--ink); transition: transform 0.25s var(--ease); transform-origin: bottom; }
.pin-shadow { position: absolute; left: 11px; bottom: -4px; width: 12px; height: 6px; border-radius: 50%; background: rgba(0, 0, 0, 0.35); transition: transform 0.25s var(--ease), opacity 0.25s ease; }
/* A arrastar o mapa: o marcador "levanta" */
.pin.is-moving .pin-head { transform: translateY(-10px); }
.pin.is-moving .pin-stem { transform: translateY(-10px); }
.pin.is-moving .pin-shadow { transform: scale(1.4); opacity: 0.6; }
.screen-home.has-dest .pin, .screen-home:not(.map-ok) .pin { opacity: 0; }
.nearby { padding-left: 0; } /* começa à esquerda, por baixo do círculo laranja da morada */
/* Zona da recolha clicável (abre a pesquisa da recolha) */
.sheet .pickup, .sheet .nearby { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sheet .pickup:active, .sheet .nearby:active { opacity: 0.6; }
/* Locais (Casa, Trabalho, locais do cliente, "Adicionar"): faixa com scroll na horizontal, de margem a margem */
.shortcuts { display: flex; gap: 10px; margin: 16px -20px 0; padding: 0 20px 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scroll-padding: 0 20px; scrollbar-width: none; }
.shortcuts::-webkit-scrollbar { display: none; }
.shortcut { flex: none; width: 168px; scroll-snap-align: start; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; border: 1px solid var(--line); text-align: left; transition: background-color 0.15s ease; }
.shortcut-add { width: auto; padding-right: 16px; border-style: dashed; color: var(--ink-soft); }
.shortcut-add .sc-icon { background: transparent; border: 1px dashed var(--line); }
.map-pick-row[hidden] { display: none !important; }
.shortcut:active { background: var(--cream); }
.sc-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--cream); }
.sc-icon svg { width: 20px; height: 20px; }
.sc-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sc-text b { font-weight: 600; font-size: 15px; }
.sc-text i { font-style: normal; font-size: 13px; color: var(--muted); }
/* Nome e morada sempre numa só linha (cortados com "…"): todos os botões com a mesma altura */
.sc-text b, .sc-text i { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-label { margin-top: 18px; margin-bottom: 2px; }
.recents { list-style: none; margin: 0; padding: 0; }
.recents button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 11px 0; text-align: left; border-bottom: 1px solid var(--line); }
.recents li:last-child button { border-bottom: 0; }
.recents .rc-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--cream); }
.recents .rc-icon svg { width: 18px; height: 18px; }
.recents .rc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.recents b { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recents i { font-style: normal; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recents .rc-go { color: #b4b0a8; width: 20px; height: 20px; }

/* Marcadores do mapa */
/* Local de recolha (fim da rota): alfinete laranja com a etiqueta "Recolha"; a ponta fica na coordenada */
.mk-pickup { position: relative; width: 0; height: 0; }
/* SVG 28×38 com a ponta em (14, 37): left -14 e top -37 põem a ponta exatamente na coordenada */
.mkp-pin { position: absolute; left: -14px; top: -37px; width: 28px; height: 38px; overflow: visible; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); pointer-events: none; }
.mkp-label { position: absolute; left: 0; top: -62px; transform: translateX(-50%); padding: 3px 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
/* Posição GPS atual do cliente: ponto azul com halo (padrão "estou aqui") */
.mk-client { position: relative; width: 16px; height: 16px; transform: translate(-50%, -50%); }
.mk-client::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: rgba(43, 124, 255, 0.22); animation: me 2s ease-out infinite; }
.mk-client::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #2b7cff; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
/* Paragem intermédia do motorista (ainda vai deixar outro cliente) */
.mk-via { width: 14px; height: 14px; border-radius: 50%; background: #8a8a92; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transform: translate(-50%, -50%); }
.mk-me { position: relative; width: 22px; height: 22px; transform: translate(-50%, -50%); }
.mk-me::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; background: rgba(255, 144, 25, 0.25); animation: me 2s ease-out infinite; }
.mk-me::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--brand); border: 4px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); }
@keyframes me { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
/* Destino: marker.png (375×440 no original) mostrado mais estreito, 34×47; ponta em baixo ao centro */
.mk-dest { position: relative; width: 0; height: 0; }
.mk-dest > img { position: absolute; left: 0; top: 0; display: block; width: 34px; height: 47px; transform: translate(-50%, -87.5%); pointer-events: none; user-select: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.25)); animation: pop-in 0.45s var(--ease) both; transform-origin: 50% 100%; }
@keyframes pop-in { from { opacity: 0; scale: 0.3; } }
.H_copyright { opacity: 0.8; }
/* Motorista a caminho (GIF do ride_portal, centrado na posição) */
.mk-driver { position: relative; width: 0; height: 0; }
.mk-driver > img { position: absolute; left: 0; top: 0; width: 26px; height: 26px; transform: translate(-50%, -50%); border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28); pointer-events: none; }

/* Zona inferior: alertas (deslizam na horizontal) */
.zone-count { color: var(--brand-dark); }
.alerts {
  list-style: none;
  display: flex;
  gap: 10px;
  margin: 8px -20px 0;
  padding: 0 20px 2px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 20px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.alerts::-webkit-scrollbar { display: none; }
.alerts li { flex: 0 0 86%; scroll-snap-align: start; }
.alerts.is-single li { flex-basis: 100%; }
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 76px;
  padding: 12px 12px 12px 14px;
  border-radius: 20px;
  background: var(--brand-soft);
  border: 1px solid #ffe0bd;
  text-align: left;
  transition: transform 0.18s var(--ease);
}
.alert:active { transform: scale(0.98); }
.al-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: #fff; color: var(--brand-dark); box-shadow: 0 4px 12px -6px rgba(138, 74, 0, 0.4); }
.al-icon svg { width: 22px; height: 22px; stroke-width: 2; }
/* "Recomendado": cada ícone tem um movimento curto, com pausas, para chamar a atenção (sem distrair) */
.al-icon { position: relative; overflow: visible; }
.alert-notify .al-icon svg { transform-origin: 50% 12%; animation: al-bell 3.2s ease-in-out 0.6s infinite; }
.alert-gps .al-icon svg { animation: al-pin 3.2s var(--ease) 1.2s infinite; }
.alert-gps .al-icon::after { content: ""; position: absolute; left: 50%; bottom: 7px; width: 14px; height: 5px; margin-left: -7px; border-radius: 50%; border: 1.5px solid var(--brand-dark); opacity: 0; animation: al-pin-ring 3.2s ease-out 1.2s infinite; }
.alert-card .al-icon { overflow: hidden; }
.alert-card .al-icon svg { animation: al-card 3.2s var(--ease) 0.2s infinite; }
.alert-card .al-icon::after { content: ""; position: absolute; top: -20%; left: -60%; width: 40%; height: 140%; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 196, 120, 0.55), rgba(255, 255, 255, 0)); transform: skewX(-20deg); animation: al-shine 3.2s ease-in-out 0.2s infinite; }
@keyframes al-bell { 0%, 34%, 100% { transform: rotate(0); } 4% { transform: rotate(18deg); } 9% { transform: rotate(-15deg); } 14% { transform: rotate(11deg); } 19% { transform: rotate(-7deg); } 24% { transform: rotate(3deg); } }
@keyframes al-pin { 0%, 30%, 100% { transform: translateY(0); } 9% { transform: translateY(-6px); } 16% { transform: translateY(0); } 21% { transform: translateY(-2px); } 25% { transform: translateY(0); } }
@keyframes al-pin-ring { 0%, 14% { opacity: 0; transform: scale(0.5); } 18% { opacity: 0.7; } 40%, 100% { opacity: 0; transform: scale(2); } }
@keyframes al-card { 0%, 30%, 100% { transform: none; } 8% { transform: rotate(-10deg) translateX(-1px); } 16% { transform: rotate(6deg) translateX(1px); } 23% { transform: none; } }
@keyframes al-shine { 0%, 20% { left: -60%; } 42%, 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .al-icon svg, .al-icon::after { animation: none !important; } }
.al-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.al-text b { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-text i { font-style: normal; font-size: 13px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.al-go { flex: none; width: 20px; height: 20px; color: var(--brand-dark); stroke-width: 2.2; }
.alert.is-busy { opacity: 0.6; pointer-events: none; }

/* Ecrãs de notificações e cartão (jornada inicial) */
.perm-art { position: relative; display: grid; place-items: center; height: 200px; margin-bottom: 28px; }
/* Ecrã "Ativa as notificações": notificações de exemplo (estilo iOS) que vão caindo uma a uma */
.push-demo { display: grid; gap: 8px; margin-bottom: 26px; }
.push-demo + .eyebrow { margin-top: 0; }
.push {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px 13px; border-radius: 20px;
  background: rgba(244, 241, 236, 0.92); border: 1px solid rgba(15, 15, 16, 0.06);
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.35);
  animation: push-in 0.55s var(--ease) both;
}
.push:nth-child(1) { animation-delay: 0.15s; }
.push:nth-child(2) { animation-delay: 0.45s; }
.push:nth-child(3) { animation-delay: 0.75s; }
.push:nth-child(4) { animation-delay: 1.05s; }
@keyframes push-in { from { opacity: 0; transform: translateY(-16px) scale(0.97); } }
.push-app { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--ink); }
.push-app svg { width: 28px; height: auto; }
.push-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.push-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.push-top b { font-size: 14.5px; font-weight: 600; }
.push-top i { flex: none; font-style: normal; font-size: 12px; color: var(--muted); }
.push-body { font-size: 13.5px; color: var(--ink-soft); }
/* Ecrãs baixos: só 3 exemplos */
@media (max-height: 720px) { .push:nth-child(4) { display: none; } }
/* Ecrã "Ativa a localização": mini-mapa animado (ruas, carros a chegar, o ponto azul, o pin de recolha a cair
   à porta, o percurso do motorista) com etiquetas das vantagens. As animações correm com .is-playing
   (posto ao abrir o passo — js/auth.js); os carros são animados no próprio SVG (animateMotion). */
.loc-map { position: relative; height: clamp(200px, 36vh, 320px); margin-bottom: 26px; border-radius: 28px; overflow: hidden; background: #ebede6; box-shadow: inset 0 0 0 1px rgba(15, 15, 16, 0.06), 0 18px 40px -26px rgba(0, 0, 0, 0.45); }
.loc-map + .eyebrow { margin-top: 0; }
.lm-svg { position: absolute; inset: 0; width: 100%; height: 100%; stroke: none; stroke-width: 0; } /* sem o contorno dos ícones (svg global) */
.lm-svg text { font-family: inherit; }
.lm-route { stroke-dasharray: 1; stroke-dashoffset: 1; }
.lm-pulse { transform-box: fill-box; transform-origin: center; opacity: 0; }
.lm-pin { transform-box: fill-box; transform-origin: 50% 100%; opacity: 0; }
.lm-label { opacity: 0; }
.lm-chip { position: absolute; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 5px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.4); opacity: 0; }
.lm-chip-1 { top: 14px; left: 14px; }
.lm-chip-2 { top: 14px; right: 14px; }
.lm-chip-3 { bottom: 14px; left: 14px; }
.lm-chip-4 { bottom: 14px; right: 14px; }
.lm-ic { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; }
.lm-ic svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lm-ic-fast { background: var(--brand); }
.lm-ic-fast svg { fill: currentColor; stroke-width: 1; }
.lm-ic-pin { background: var(--ink); color: var(--brand); }
.lm-ic-safe { background: var(--ok); }
.lm-ic-near { background: #2f5bd8; }

.loc-map.is-playing .lm-pin { animation: lm-drop 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) 0.6s both; }
.loc-map.is-playing .lm-label { animation: lm-fade 0.4s ease 1.2s both; }
.loc-map.is-playing .lm-pulse { animation: lm-pulse 2.4s ease-out 0.4s infinite; }
.loc-map.is-playing .lm-pulse-2 { animation-delay: 1.6s; }
.loc-map.is-playing .lm-route { animation: lm-draw 1.1s ease-in-out 2.5s both; }
.loc-map.is-playing .lm-chip { animation: lm-chip 0.5s var(--ease) both, lm-float 4s ease-in-out infinite; }
.loc-map.is-playing .lm-chip-1 { animation-delay: 1.3s, 1.8s; }
.loc-map.is-playing .lm-chip-2 { animation-delay: 1.6s, 2.4s; }
.loc-map.is-playing .lm-chip-3 { animation-delay: 1.9s, 3s; }
.loc-map.is-playing .lm-chip-4 { animation-delay: 2.2s, 3.6s; }
@keyframes lm-drop { from { opacity: 0; transform: translateY(-46px); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes lm-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes lm-pulse { from { opacity: 0.35; transform: scale(1); } to { opacity: 0; transform: scale(5); } }
@keyframes lm-draw { to { stroke-dashoffset: 0; } }
@keyframes lm-chip { from { opacity: 0; transform: translateY(8px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes lm-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
@media (max-height: 720px) { .loc-map { margin-bottom: 20px; } }
@media (prefers-reduced-motion: reduce) {
  .loc-map.is-playing * { animation-duration: 0.01s !important; animation-iteration-count: 1 !important; }
}
@media (prefers-reduced-motion: reduce) { .push { animation: none; } }
.perm-icon { position: relative; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 26px; background: var(--ink); color: var(--brand); box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.5); }
.perm-icon svg { width: 36px; height: 36px; stroke-width: 2; }
.perm-bell svg { animation: ring-bell 2.6s ease-in-out infinite; transform-origin: 50% 15%; }
@keyframes ring-bell { 0%, 70%, 100% { rotate: 0deg; } 76% { rotate: 14deg; } 82% { rotate: -12deg; } 88% { rotate: 8deg; } 94% { rotate: -4deg; } }
.perm-badge { position: absolute; top: calc(50% - 50px); left: calc(50% + 24px); display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--brand); color: var(--ink); font-size: 14px; font-weight: 700; box-shadow: 0 0 0 3px #fff; animation: pop 0.5s var(--ease) 0.4s both; }
.card-art { flex: none; display: grid; place-items: center; height: 190px; margin-bottom: 20px; perspective: 800px; }
.card-art + .eyebrow, .perm-art + .eyebrow { margin-top: 0; }
[data-screen="card"] .nav:not([hidden]) + .body-center { padding-top: 8px; }
.cc-card {
  position: relative;
  width: 260px;
  height: 162px;
  padding: 20px;
  border-radius: 20px;
  background: radial-gradient(120% 120% at 100% 0%, rgba(255, 144, 25, 0.35), transparent 55%), linear-gradient(140deg, #26262b, #0b0b0c);
  color: #fff;
  box-shadow: 0 28px 50px -20px rgba(0, 0, 0, 0.6);
  transform: rotateX(8deg) rotateY(-12deg) rotateZ(-3deg);
  animation: card-in 0.8s var(--ease) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(30px) rotateX(30deg) rotateZ(-8deg); } }
/* Chip com os contactos desenhados (linhas) */
.cc-chip {
  position: absolute; left: 22px; top: 26px; width: 40px; height: 30px; border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 32%, rgba(90, 62, 12, 0.45) 32% 36%, transparent 36% 64%, rgba(90, 62, 12, 0.45) 64% 68%, transparent 68%),
    linear-gradient(0deg, transparent 30%, rgba(90, 62, 12, 0.45) 30% 34%, transparent 34% 66%, rgba(90, 62, 12, 0.45) 66% 70%, transparent 70%),
    linear-gradient(135deg, #f6dc98, #c39a3e 55%, #a77d27);
  box-shadow: inset 0 0 0 1px rgba(90, 62, 12, 0.35);
}
.cc-nfc { position: absolute; left: 72px; top: 30px; width: 22px; height: 22px; color: rgba(255, 255, 255, 0.75); stroke-width: 2; }
.cc-num { position: absolute; left: 22px; top: 76px; font-family: var(--mono); font-size: 16px; letter-spacing: 0.14em; opacity: 0.9; }
.cc-bottom { position: absolute; left: 22px; right: 22px; bottom: 18px; display: flex; justify-content: space-between; align-items: flex-end; }
.cc-bottom > span { display: flex; flex-direction: column; line-height: 1.2; }
.cc-bottom > span:last-child { text-align: right; }
.cc-bottom small { font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.55; }
.cc-bottom b { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; opacity: 0.9; }

/* Dados do cartão (Stripe) */
.stripe-box { position: relative; min-height: 220px; margin-top: 26px; }
.stripe-loading { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 18px; background: var(--cream); }
.stripe-trust { display: flex; align-items: flex-start; gap: 10px; margin-top: 6px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.stripe-trust svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--ink-soft); }
.stripe-trust b { color: var(--ink-soft); font-weight: 600; }

/* ---------- As minhas viagens ---------- */
.spinner-sm { width: 20px; height: 20px; border-width: 2.5px; }
.trips { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.trips > li { min-width: 0; }
.trips-month { margin: 14px 0 -2px; }
.trips-month:first-child { margin-top: 6px; }
.trip { border-radius: 20px; border: 1px solid var(--line); background: #fff; overflow: hidden; box-shadow: 0 6px 18px -14px rgba(0, 0, 0, 0.35); animation: rise 0.35s var(--ease) both; }
/* 3:1 — o mesmo formato da imagem da rota gerada pelo backend (600×200) */
.trip-map { position: relative; aspect-ratio: 3 / 1; background: linear-gradient(90deg, #eef0f2 0%, #f6f7f8 50%, #eef0f2 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.trip-map img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s ease; }
.trip-map img[src] { opacity: 1; }
.trip-status { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(15, 15, 16, 0.85); color: #fff; font-size: 12.5px; font-weight: 600; }
.trip.is-cancelled .trip-map img { filter: grayscale(1); opacity: 0.7; }
.trip-main { padding: 12px 14px 14px; }
.trip-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.trip-date { font-size: 14px; color: var(--muted); padding-top: 2px; }
/* Botões sobre a imagem da rota: ligar (sup. esq.), valor (sup. dir.) e fatura (inf. dir.) */
.trip-chip { position: absolute; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.3); transition: transform 0.12s ease, background-color 0.15s ease; }
.trip-chip:active { transform: scale(0.95); background: #fff; }
.trip-chip svg { width: 17px; height: 17px; }
.trip-chip[hidden] { display: none; }
.trip-price { top: 10px; right: 10px; font-size: 16px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.trip-call { top: 10px; left: 10px; }
.trip-call svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
/* Separador entre a data/categoria e a recolha/destino (igual ao de cima do motorista) */
.trip-stops { list-style: none; position: relative; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }.trip-stops::before { content: ""; position: absolute; left: 4px; top: 25px; bottom: 13px; border-left: 2px dotted #c9c5bd; }
.trip-stops li { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 15px; font-weight: 500; }
.trip-stops li i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.trip-stops .ts-to i { background: var(--dest); }
.trip-stops span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Motorista e carro no cartão da viagem (não confundir com .trip-foot, o rodapé do ecrã das categorias) */
.trip-crew { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.tf-pics { flex: none; display: flex; align-items: center; }
.trip-when { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.trip-cat { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.trip-cat:empty { display: none; }
.td-photo { position: relative; z-index: 1; margin-left: -6px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--cream); box-shadow: 0 0 0 2px #fff; }
.td-photo img { width: 100%; height: 100%; object-fit: cover; }
.td-photo.is-initial { background: linear-gradient(135deg, #6a7cff, #2a37b8); color: #fff; font-weight: 600; font-size: 16px; }
.tc-photo { width: 54px; height: 40px; border-radius: 12px; object-fit: cover; background: var(--cream); }
.tc-photo[hidden] + .td-photo { margin-left: 0; }
.tf-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tf-text b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-text i { font-style: normal; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-invoice { right: 10px; bottom: 10px; }
.trip-invoice.is-busy { pointer-events: none; color: transparent; }
.trip-invoice.is-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2.5px solid rgba(0, 0, 0, 0.12); border-top-color: var(--ink); animation: spin 0.7s linear infinite; }
.trips-more { display: grid; place-items: center; min-height: 64px; }

/* ---------- Pagamento: cartões ---------- */
.sub.is-warn { color: var(--brand-dark); }
.pay-label { margin: 26px 0 8px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.cards > li { min-width: 0; }
.card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  padding: 12px 12px 12px 14px;
  border-radius: 18px;
  border: 1.5px solid var(--line);
  background: #fff;
  text-align: left;
  transition: background-color 0.15s ease, transform 0.15s var(--ease);
}
.card-row:active { background: var(--cream); transform: scale(0.99); }
.card-row.is-busy { opacity: 0.5; pointer-events: none; }
.card-row.is-expired .brand { filter: grayscale(1); opacity: 0.6; }
.brand {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 32px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font: italic 800 13px/1 var(--font);
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.b-visa { background: linear-gradient(135deg, #1a1f71, #2b3bb5); }
.b-amex { background: linear-gradient(135deg, #1f72cd, #2e8de8); font-style: normal; font-size: 11px; }
.b-other { background: linear-gradient(135deg, #3d3d42, #0f0f10); font-style: normal; font-size: 11px; }
/* Mastercard: dois círculos */
.b-mc { position: relative; background: #1c1c1f; }
.b-mc::before, .b-mc::after { content: ""; position: absolute; top: 8px; width: 16px; height: 16px; border-radius: 50%; }
.b-mc::before { left: 9px; background: #eb001b; }
.b-mc::after { left: 19px; background: #f79e1b; mix-blend-mode: screen; opacity: 0.9; }
.card-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.card-txt b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-txt i { font-style: normal; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-tag:empty { display: none; }
.card-tag { flex: none; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.card-tag.is-default { background: #eaf6ee; color: var(--ok); }
.card-tag.is-expired { background: #fdecec; color: var(--danger); }
.card-go { flex: none; width: 18px; height: 18px; color: #b4b0a8; }
.cards-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 26px; padding: 26px 20px; border-radius: 20px; background: var(--cream); text-align: center; }
.cards-empty b { margin-top: 8px; font-size: 16.5px; font-weight: 600; }
.cards-empty span { font-size: 14px; color: var(--muted); }
.cards-empty-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #fff; color: var(--ink-soft); }
.cards-empty-icon svg { width: 26px; height: 26px; }
.add-card { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; margin: 10px 0 18px; padding: 0 14px; border-radius: 18px; border: 1.5px dashed var(--hairline); font-size: 16px; font-weight: 600; text-align: left; }
.add-card:active { background: var(--cream); }
.add-card-icon { display: grid; place-items: center; width: 48px; height: 32px; border-radius: 7px; background: var(--cream); }
.add-card-icon svg { width: 18px; height: 18px; stroke-width: 2.2; }

/* ---------- Faturação ---------- */
.bill-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.bill-list > li { min-width: 0; }
.bill-list:empty { display: none; }
.bill-row { display: flex; align-items: center; min-height: 64px; border-radius: 18px; border: 1.5px solid var(--line); background: #fff; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.bill-row.is-on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.bill-row.is-busy { opacity: 0.5; pointer-events: none; }
.bill-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 6px 10px 14px; text-align: left; }
.bill-radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--hairline); transition: border-color 0.15s ease, border-width 0.15s ease; }
.bill-row.is-on .bill-radio { border: 7px solid var(--ink); }
.bill-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.bill-txt b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-txt i { font-style: normal; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.bill-more { flex: none; display: grid; place-items: center; width: 48px; height: 48px; margin-right: 6px; border-radius: 50%; color: var(--ink-soft); }
.bill-more:active { background: var(--cream); }
.bill-more svg { width: 22px; height: 22px; }
.bill-empty { margin: -2px 0 0; font-size: 14px; color: var(--muted); }
.bill-list + .add-card, .bill-empty + .add-card { margin-top: 8px; }
/* Prefixo do país no NIF: seletor nativo invisível por cima (abre a lista do sistema) */
.nif-cc { position: relative; cursor: pointer; }
.nif-cc select { position: absolute; inset: 0; width: 100%; opacity: 0; font-size: 16px; cursor: pointer; }
.nif-field { margin-top: 0; min-width: 0; }
.nif-field .phone-input { width: 0; } /* ocupa só o espaço que sobra (flex: 1), sem largura própria */
#nif-company-fields:not([hidden]) { display: block; }
/* Morada da empresa */
.addr-fields:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.field-row { display: grid; grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr); gap: 10px; }
.field-row > .field { min-width: 0; }
.field-select { position: relative; }
.field-select select { display: block; width: 100%; height: 34px; padding: 0 28px 0 0; border: 0; background: transparent; font: 600 19px var(--font); color: var(--ink); -webkit-appearance: none; appearance: none; }
.field-select svg { position: absolute; right: 14px; bottom: 16px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.field.is-error { border-color: var(--danger); }

/* Chat de suporte (Tidio): sem o botão redondo do canto; só aparece depois de tocar em "Ajuda" */
body:not(.tidio-open) #tidio-chat { display: none !important; }
/* ✕ para fechar o chat quando o Tidio está em "modo computador" (js/support.js) */
.tidio-close { display: none; }
body.tidio-open.tidio-desktop .tidio-close {
  position: fixed;
  top: calc(var(--safe-t) + 22px);
  right: 12px;
  z-index: 2147483647; /* acima do widget do Tidio */
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #000;
}
.tidio-close:active { background: rgba(0, 0, 0, 0.08); }
.tidio-close svg { width: 22px; height: 22px; stroke-width: 2.2; }

/* ---------- Legal ---------- */
.legal-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.legal-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 10px 14px; border-radius: 18px; border: 1.5px solid var(--line); background: #fff; text-align: left; transition: background-color 0.15s ease; }
.legal-row:active { background: var(--cream); }
.legal-row .rc-go { flex: none; width: 20px; height: 20px; color: #b4b0a8; }
.legal-foot { margin-top: 22px; font-size: 12.5px; color: var(--muted); }
/* Documento legal (texto corrido) */
.legal-doc { -webkit-user-select: text; user-select: text; }
.legal-doc .headline { font-size: clamp(28px, 8vw, 34px); }
.legal-doc-content { margin-top: 18px; padding-bottom: calc(24px + var(--safe-b)); }
.ld-section { padding: 18px 0; border-top: 1px solid var(--line); }
.ld-title { display: flex; align-items: baseline; gap: 10px; font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
.ld-num { flex: none; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--brand-dark); }
.ld-p { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.ld-label { margin-top: 14px; font-size: 15px; font-weight: 600; color: var(--ink); }
.ld-list { margin: 8px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.ld-list li { margin-top: 4px; }
.ld-list li::marker { color: var(--brand); }

/* Folha de ações */
.action-sheet { padding-bottom: calc(10px + var(--safe-b)); }
.as-head { padding: 0 24px 8px; }
.as-head .bsheet-title { padding: 0; }
.as-text { margin-top: 4px; font-size: 14.5px; color: var(--muted); }
.as-list { display: grid; gap: 2px; padding: 4px 12px 0; }
.as-rows { margin: 4px 8px 10px; padding: 4px 14px; border-radius: 14px; background: var(--cream); }
.as-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 15px; }
.as-row + .as-row { border-top: 1px solid var(--line); }
.as-row dt { color: var(--muted); }
.as-row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.as-row.is-total dt { color: var(--ink); font-weight: 600; }
.as-row.is-total dd { font-size: 17px; }
.as-btn { min-height: 54px; padding: 0 12px; border-radius: 14px; font-size: 16.5px; font-weight: 600; text-align: left; }
.as-btn:active { background: var(--cream); }
.as-btn.is-danger { color: var(--danger); }
.as-btn.is-cancel { margin-top: 6px; text-align: center; background: var(--cream); color: var(--ink-soft); }

/* Folha: sem destino */
.where-icon { flex: none; width: 24px; height: 24px; margin-right: 10px; color: var(--ink-soft); }
.recents-empty { padding: 12px 0 4px; font-size: 14px; color: var(--muted); }
.shortcut.is-set .sc-text i { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Destino escolhido: mapa reduzido + categorias ---------- */
/* Mapa das categorias: no máximo 30% do ecrã (já com a margem do topo); nos ecrãs grandes não passa de 300 px úteis */
.screen-home { --trip-map-h: min(30%, calc(clamp(180px, 30%, 300px) + var(--safe-t))); }
.screen-home.has-dest .map { bottom: auto; height: var(--trip-map-h); }
/* ---------- Pedido em curso: pagamento → convites (js/request.js) ---------- */
.req-panel {
  position: absolute;
  top: var(--trip-map-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 0;
  background: #fff;
  overflow-y: auto; /* ecrãs baixos: os botões nunca ficam cortados */
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.45s var(--ease), visibility 0s 0.45s;
}
.screen-home.has-request .req-panel { transform: none; visibility: visible; transition: transform 0.45s var(--ease); }
/* Durante o pedido (pagamento, convites, motorista a caminho/chegou) não se altera nada:
   o ✕ e os botões "De"/"Para" do mapa desaparecem */
.screen-home.has-request .trip-close { display: none !important; }
.screen-home.has-request .trip-chips { display: none; }
/* Cancelar pedido/viagem: no topo direito do mapa enquanto há algo para cancelar */
.req-cancel-top { display: none; }
.screen-home.has-request.req-can-cancel .req-cancel-top {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--danger);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s var(--ease);
}
.req-cancel-top:active { transform: scale(0.95); }
/* Motorista aceitou: segurança no topo esquerdo; ligar e mensagem nos cantos inferiores do mapa */
.safety-btn, .map-act { display: none; }
.screen-home.has-request.req-accepted .safety-btn { display: grid; margin-right: 8px; color: var(--danger); }
.map-act {
  position: absolute;
  top: calc(var(--trip-map-h) - 20px); /* acima do logótipo e do copyright da HERE */
  z-index: 4;
  transform: translateY(-100%);
  color: var(--ink);
}
/* Ambos à direita: o logótipo da HERE (canto inferior esquerdo) não pode ficar tapado */
.map-act-call { right: 76px; }
.map-act-chat { right: 16px; }
.screen-home.has-request.req-accepted .map-act { display: grid; animation: pop-in 0.35s var(--ease) both; }
.map-act:active { transform: translateY(-100%) scale(0.92); }
.req-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.req-title { margin-top: 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.req-amount { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--cream); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.req-cats { margin-top: 6px; font-size: 14px; color: var(--muted); }
.req-steps { list-style: none; position: relative; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.req-steps::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 28px; border-left: 2px solid var(--line); }
.req-step { position: relative; display: flex; align-items: flex-start; gap: 14px; }
.rs-dot { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); color: #fff; transition: background-color 0.25s ease, border-color 0.25s ease; }
.rs-dot > * { display: none; }
.rs-dot svg { width: 15px; height: 15px; stroke-width: 2.8; }
.req-step.is-active .rs-dot { border-color: var(--ink); }
.req-step.is-active .rs-spin { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid rgba(15, 15, 16, 0.15); border-top-color: var(--ink); animation: spin 0.8s linear infinite; }
.req-step.is-done .rs-dot { background: var(--ok); border-color: var(--ok); }
.req-step.is-done .rs-ok { display: block; animation: pop-in 0.35s var(--ease) both; }
.req-step.is-error .rs-dot { background: var(--danger); border-color: var(--danger); }
.req-step.is-error .rs-ko { display: block; }
.rs-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; padding-top: 3px; }
.rs-txt b { font-size: 16px; font-weight: 600; color: var(--muted); transition: color 0.2s ease; }
.rs-txt i { font-style: normal; font-size: 14px; color: var(--muted); }
.req-step.is-active .rs-txt b, .req-step.is-done .rs-txt b, .req-step.is-error .rs-txt b { color: var(--ink); }
.req-step.is-error .rs-txt i { color: var(--danger); }
/* Motorista aceitou: o cartão do motorista substitui os passos */
.req-panel.is-accepted .req-steps, .req-panel.is-accepted .req-cats,
.req-panel.is-accepted #req-eyebrow, .req-panel.is-accepted #req-amount { display: none; }
.req-panel.is-accepted .req-title { margin-top: 0; }
/* Motorista aceitou: a zona branca fica fixa ao fundo com a altura do conteúdo e o mapa ocupa o resto
   (js/request.js mede o painel e ajusta --trip-map-h) */
.screen-home.has-request .req-panel { top: auto; max-height: calc(100% - 200px); } /* pagamento, convites, motorista, viagem */
.req-panel.is-accepted .req-foot { padding: 0 0 calc(30px + var(--safe-b)); }
/* Em viagem (o motorista iniciou a viagem): sem PIN, sem chat nem telefone sobre o mapa */
.req-sub { margin-top: 4px; font-size: 14.5px; color: var(--muted); }
.req-sub b { color: var(--ink); font-weight: 600; }
.req-panel.is-ontrip > .rd-pin { display: none !important; }
.screen-home.req-ontrip .map-act { display: none !important; }
.req-panel.is-ontrip .req-title { display: flex; align-items: center; gap: 10px; }
/* Ponto verde a pulsar ao lado de "Em viagem com …" */
.req-panel.is-ontrip .req-title::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); animation: live-dot 1.8s ease-out infinite; }
@keyframes live-dot { 70% { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@media (prefers-reduced-motion: reduce) { .req-panel.is-ontrip .req-title::before { animation: none; } }
/* Motorista chegou: aviso permanente com movimento (sino a tocar + ondas) */
.rd-wait:not([hidden]) {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; padding: 10px 14px;
  border-radius: 16px; background: var(--brand); color: var(--ink);
  animation: rise 0.4s var(--ease) both, wait-glow 2s ease-in-out 0.4s infinite;
}
.rw-icon { position: relative; flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--brand); }
.rw-icon::before, .rw-icon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ink); animation: wait-ring 1.8s ease-out infinite; }
.rw-icon::after { animation-delay: 0.9s; }
.rw-icon svg { width: 20px; height: 20px; stroke-width: 2; transform-origin: 50% 15%; animation: wait-bell 1.8s ease-in-out infinite; }
.rw-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.rw-txt b { font-size: 15.5px; font-weight: 600; }
.rw-txt i { font-style: normal; font-size: 13px; font-variant-numeric: tabular-nums; opacity: 0.8; }
@keyframes wait-ring { from { opacity: 0.6; scale: 1; } to { opacity: 0; scale: 1.7; } }
@keyframes wait-bell { 0%, 50%, 100% { rotate: 0deg; } 10% { rotate: 16deg; } 20% { rotate: -14deg; } 30% { rotate: 10deg; } 40% { rotate: -6deg; } }
@keyframes wait-glow { 50% { box-shadow: 0 0 0 5px rgba(255, 144, 25, 0.25); } }
@media (prefers-reduced-motion: reduce) { .rd-wait, .rw-icon::before, .rw-icon::after, .rw-icon svg { animation: none !important; } }
/* PIN no topo do painel, só depois de o motorista aceitar */
.req-panel > .rd-pin { display: none; }
.req-panel.is-accepted > .rd-pin { display: flex; margin-bottom: 14px; animation: rise 0.4s var(--ease) both; }
.req-driver:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 12px; margin-top: 14px; animation: rise 0.4s var(--ease) both; }
.rd-person { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 0; } /* fotos + nome + avaliação centrados no ecrã, com espaço em cima e em baixo */
.rd-pics { flex: none; display: flex; align-items: center; }
.rd-photo { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 120px; height: 120px; margin-left: -18px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #6a7cff, #2a37b8); color: #fff; font-size: 42px; font-weight: 600; box-shadow: 0 0 0 3px #fff; }
.rd-car[hidden] + .rd-photo { margin-left: 0; }
.rd-photo img { width: 100%; height: 100%; object-fit: cover; }
.rd-who { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.rd-who b { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.rd-who i { display: flex; align-items: center; gap: 4px; font-style: normal; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.rd-who i svg { flex: none; width: 15px; height: 15px; fill: var(--brand); stroke: var(--brand); }
.rd-car-info { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; text-align: right; }
.rd-car-info > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rd-cat { font-style: normal; font-size: 13.5px; font-weight: 400; color: var(--muted); }
#rd-cat:empty { display: none; }
.req-panel > * { min-width: 0; }
/* As fotos dos carros são quadradas: caixa quadrada para não cortar o topo e o fundo do carro */
.rd-car { flex: none; width: 120px; height: 120px; border-radius: 24px; object-fit: cover; background: var(--cream); }
.rd-vehicle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--cream); font-size: 15px; font-weight: 500; }
/* Matrícula portuguesa (igual à do ride.tvdemais.pt) */
.plate { flex: none; display: inline-flex; align-items: stretch; overflow: hidden; border-radius: 6px; border: 1.5px solid #1d1d1f; background: #fff; font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: 0.06em; color: var(--ink); }
.plate-eu { display: grid; place-items: end center; width: 18px; padding-bottom: 3px; background: #1b3fa0; color: #fff; font: 600 10px var(--font); }
.plate-text { padding: 4px 9px; }
.rd-pin { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px 7px 14px; border-radius: 16px; border: 1.5px solid var(--ink); }
button.rd-pin { width: 100%; text-align: left; background: #fff; color: var(--ink); transition: background-color 0.15s ease; }
button.rd-pin:active { background: var(--cream); }
/* PIN desativado pelo cliente */
.rd-pin.is-off { border-style: dashed; border-color: var(--muted); }
.rd-pin.is-off .rd-pin-code { display: none; }
.rd-pin > span:first-child { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.rd-pin b { font-size: 15px; font-weight: 600; }
.rd-pin i { font-style: normal; font-size: 12.5px; color: var(--muted); }
.rd-pin-code { flex: none; font-family: var(--mono); font-size: 24px; font-weight: 500; letter-spacing: 0.18em; }
.req-foot { margin-top: auto; padding: 10px 0 calc(10px + var(--safe-b)); display: grid; gap: 4px; }
.req-foot .btn-plain { min-height: 44px; }
.req-retry:not([hidden]) { display: grid; gap: 8px; }

/* ---------- Escolher no mapa (destino, Casa ou Trabalho) ---------- */
.pick-close { display: none; }
.screen-home.is-picking .pick-close { display: grid; }
.screen-home.is-picking #menu-btn, .screen-home.is-picking #locate-btn { display: none; }
.screen-home.is-picking .home-top { justify-content: flex-start; gap: 10px; }
.screen-home.is-picking .sheet { transform: translateY(105%) !important; }
.screen-home.is-picking:not(.pick-pickup) .pin-head { background: var(--dest); }
.pick-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 16px 20px calc(16px + var(--safe-b));
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px -10px rgba(0, 0, 0, 0.18);
  transform: translateY(105%);
  visibility: hidden;
  transition: transform 0.4s var(--ease), visibility 0s 0.4s;
}
.screen-home.is-picking .pick-panel { transform: none; visibility: visible; transition: transform 0.4s var(--ease); }
.pick-name { margin-top: 6px; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; min-height: 48px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: opacity 0.2s ease; }
.pick-panel.is-loading .pick-name { opacity: 0.45; }
.pick-hint { margin: 2px 0 14px; font-size: 13.5px; color: var(--muted); }
.map-pick-row { display: flex; align-items: center; gap: 14px; width: calc(100% - 16px); min-height: 64px; margin: 4px 8px 2px; padding: 8px 12px; border-radius: 16px; text-align: left; }
.map-pick-row:active, .map-pick-row.is-busy { background: var(--cream); }
.map-pick-row.is-busy { pointer-events: none; }
.map-pick-row.is-busy .rs-icon svg { display: none; }
.map-pick-row.is-busy .rs-icon::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.map-pick-row .rs-icon { background: var(--ink); color: #fff; }
.map-pick-row .rc-go { flex: none; width: 20px; height: 20px; color: #b4b0a8; }

/* Botão "voltar à minha localização": só depois de o cliente mover o mapa (classe show-locate, js/home.js) */
#locate-btn { opacity: 0; transform: scale(0.7); pointer-events: none; transition: opacity 0.2s ease, transform 0.25s var(--ease); }
.screen-home.show-locate #locate-btn { opacity: 1; transform: none; pointer-events: auto; }
/* Sem localização ativa não há posição para onde centrar: o botão não aparece. Volta a aparecer quando a
   localização for ativada (no-gps sai) e o mapa não estiver na posição GPS (show-locate) */
.screen-home.no-gps #locate-btn { display: none; }
/* A obter a posição GPS (pode demorar uns segundos): o ícone dá lugar a um indicador de carregamento */
#locate-btn.is-busy { position: relative; opacity: 1; transform: none; pointer-events: none; }
#locate-btn.is-busy svg { opacity: 0; }
#locate-btn.is-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2.5px solid rgba(15, 15, 16, 0.15); border-top-color: var(--ink); animation: spin 0.7s linear infinite; }
.trip-close { display: none; }
.screen-home.has-dest #menu-btn, .screen-home.has-dest #locate-btn { display: none; }
.screen-home.has-dest .trip-close { display: grid; margin-left: auto; }

/* Origem e destino sobre o mapa */
.trip-chips {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(var(--trip-map-h) - 16px); /* mais perto do fundo do mapa (o copyright da HERE fica à direita, por baixo) */
  z-index: 3;
  /* Lado a lado quando cabem sem cortar texto; senão o "Para" passa para baixo do "De" */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 4px 6px;
  transform: translateY(-100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.screen-home.has-dest .trip-chips { opacity: 1; }
.screen-home.has-dest .trip-chips > * { pointer-events: auto; }
.tchip {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 12px;
  /* 10% de transparência, sem desfoque: o mapa vê-se ligeiramente por baixo */
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 15, 16, 0.08);
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.35);
  font-size: 14px;
  white-space: nowrap;
}
.trip-chips > .tchip { flex: 0 0 auto; } /* não encolhe: em vez de cortar o texto, passa para a linha de baixo */
.tchip-k { color: var(--muted); }
.tchip-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tchip-to b { font-weight: 600; }
.tchip-to svg { flex: none; width: 15px; height: 15px; color: var(--muted); }
.tchip-to:active, .tchip-from:active { background: #fff; }
.tdot-a, .tdot-b { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.tdot-b { background: var(--dest); } /* vermelho do marker.png de destino */

/* Painel com as categorias */
.trip-panel {
  position: absolute;
  top: var(--trip-map-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  background: #fff;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.5s var(--ease), visibility 0s 0.5s;
}
.screen-home.has-dest .trip-panel { transform: none; visibility: visible; transition: transform 0.5s var(--ease); }
.trip-bar { flex: none; padding: 8px 16px; background: var(--ink); color: rgba(255, 255, 255, 0.78); font-size: 14px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-bar b { color: #fff; font-weight: 600; }
/* Zona especial de recolha (aeroporto, …): aviso com o ponto de recolha próprio */
.zone-note:not([hidden]) { flex: none; display: flex; align-items: flex-start; gap: 10px; margin: 10px 14px 0; padding: 10px 12px; border-radius: 14px; background: #fff4e5; border: 1px solid #ffd59c; color: var(--ink); animation: rise 0.35s var(--ease) both; }
.zone-note svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--brand-dark); stroke-width: 2; }
.zone-note p { min-width: 0; font-size: 13.5px; line-height: 1.4; font-weight: 500; }
.req-zone:not([hidden]) { margin: 10px 0 0; }
.trip-head { flex: none; padding: 14px 20px 8px; text-align: center; }
.trip-head h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.trip-head p { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.cats { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; list-style: none; margin: 0; padding: 4px 14px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; }
.cats > li { min-width: 0; }
.cat {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px 10px 10px;
  border-radius: 18px;
  border: 1.5px solid var(--line);
  background: #fff;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s var(--ease);
  animation: rise 0.4s var(--ease) both;
}
.cat:active:not(:disabled) { transform: scale(0.985); }
.cat.is-on { border-color: var(--ink); background: #fbfaf7; box-shadow: 0 0 0 1px var(--ink); }
.cat:disabled { opacity: 0.45; cursor: default; }
.cat-img { flex: none; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: var(--cream); }
.cat-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cat-text b { font-size: 16.5px; font-weight: 600; letter-spacing: -0.015em; }
.cat-text i { font-style: normal; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-l2 { display: flex; align-items: center; gap: 10px; }
.cat-l2 > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.seats { flex: none; display: inline-flex; align-items: center; gap: 2px; color: var(--ink-soft); }
.seats svg { width: 14px; height: 14px; }
.cat-side { flex: none; align-self: stretch; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; }
.cat-price { font-size: 16.5px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.cat-tag { padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11.5px; font-weight: 600; line-height: 1.3; text-align: center; }
.cat-skel { border-color: var(--line); animation: none; }
.cat-skel .cat-img, .cat-skel i { background: linear-gradient(90deg, #f1efea 0%, #f8f6f2 50%, #f1efea 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.cat-skel i { display: block; height: 12px; margin: 5px 0; border-radius: 6px; }
.cat-skel i:first-child { width: 55%; height: 15px; }
.cat-skel i:last-child { width: 80%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }
.cats-msg { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 15px; }
.cats-msg button { margin-top: 12px; }
.trip-foot { flex: none; padding: 8px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: #fff; }
.pay-line { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 34px; margin-bottom: 6px; font-size: 13.5px; color: var(--muted); }
.pay-line svg { flex: none; width: 18px; height: 18px; }
.pay-line.is-missing { color: var(--brand-dark); }
.pay-line.is-missing b { padding: 3px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 13px; }
/* Com cartão: a linha "Pagamento Visa *4242 e NIF …" passa para o espaço por baixo de "Chamar TVDE+" e o espaço
   de cima fecha (mais lugar para as categorias). Sem cartão fica em cima, com "Adicionar", como antes. */
.trip-foot { display: flex; flex-direction: column; }
/* Com cartão: "Pagamento Visa…" por baixo do botão, no tamanho de letra do botão, com o mesmo espaço em cima
   (até ao botão) e em baixo (até ao fundo do ecrã). Aqui não se soma a zona segura: 14px já deixam o texto
   acima da barra de gestos do iPhone. */
.trip-foot.has-card { --pay-gap: 14px; padding-bottom: var(--pay-gap); }
.trip-foot.has-card .pay-line { order: 2; min-height: 0; margin: var(--pay-gap) 0 0; font-size: 17px; line-height: 22px; }
.trip-foot.has-card .pay-line svg { width: 20px; height: 20px; }

/* ---------- Procurar destino (ecrã modal) ---------- */
.screen.screen-up { transform: translate3d(0, 100%, 0); }
.screen.screen-up.is-active { transform: none; z-index: 5; }
/* ---------- Fim de viagem: avaliação + recibo ---------- */
/* Compacto: cabe num ecrã de ~740 px de altura sem scroll */
/* O ✕ fica por cima, ao lado do título (poupa a altura da barra) */
[data-screen="trip-end"] .nav { position: absolute; top: 0; left: 0; z-index: 2; min-height: 48px; }
.te-body { padding: calc(var(--safe-t) + 10px) 16px 8px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
/* Topo fixo em cima, "Fechar" fixo em baixo; o meio fica centrado no espaço entre os dois
   (margin auto em cima e em baixo; se não couber, encosta ao topo e o ecrã faz scroll) */
.te-mid { margin: auto 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.te-hero { flex: none; }
.te-hero { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; text-align: center; }
.te-hero > div { min-width: 0; }
.te-check { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ok); color: #fff; animation: pop-in 0.45s var(--ease) both; }
.te-check svg { width: 20px; height: 20px; stroke-width: 2.8; }
.te-hero .eyebrow { margin: 0; }
.te-hero .headline { margin: 0; font-size: 19px; line-height: 1.15; }
.te-card { min-width: 0; padding: 12px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line); }
.te-rate { text-align: center; }
.te-pics { display: flex; align-items: center; justify-content: center; padding-top: 4px; margin-bottom: 8px; }
.te-car { flex: none; width: 60px; height: 60px; border-radius: 16px; object-fit: cover; background: var(--cream); } /* quadrada: a foto do carro não é cortada */
.te-car[hidden] + .te-photo { margin-left: 0; }
.te-photo { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 60px; height: 60px; margin-left: -12px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #6a7cff, #2a37b8); color: #fff; font-size: 22px; font-weight: 600; box-shadow: 0 0 0 3px #fff; }
.te-photo img { width: 100%; height: 100%; object-fit: cover; }
.te-q { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.te-stars { display: flex; justify-content: center; gap: 2px; margin-top: 4px; }
.te-stars button { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: var(--line); transition: transform 0.15s var(--ease), color 0.15s ease; }
.te-stars button svg { width: 34px; height: 34px; fill: currentColor; stroke: currentColor; stroke-width: 1; }
.te-stars button.is-on { color: var(--brand); }
.te-stars.is-low button.is-on { color: var(--danger); }
.te-stars.is-high button.is-on { color: var(--ok); }
.te-stars button:active { transform: scale(0.88); }
.te-stars button.is-pop { animation: pop-in 0.3s var(--ease) both; }
.te-hint { margin-top: 0; min-height: 18px; font-size: 13.5px; color: var(--muted); }
.te-more:not([hidden]) { display: grid; gap: 6px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); animation: rise 0.3s var(--ease) both; }
.te-more-q { font-size: 14.5px; font-weight: 600; }
.te-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.te-tags button { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13.5px; font-weight: 500; }
.te-tags button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.te-comment { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); font: inherit; font-size: 16px; line-height: 1.35; color: var(--ink); resize: none; outline: none; }
.te-comment:focus { border-color: var(--ink); }
/* Gorjeta */
.te-tip-q { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.te-tip-q b { font-size: 15px; font-weight: 600; }
.te-tip-q span { min-width: 0; font-size: 12.5px; color: var(--muted); text-align: right; }
.te-tip-opts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.te-tip-opts button { min-height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; transition: transform 0.12s var(--ease); }
.te-tip-opts button:active { transform: scale(0.94); }
.te-tip-opts button.is-on { background: var(--brand); border-color: var(--brand); color: var(--ink); }
/* Ligar ao motorista (objetos esquecidos) */
.te-call { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.te-call:active { background: var(--cream); }
.te-call-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--cream); }
.te-call-ico svg { width: 20px; height: 20px; }
.te-call-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.te-call-txt b { font-size: 13px; font-weight: 600; }
.te-call-txt i { font-style: normal; font-size: 12.5px; color: var(--muted); }
[data-screen="trip-end"] .foot { padding-top: 8px; }

/* ---------- Chat com o motorista ---------- */
.chat-badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px #fff; animation: pop-in 0.3s var(--ease) both; }
.chat-badge[hidden] { display: none; }
.chat-head { flex: none; display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 6px) 12px 10px 6px; border-bottom: 1px solid var(--line); background: #fff; }
.chat-head .nav-back { margin-right: 0; }
.chat-head .nav-back svg { width: 22px; height: 22px; }
.chat-avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #6a7cff, #2a37b8); color: #fff; font-size: 16px; font-weight: 600; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.chat-who b { font-size: 16.5px; font-weight: 600; }
.chat-who i { font-style: normal; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-call { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--cream); color: var(--ink); }
.chat-call:active { transform: scale(0.94); }
.chat-call svg { width: 21px; height: 21px; }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 14px 8px; background: var(--paper); }
.chat-note { margin: 0 auto 14px; max-width: 280px; font-size: 12.5px; line-height: 1.4; color: var(--muted); text-align: center; }
.chat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.chat-msg { max-width: 80%; display: flex; flex-direction: column; animation: rise 0.25s var(--ease) both; }
.chat-msg p { padding: 9px 13px; border-radius: 18px; font-size: 15.5px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg time { margin: 3px 6px 0; font-size: 11.5px; color: var(--muted); }
.chat-msg.is-driver { align-self: flex-start; }
.chat-msg.is-driver p { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.chat-msg.is-client { align-self: flex-end; align-items: flex-end; }
.chat-msg.is-client p { background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.chat-msg.is-failed p { opacity: 0.55; }
.chat-msg.is-failed time { color: var(--danger); }
.chat-foot { flex: none; padding: 8px 0 calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: #fff; }
.app.kb-open .chat-foot { padding-bottom: 10px; }
.chat-quick { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 8px; scrollbar-width: none; }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick button { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 500; white-space: nowrap; }
.chat-quick button:active { background: var(--cream); }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 0 12px; }
.chat-form textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 120px; padding: 11px 16px; border: 0; border-radius: 22px; background: var(--cream); font: inherit; font-size: 16px; line-height: 1.35; color: var(--ink); resize: none; outline: none; }
.chat-send { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: var(--ink); transition: opacity 0.15s ease, transform 0.15s ease; }
.chat-send:disabled { opacity: 0.35; }
.chat-send:not(:disabled):active { transform: scale(0.92); }
.chat-send svg { width: 20px; height: 20px; stroke-width: 2; }

.search-head { flex: none; padding: calc(var(--safe-t) + 6px) 16px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.search-top { display: flex; align-items: center; gap: 4px; margin-left: -6px; }
.search-top .nav-back { margin-right: 0; }
.search-top .nav-back svg { width: 22px; height: 22px; }
.search-title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.search-fields { display: flex; gap: 12px; margin-top: 8px; padding: 6px 6px 6px 16px; border-radius: 20px; background: var(--cream); }
.sf-rail { display: flex; flex-direction: column; align-items: center; padding: 19px 0; }
.sf-a { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.sf-line { flex: 1; width: 0; margin: 4px 0; border-left: 2px dotted #c9c5bd; }
.sf-b { width: 10px; height: 10px; border-radius: 2px; background: var(--dest); } /* destino: quadrado vermelho (como no ecrã principal) */
.sf-inputs { flex: 1; min-width: 0; }
.sf-from { display: flex; align-items: center; height: 46px; padding: 0 10px; border-bottom: 1px solid var(--hairline); font-size: 16px; font-weight: 500; color: var(--ink-soft); }
/* Recolha: nome tocável que dá lugar a um campo de pesquisa */
.sf-from-label { flex: 1; min-width: 0; height: 100%; text-align: left; font-size: 16px; font-weight: 500; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-from-label:active { color: var(--ink); }
.sf-from input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: 600 17px var(--font); color: var(--ink); -webkit-appearance: none; appearance: none; }
.sf-from input::placeholder { color: #9d998f; font-weight: 500; }
.sf-from input::-webkit-search-cancel-button { display: none; }
.sf-from.is-active { border-bottom-color: transparent; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1.5px var(--ink); }
.sf-to.is-idle { background: transparent; box-shadow: none; }
.sf-to.is-idle input { font-weight: 500; color: var(--ink-soft); }
.sf-to { display: flex; align-items: center; height: 50px; margin-top: 4px; padding: 0 4px 0 10px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1.5px var(--ink); }
.sf-to input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: 600 17px var(--font); color: var(--ink); -webkit-appearance: none; appearance: none; }
.sf-to input::placeholder { color: #9d998f; font-weight: 500; }
.sf-to input::-webkit-search-cancel-button { display: none; }
.sf-clear { display: grid; place-items: center; width: 40px; height: 40px; color: #b4b0a8; }
.sf-clear svg { width: 20px; height: 20px; }
.search-fields.is-single { padding-left: 6px; }
.search-fields.is-single .sf-rail, .search-fields.is-single .sf-from { display: none; }
.search-fields.is-single .sf-to { margin-top: 0; }

.search-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 0 calc(16px + var(--safe-b)); }
.search-loading { position: absolute; top: 0; left: 0; right: 0; height: 2px; overflow: hidden; }
.search-loading span { position: absolute; top: 0; width: 40%; height: 100%; background: var(--brand); animation: load 1s ease-in-out infinite; }
@keyframes load { from { left: -40%; } to { left: 100%; } }
.results { list-style: none; margin: 0; padding: 0 8px; }
.results button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 8px 12px; border-radius: 16px; text-align: left; transition: background-color 0.15s ease; }
.results button:active, .results button.is-busy { background: var(--cream); }
.rs-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--cream); color: var(--ink-soft); }
.rs-icon svg { width: 19px; height: 19px; }
.results button.is-busy .rs-icon svg { display: none; }
.results button.is-busy .rs-icon::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(0, 0, 0, 0.12); border-top-color: var(--ink); animation: spin 0.7s linear infinite; }
.rs-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.rs-text b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-text i { font-style: normal; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-text i:empty { display: none; }
.rs-dist { flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.results-label { padding: 16px 12px 4px; }
.results-msg { padding: 28px 24px; font-size: 15px; color: var(--muted); text-align: center; }
.powered { padding: 14px 24px 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #b4b0a8; text-align: right; }

/* ---------- Folhas, menu e avisos ---------- */
.scrim { position: absolute; inset: 0; z-index: 20; background: rgba(8, 8, 10, 0.5); opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s 0.35s; }
.scrim.is-on { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
.bsheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  max-height: 78%;
  display: flex;
  flex-direction: column;
  padding: 10px 0 calc(8px + var(--safe-b));
  border-radius: 28px 28px 0 0;
  background: #fff;
  transform: translateY(105%);
  transition: transform 0.45s var(--ease);
}
.bsheet.is-open { transform: none; }
.bsheet-title { padding: 0 24px 10px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.cc-list { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; }
.cc-list button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 16px; border-radius: 14px; text-align: left; font-size: 16px; }
.cc-list button:active { background: var(--cream); }
.cc-list .f { font-size: 24px; }
.cc-list .n { flex: 1; }
.cc-list .c { color: var(--muted); font-variant-numeric: tabular-nums; }
.cc-list button[aria-selected="true"] { background: var(--cream); font-weight: 600; }

.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 21;
  width: min(86%, 360px);
  display: flex;
  flex-direction: column;
  background: #fff;
  transform: translateX(-102%);
  transition: transform 0.45s var(--ease);
  box-shadow: 20px 0 60px -20px rgba(0, 0, 0, 0.4);
}
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: calc(var(--safe-t) + 28px) 22px 22px; border-bottom: 1px solid var(--line); }
.drawer-name { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.drawer-phone { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.drawer-who { flex: 1; min-width: 0; margin: -8px 0 -8px -10px; padding: 8px 10px; border-radius: 14px; text-align: left; transition: background-color 0.15s ease; }
.drawer-who:active { background: var(--cream); }
.drawer-who .drawer-name, .drawer-who .drawer-phone { display: block; }
/* Perfil: telemóvel só para consulta */
.field-readonly { background: #fff; border: 1.5px dashed var(--line); }
/* Campo que abre a pesquisa da morada (formulário de local) */
.field-pick { position: relative; width: 100%; text-align: left; }
.field-pick p { min-height: 34px; display: flex; align-items: center; padding-right: 26px; font-size: 17px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-pick p.is-empty { color: #a8a49c; font-weight: 400; }
.field-pick > svg { position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--muted); }
.places-list { margin-top: 22px; }
.place-gps { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 12px; border-radius: 999px; background: var(--cream); font-size: 14px; font-weight: 600; color: var(--ink); }
.place-gps svg { width: 18px; height: 18px; }
.place-gps:active { transform: scale(0.97); }
.place-gps.is-busy { opacity: 0.6; pointer-events: none; }
.places-list .rc-text i { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#places-add { margin-top: 12px; }
.field-readonly p { height: 34px; display: flex; align-items: center; font-size: 19px; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.field-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.field-note svg { flex: none; width: 17px; height: 17px; margin-top: 1px; }
.drawer-who .drawer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Avaliação à direita do nome e do telemóvel */
.drawer-rating { flex: none; display: flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; background: var(--cream); font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.drawer-rating svg { width: 16px; height: 16px; fill: var(--brand); stroke: var(--brand); }
.drawer-list { flex: 1; overflow-y: auto; padding: 10px 10px; }
.drawer-list button { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 54px; padding: 0 12px; border-radius: 14px; text-align: left; font-size: 16.5px; font-weight: 500; }
.drawer-list button:active { background: var(--cream); }
.drawer-list svg { flex: none; width: 22px; height: 22px; color: var(--ink-soft); }
.badge { margin-left: auto; padding: 3px 9px; border-radius: 999px; background: var(--cream); color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.badge:empty { display: none; }
.badge.is-on { background: #eaf6ee; color: var(--ok); }
.badge-mono { font-family: var(--mono); font-weight: 500; letter-spacing: 0.06em; }
.drawer-foot { padding: 12px 20px calc(16px + var(--safe-b)); border-top: 1px solid var(--line); }
.drawer-ver { margin-top: 10px; text-align: center; font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: 0.06em; }
.drawer-legal { min-height: 32px; padding: 0 4px; font: inherit; letter-spacing: inherit; color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 3px; }
.drawer-legal:active { color: var(--ink); }

.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(var(--safe-t) + 12px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5);
  /* escondido acima do ecrã: sobe a sua altura + a margem do topo (com a margem segura grande ficava à vista) */
  transform: translateY(calc(-100% - 40px - var(--safe-t)));
  transition: transform 0.45s var(--ease);
  pointer-events: none;
}
.toast.is-on { transform: none; }
.toast::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.toast.is-ok::before { background: #3fd07f; }
.toast.is-err::before { background: #ff5a5a; }

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0.01s; }
  *, *::before, *::after { animation-duration: 0.01s !important; animation-iteration-count: 1 !important; }
}
