/* App del vendedor y página del cliente — pantallas de teléfono */

html,
body {
  height: 100%;
}

body.phone-page {
  display: grid;
  place-items: center;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 20% -10%, color-mix(in oklab, var(--brand) 10%, transparent), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, color-mix(in oklab, var(--brand-2) 7%, transparent), transparent 60%),
    var(--bg-2);
  transition: background 600ms var(--ease);
}

/* Marco de teléfono solo en pantallas grandes */
.device {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

@media (min-width: 620px) {
  .device {
    width: 402px;
    height: min(874px, calc(100dvh - 48px));
    border-radius: 56px;
    box-shadow:
      0 0 0 11px #0e0f11,
      0 0 0 12.5px #2a2c30,
      0 40px 100px -20px rgba(10, 12, 20, 0.45),
      0 18px 40px -18px rgba(10, 12, 20, 0.4);
  }
  .device::before {
    content: "";
    position: absolute;
    z-index: 100;
    top: 11px;
    left: 50%;
    width: 122px;
    height: 35px;
    margin-left: -61px;
    border-radius: 20px;
    background: #0b0b0c;
    pointer-events: none;
  }
}

@media (min-width: 1100px) {
  .side-note {
    display: block;
  }
}

.side-note {
  display: none;
  position: fixed;
  left: 32px;
  bottom: 28px;
  max-width: 300px;
  font-size: 13px;
  color: var(--muted);
}

.side-note a {
  color: var(--ink);
  font-weight: 500;
}

.side-note .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  text-decoration: none;
}

/* Barra de estado falsa */
.statusbar {
  position: absolute;
  z-index: 90;
  inset: 0 0 auto;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 34px 0 40px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  pointer-events: none;
  transition: color 300ms;
}

.statusbar.light {
  color: #fff;
}

.statusbar .sb-icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.statusbar .sb-loc {
  display: none;
  width: 14px;
  height: 14px;
  color: var(--brand);
}

.statusbar.loc .sb-loc {
  display: block;
}

@media (max-width: 619px) {
  .statusbar {
    display: none;
  }
}

/* ---------- Pantallas ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  transition: transform 520ms var(--ease), opacity 520ms var(--ease), filter 520ms var(--ease);
  will-change: transform;
}

.screen.enter {
  transform: translateX(100%);
}

.screen.leave {
  transform: translateX(-28%);
  filter: brightness(0.92);
}

.screen.enter-up {
  transform: translateY(100%);
}

.screen.fade {
  opacity: 0;
  transform: scale(0.985);
}

.scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.scroll::-webkit-scrollbar {
  display: none;
}

.pad {
  padding: 0 20px;
}

.top-safe {
  padding-top: 64px;
}

@media (max-width: 619px) {
  .top-safe {
    padding-top: max(20px, env(safe-area-inset-top));
  }
}

.bottom-bar {
  position: relative;
  padding: 12px 20px max(26px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.bottom-bar::before {
  content: "";
  position: absolute;
  inset: -28px 0 100%;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 12px;
}

.nav-title {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  margin-right: 40px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  transition: background 150ms, transform 150ms var(--ease-out);
}

.icon-btn:active {
  transform: scale(0.92);
  background: rgba(17, 18, 20, 0.06);
}

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 4px 10px;
}

/* ---------- Bienvenida / empresa ---------- */
.app-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 15px;
}

.app-mark svg {
  width: 22px;
  height: 22px;
  color: var(--ink);
}

.company-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  width: 100%;
  padding: 22px 20px 18px;
  text-align: left;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  transition: transform 200ms var(--ease-out), box-shadow 200ms;
  overflow: hidden;
}

.company-card:active {
  transform: scale(0.98);
}

.company-card img {
  height: 34px;
  width: auto;
}

.company-card .cc-foot {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--muted);
}

.company-card .cc-arrow {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-tint);
  color: var(--c);
}

.company-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--c-tint), transparent);
}

/* ---------- Formularios ---------- */
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 16px;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow 200ms;
}

.field:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 4px rgba(17, 18, 20, 0.06);
}

.field input,
.field textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
}

.field .prefix {
  font-weight: 500;
  color: var(--muted);
}

textarea.area {
  width: 100%;
  min-height: 96px;
  padding: 14px 16px;
  border: 0;
  outline: 0;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
  resize: none;
  font-size: 15px;
  line-height: 1.45;
}

textarea.area:focus {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.otp span {
  display: grid;
  place-items: center;
  height: 60px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 500;
  transition: box-shadow 200ms, transform 300ms var(--spring);
}

.otp span.on {
  box-shadow: inset 0 0 0 1.5px var(--ink);
  transform: translateY(-2px);
}

/* ---------- Permisos ---------- */
.perm {
  display: flex;
  gap: 14px;
  padding: 16px;
}

.perm + .perm {
  border-top: 1px solid var(--line);
}

.perm .ico {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-tint);
  color: var(--brand);
}

.perm p {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}

.privacy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r);
  background: rgba(17, 18, 20, 0.04);
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------- Hoy ---------- */
.hello {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.co-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12.5px;
  font-weight: 500;
}

.co-pill img {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  object-fit: contain;
}

/* Tarjeta de jornada */
.shift {
  position: relative;
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--ink);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  transition: background 500ms var(--ease);
}

.shift::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(420px 220px at 110% -20%, color-mix(in oklab, var(--brand) 70%, transparent), transparent 70%),
    radial-gradient(300px 200px at -20% 130%, color-mix(in oklab, var(--brand) 40%, transparent), transparent 70%);
  opacity: 0.9;
}

.shift .eyebrow {
  color: rgba(255, 255, 255, 0.6);
}

.shift-time {
  font-family: var(--mono);
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 10px 0 4px;
  font-feature-settings: "tnum", "zero";
}

.shift-sub {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.66);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ddc84;
  color: #3ddc84;
  margin-right: 6px;
  vertical-align: 1px;
}

.shift-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.shift-stats b {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.shift-stats span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* Botón mantener presionado */
.hold {
  position: relative;
  width: 100%;
  height: 60px;
  margin-top: 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 200ms var(--ease-out);
}

.hold .fill {
  position: absolute;
  inset: 0;
  background: #fff;
  transform-origin: left;
  transform: scaleX(0);
}

.hold.holding .fill {
  transform: scaleX(1);
  transition: transform 1100ms linear;
}

.hold:not(.holding) .fill {
  transition: transform 300ms var(--ease);
}

.hold .lbl {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
}

.hold .lbl.dark {
  position: absolute;
  inset: 0;
  color: var(--ink);
  clip-path: inset(0 100% 0 0);
}

.hold.holding .lbl.dark {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1100ms linear;
}

.hold:not(.holding) .lbl.dark {
  transition: clip-path 300ms var(--ease);
}

.hold:active {
  transform: scale(0.985);
}

/* Lista de visitas */
.visit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  width: 100%;
  text-align: left;
}

.visit-row + .visit-row {
  border-top: 1px solid var(--line);
}

.visit-row .vr-time {
  width: 44px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.visit-row .vr-main {
  flex: 1;
  min-width: 0;
}

.visit-row .vr-main b {
  display: block;
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visit-row .vr-main span {
  font-size: 12.5px;
  color: var(--muted);
}

.empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.empty .ring {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(17, 18, 20, 0.05);
}

/* Mapa mini */
.mini-map {
  position: relative;
  height: 150px;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
  background: #e9e8e3;
}

.mini-map .maplibregl-ctrl-attrib {
  display: none;
}

.me-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand);
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px color-mix(in oklab, var(--brand) 22%, transparent), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ---------- Elegir cliente ---------- */
.client-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  transition: background 150ms;
}

.client-row:active {
  background: rgba(17, 18, 20, 0.04);
}

.client-row + .client-row {
  border-top: 1px solid var(--line);
}

.client-ico {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(17, 18, 20, 0.05);
  color: var(--ink-2);
}

.client-row.here .client-ico {
  background: var(--brand);
  color: #fff;
}

.client-row .cr-main {
  flex: 1;
  min-width: 0;
}

.client-row b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-row span {
  font-size: 13px;
  color: var(--muted);
}

.client-row .dist {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  text-align: right;
}

.client-row.here .dist {
  color: var(--brand);
  font-weight: 500;
}

.here-tag {
  display: block;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
}

/* ---------- Llegada ---------- */
.arrive-map {
  position: relative;
  height: 46%;
  min-height: 300px;
  background: #e9e8e3;
}

.arrive-map .maplibregl-ctrl-attrib {
  font-size: 9px;
}

.arrive-map::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 80px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}

.arrive-map .nav {
  position: absolute;
  z-index: 5;
  top: 52px;
  left: 0;
  right: 0;
}

@media (max-width: 619px) {
  .arrive-map .nav {
    top: max(8px, env(safe-area-inset-top));
  }
}

.arrive-map .icon-btn {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(10px);
}

.client-pin {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.client-pin svg {
  transform: rotate(45deg);
  width: 16px;
  height: 16px;
}

.checks {
  display: flex;
  flex-direction: column;
}

.check {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  opacity: 0.35;
  transition: opacity 400ms var(--ease);
}

.check + .check {
  border-top: 1px solid var(--line);
}

.check .ck {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  color: transparent;
  transition: background 300ms, box-shadow 300ms, color 300ms;
}

.check .ck svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 400ms 120ms var(--ease-out);
}

.check.run {
  opacity: 1;
}

.check.run .ck {
  box-shadow: inset 0 0 0 1.5px var(--ink);
  border-top-color: transparent;
}

.check.run:not(.done) .ck::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--ink);
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.check.done {
  opacity: 1;
}

.check.done .ck {
  background: var(--ok);
  box-shadow: none;
  color: #fff;
}

.check.done .ck svg {
  stroke-dashoffset: 0;
}

.check b {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
}

.check span {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Cámara ---------- */
.camera {
  background: #000;
  color: #fff;
}

.viewfinder {
  position: relative;
  flex: 1;
  overflow: hidden;
  margin-top: 54px;
}

@media (max-width: 619px) {
  .viewfinder {
    margin-top: 0;
  }
}

.viewfinder svg.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.viewfinder .grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.25) 33.33%, transparent calc(33.33% + 0.5px), transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.25) 66.66%, transparent calc(66.66% + 0.5px)),
    linear-gradient(transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.25) 33.33%, transparent calc(33.33% + 0.5px), transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.25) 66.66%, transparent calc(66.66% + 0.5px));
}

.viewfinder .hint {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  font-size: 13px;
  white-space: nowrap;
}

.stamp {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: #fff;
}

.cam-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 34px 40px;
}

.shutter {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid #fff;
  display: grid;
  place-items: center;
}

.shutter::after {
  content: "";
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms var(--ease-out);
}

.shutter:active::after {
  transform: scale(0.88);
}

.flash {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.flash.go {
  animation: flash 520ms var(--ease-out);
}

@keyframes flash {
  0% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
  }
}

.cam-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  width: 80px;
}

/* ---------- Visita / hoja ---------- */
.visit-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.visit-head .ph {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  background: #222;
}

.visit-head .ph svg {
  width: 100%;
  height: 100%;
}

.timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ok);
}

.step {
  margin-top: 26px;
}

.step-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 12px;
}

.step-n {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
}

.options {
  display: grid;
  gap: 8px;
}

.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
  text-align: left;
  transition: box-shadow 200ms, background 200ms, transform 160ms var(--ease-out);
}

.opt:active {
  transform: scale(0.985);
}

.opt .o-ico {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(17, 18, 20, 0.05);
  transition: background 200ms, color 200ms;
}

.opt b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.opt span {
  font-size: 12.5px;
  color: var(--muted);
}

.opt .radio {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  transition: box-shadow 250ms var(--spring);
}

.opt.on {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.opt.on .o-ico {
  background: var(--ink);
  color: #fff;
}

.opt.on .radio {
  box-shadow: inset 0 0 0 7px var(--ink);
}

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

.tag {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 200ms, color 200ms, box-shadow 200ms, transform 150ms var(--ease-out);
}

.tag:active {
  transform: scale(0.96);
}

.tag.on {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}

.reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 460ms var(--ease), opacity 360ms var(--ease);
}

.reveal > div {
  overflow: hidden;
}

.reveal.open {
  grid-template-rows: 1fr;
  opacity: 1;
}

/* Pedido */
.order-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.order-line + .order-line {
  border-top: 1px solid var(--line);
}

.thumb {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f3f3f1;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.thumb .ph-txt {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding: 2px;
  line-height: 1.1;
}

.ol-main {
  flex: 1;
  min-width: 0;
}

.ol-main b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.ol-main span {
  font-size: 12px;
  color: var(--muted);
}

.ol-main .code {
  font-family: var(--mono);
  font-size: 11px;
}

.stepper {
  flex: none;
  display: flex;
  align-items: center;
  height: 36px;
  border-radius: 11px;
  background: rgba(17, 18, 20, 0.05);
}

.stepper button {
  width: 34px;
  height: 36px;
  display: grid;
  place-items: center;
}

.stepper button svg {
  width: 16px;
  height: 16px;
}

.stepper output {
  min-width: 30px;
  text-align: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
}

.add-btn {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border-radius: 11px;
  background: rgba(17, 18, 20, 0.05);
  font-size: 13px;
  font-weight: 600;
}

.add-product {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  border-top: 1px solid var(--line);
  color: var(--brand);
  font-weight: 600;
  font-size: 14.5px;
}

/* ---------- Hoja inferior (catálogo) ---------- */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(10, 12, 16, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease);
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: absolute;
  z-index: 61;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100% - 64px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-3);
  transform: translateY(105%);
  transition: transform 520ms var(--ease);
}

.sheet.open {
  transform: translateY(0);
}

.sheet.full {
  height: calc(100% - 64px);
}

.grabber {
  width: 38px;
  height: 5px;
  margin: 8px auto 4px;
  border-radius: 3px;
  background: rgba(17, 18, 20, 0.18);
}

.cat-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 20px 12px;
  scrollbar-width: none;
}

.cat-scroll::-webkit-scrollbar {
  display: none;
}

.cat-scroll .tag {
  flex: none;
  height: 32px;
  font-size: 13px;
}

.variants {
  padding: 0 14px 12px 74px;
  display: grid;
  gap: 6px;
}

.variant {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.variant .vname {
  flex: 1;
  min-width: 0;
}

.variant .vname small {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.variant .stepper {
  height: 32px;
}

.variant .stepper button {
  height: 32px;
  width: 30px;
}

.cart-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ---------- Entregar teléfono / firma ---------- */
.handoff {
  background: var(--ink);
  color: #fff;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.handoff .big-ico {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  margin: 0 auto 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  animation: nudge 2.2s var(--ease) infinite;
}

@keyframes nudge {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-8px) rotate(-6deg);
  }
}

.handoff .big-ico svg {
  width: 40px;
  height: 40px;
}

.handoff p {
  color: rgba(255, 255, 255, 0.65);
}

.client-face {
  background: #fff;
}

.cf-head {
  padding: 64px 20px 18px;
  background: var(--brand);
  color: #fff;
  position: relative;
  overflow: hidden;
}

@media (max-width: 619px) {
  .cf-head {
    padding-top: max(20px, env(safe-area-inset-top));
  }
}

.cf-head::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 30px solid rgba(255, 255, 255, 0.07);
}

.cf-logo {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
}

.cf-logo img {
  height: 22px;
  width: auto;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  font-size: 14px;
}

.summary-row + .summary-row {
  border-top: 1px dashed var(--line-2);
}

.summary-row span:first-child {
  color: var(--muted);
}

.summary-row span:last-child {
  text-align: right;
  font-weight: 500;
}

.sig-pad {
  position: relative;
  height: 190px;
  border-radius: var(--r);
  background: #fbfbfa;
  box-shadow: inset 0 0 0 1px var(--line-2);
  touch-action: none;
  overflow: hidden;
}

.sig-pad canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.sig-pad .sig-line {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 44px;
  border-top: 1px solid var(--line-2);
  pointer-events: none;
}

.sig-pad .sig-x {
  position: absolute;
  left: 22px;
  bottom: 50px;
  font-size: 18px;
  color: var(--faint);
  pointer-events: none;
}

.sig-pad .sig-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
  pointer-events: none;
}

.sig-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 8px;
}

/* ---------- Enviado ---------- */
.done-mark {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto;
}

.done-mark svg {
  width: 100%;
  height: 100%;
}

.done-mark circle {
  fill: var(--ok);
  transform-origin: center;
  animation: pop 600ms var(--spring) both;
}

.done-mark path {
  fill: none;
  stroke: #fff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw 500ms 300ms var(--ease-out) forwards;
}

@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.wa-preview {
  padding: 14px;
  border-radius: var(--r-lg);
  background: #efe7dd;
  background-image: radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 14px 14px;
}

.wa-bubble {
  position: relative;
  max-width: 88%;
  padding: 9px 11px 8px;
  border-radius: 4px 14px 14px 14px;
  background: #fff;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.wa-bubble .wa-from {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: #075e54;
  margin-bottom: 2px;
}

.wa-bubble .wa-time {
  display: block;
  text-align: right;
  font-size: 10.5px;
  color: #8a8a8a;
  margin-top: 2px;
}

.wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px -11px -8px;
  padding: 10px;
  border-top: 1px solid #eee;
  color: #0a84ff;
  font-weight: 500;
  font-size: 14px;
}

.proofs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.proof {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 500;
}

.proof .p-ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ok-bg);
  color: var(--ok);
  transition: background 400ms, color 400ms;
}

.proof .p-ico svg {
  width: 16px;
  height: 16px;
}

.proof.wait .p-ico {
  background: var(--warn-bg);
  color: var(--warn);
}

.proof small {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}

/* Aviso flotante */
.toast {
  position: absolute;
  z-index: 80;
  top: 58px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: var(--shadow-2), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transform: translateY(calc(-100% - 90px));
  transition: transform 560ms var(--ease);
}

@media (max-width: 619px) {
  .toast {
    top: max(10px, env(safe-area-inset-top));
  }
}

.toast.show {
  transform: translateY(0);
}

.toast .t-ico {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--ok);
  color: #fff;
}

.toast b {
  display: block;
  font-size: 14px;
}

.toast span {
  font-size: 12.5px;
  color: var(--muted);
}

.note {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}

.demo-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(17, 18, 20, 0.05);
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Código de visita ---------- */
.code-hero {
  text-align: center;
  padding-top: 18px;
}

.code-ico {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #25d366;
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(37, 211, 102, 0.8);
}

.otp4 {
  position: relative;
  grid-template-columns: repeat(4, 64px);
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  cursor: text;
}

.otp4 span {
  height: 76px;
  font-size: 32px;
  border-radius: 18px;
}

.otp span.good {
  background: var(--ok-bg);
  color: var(--ok);
  box-shadow: inset 0 0 0 1.5px var(--ok);
}

.otp span.bad {
  color: var(--bad);
  box-shadow: inset 0 0 0 1.5px var(--bad);
  animation: shakeX 420ms var(--ease-out);
}

@keyframes shakeX {
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(3px);
  }
}

.code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  font-size: 16px;
  caret-color: transparent;
}

.code-msg {
  margin-top: 14px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  min-height: 20px;
}

.code-msg svg {
  vertical-align: -3px;
}

.demo-tip {
  display: block;
  margin: 14px auto 0;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(17, 18, 20, 0.05);
  font-size: 12.5px;
  color: var(--ink-2);
}

.wa-preview .wa-btn + .wa-btn {
  margin-top: 0;
}

/* ---------- WhatsApp (pantalla del cliente) ---------- */
.wa-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #efe7dd;
  background-image: radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 14px 14px;
}

.wa-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 58px 12px 10px;
  background: #f6f6f6;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 619px) {
  .wa-head {
    padding-top: max(12px, env(safe-area-inset-top));
  }
}

.wa-av {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.wa-av img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.wa-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: none;
}

.wa-day {
  align-self: center;
  font-size: 11.5px;
  background: #e1f2fb;
  color: #555;
  padding: 4px 10px;
  border-radius: 8px;
}

.wa-foot {
  padding: 10px 12px 34px;
  background: #f6f6f6;
}

.wa-foot span {
  display: block;
  height: 36px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.wa-bubble.wa-me {
  align-self: flex-end;
  background: #d9fdd3;
  border-radius: 14px 4px 14px 14px;
}

.wa-code {
  margin: 8px 0 4px;
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #111;
}

.wa-note {
  align-self: center;
  max-width: 80%;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff7d6;
  color: #6b5a12;
  font-size: 12px;
  text-align: center;
}

button.wa-btn {
  width: calc(100% + 22px);
}

button.wa-btn[disabled] {
  color: #9aa0a6;
}

.pop-in {
  animation: pop 0.45s var(--spring) both;
  transform-origin: left bottom;
}

.wa-me.pop-in {
  transform-origin: right bottom;
}

/* Hoja corta */
.yesno {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.yesno .opt {
  justify-content: center;
  padding: 16px 12px;
}

.tag2 {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: auto;
  min-height: 52px;
  padding: 8px 14px;
  border-radius: 14px;
  line-height: 1.2;
  cursor: pointer;
}

.tag2 small {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  opacity: 0.6;
  margin-top: 2px;
}

.tag2 input[type="date"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
