:root {
  --rose: #ff6f91;
  --rose-deep: #e0527a;
  --rose-soft: #ffb3c6;
  --blush: #ffe5ec;
  --blush-2: #fff2f5;
  --cream: #fffaf8;
  --lilac: #cdb4f6;
  --plum: #5b3a4f;
  --plum-soft: #8f6c80;
  --white: #fff;
  --radius: 22px;
  --shadow-soft: 0 10px 30px rgba(224, 82, 122, .22), 0 2px 6px rgba(91, 58, 79, .08);
  --shadow-pop: 0 14px 40px rgba(224, 82, 122, .32), 0 3px 10px rgba(91, 58, 79, .12);
  --font-brand: 'Pacifico', 'Brush Script MT', cursive;
  --font-hand: 'Caveat', 'Segoe Print', cursive;
  --font-body: 'Quicksand', 'Segoe UI', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 29'%3E%3Cpath fill='%23ff6f91' stroke='%23fff' stroke-width='2.4' d='M16 27.5S2.5 19.2 2.5 9.8A7 7 0 0 1 16 6a7 7 0 0 1 13.5 3.8C29.5 19.2 16 27.5 16 27.5Z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--blush);
  color: var(--plum);
  font-family: var(--font-body);
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

#map { position: fixed; inset: 0; }

button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; }

/* ---------- Pantalla de carga ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 42%, var(--blush-2), var(--blush) 60%, #ffd6e2);
  transition: opacity .7s ease, visibility .7s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader-heart { width: 74px; height: 67px; fill: var(--rose); animation: beat 1.1s ease-in-out infinite; filter: drop-shadow(0 8px 16px rgba(224, 82, 122, .4)); }
.loader p { margin: 0; font-family: var(--font-hand); font-size: 26px; font-weight: 700; color: var(--rose-deep); }

/* ---------- Cabecera ---------- */
.brand {
  position: fixed;
  top: calc(14px + var(--safe-t));
  left: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 80px);
}
.brand h1 {
  margin: 0;
  padding: 4px 20px 10px;
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: clamp(20px, 4vw, 27px);
  color: var(--rose-deep);
  background: rgba(255, 255, 255, .92);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  color: var(--white);
  background: var(--rose);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}
.badge svg { width: 14px; height: 13px; fill: currentColor; }

/* ---------- Botones flotantes ---------- */
.fab-bar {
  position: fixed;
  right: 16px;
  bottom: calc(24px + var(--safe-b));
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}
.fab {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .95);
  border: 0;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), box-shadow .18s ease;
}
.fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: var(--shadow-pop); }
.fab:active { transform: scale(.94); }
.fab svg { width: 22px; height: 22px; fill: none; stroke: var(--rose-deep); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fab .ico-play, .fab .ico-stop, #btn-menu svg { fill: var(--rose-deep); stroke: none; }
#btn-menu svg { stroke: var(--rose-deep); stroke-width: 1; }
.fab .ico-stop { display: none; }
.fab.is-on { background: var(--rose); }
.fab.is-on svg { stroke: var(--white); }
.fab.is-on .ico-play, .fab.is-on .ico-stop { fill: var(--white); }
.fab.is-on .ico-play { display: none; }
.fab.is-on .ico-stop { display: block; }
/* Nombre debajo de cada botón */
.fab-cap {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--plum);
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff;
}
.fab-main {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: 58px;
  padding: 0 22px 0 16px;
  font-weight: 700;
  font-size: 17px;
  color: var(--white);
  background: linear-gradient(140deg, #ff8fab, var(--rose-deep));
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(224, 82, 122, .45);
  margin-right: -2px;
}
.fab-main svg { width: 26px; height: 26px; stroke: var(--white); stroke-width: 3; }
.fab-bar { align-items: flex-end; }
.fab-bar .fab:not(.fab-main) { margin-right: 5px; }

/* ---------- Menú ---------- */
.menu {
  position: fixed;
  z-index: 9;
  right: 76px;
  bottom: calc(96px + var(--safe-b));
  display: flex;
  flex-direction: column;
  min-width: 250px;
  max-height: calc(100dvh - 120px - var(--safe-b) - var(--safe-t));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  animation: pop .25s cubic-bezier(.3, 1.5, .5, 1) both;
  transform-origin: 100% 100%;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  font-weight: 600;
  font-size: 15px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.menu-item:hover { background: var(--blush-2); }
.menu-themes { padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1.5px dashed var(--rose-soft); }
.menu-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--plum-soft); }
.swatches { display: flex; gap: 8px; justify-content: space-between; }
.swatch-wrap { display: grid; justify-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--plum-soft); }
.swatch {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px #ecd3dc, 0 3px 8px rgba(91, 58, 79, .15);
  transition: scale .15s ease, box-shadow .15s ease;
}
.swatch:hover { scale: 1.08; }
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--rose), 0 4px 10px rgba(224, 82, 122, .35); }
.menu-ico { width: 22px; text-align: center; }
#btn-route[aria-pressed='false'] { opacity: .55; }

/* ---------- Marcadores con corazón ---------- */
.pin {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 4px solid var(--white);
  border-radius: 50%;
  background: var(--blush) center / cover no-repeat;
  box-shadow: 0 0 0 2.5px var(--rose-soft), 0 8px 18px rgba(224, 82, 122, .35);
  transition: scale .2s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s ease;
  /* sin "position": la pone MapLibre (absolute) para colocar el marcador */
}
.pin::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -17px;
  width: 22px;
  height: 20px;
  transform: translateX(-50%);
  background: var(--heart) center / contain no-repeat;
  filter: drop-shadow(0 2px 3px rgba(224, 82, 122, .4));
}
/* Ojo: nunca usar "transform" aquí, MapLibre lo usa para posicionar el marcador; usamos "scale" */
.pin:hover { scale: 1.12; z-index: 2; }
.pin.is-active {
  z-index: 3;
  box-shadow: 0 0 0 3px var(--rose), 0 10px 24px rgba(224, 82, 122, .5);
  scale: 1.15; /* quieta: más grande y con aro rosa, sin animación */
}
.pin-pop { animation: pop .55s cubic-bezier(.2, 1.6, .4, 1) both; }

.pick-marker {
  width: 38px;
  height: 35px;
  background: var(--heart) center / contain no-repeat;
  filter: drop-shadow(0 4px 6px rgba(224, 82, 122, .5));
}

/* ---------- Estado vacío ---------- */
.empty {
  position: fixed;
  z-index: 4;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: min(340px, calc(100vw - 32px));
  padding: 22px 22px 18px;
  text-align: center;
  background: rgba(255, 255, 255, .95);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both;
}
.empty svg { width: 44px; height: 40px; margin: 0 auto 8px; fill: var(--rose); animation: beat 1.4s ease-in-out infinite; }
.empty p { margin: 0; font-size: 16px; line-height: 1.5; }
.empty b { color: var(--rose-deep); }

/* ---------- Polaroid ---------- */
.card {
  position: fixed;
  z-index: 7;
  top: calc(84px + var(--safe-t));
  left: 22px;
  width: min(370px, calc(100vw - 44px));
  max-height: calc(100vh - 116px - var(--safe-t));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 14px 12px;
  background: var(--white);
  border-radius: 6px;
  box-shadow: var(--shadow-pop);
  transform: rotate(-1.2deg);
  transform-origin: 50% 0;
  scrollbar-width: thin;
}
.card.enter { animation: polaroid-in .65s cubic-bezier(.2, 1.3, .4, 1) both; }
.tape {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 110px;
  height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: repeating-linear-gradient(45deg, rgba(255, 143, 171, .55) 0 8px, rgba(255, 179, 198, .55) 8px 16px);
  border-radius: 2px;
  z-index: 2;
  pointer-events: none;
}
/* Botón de cerrar (cruz) reutilizable */
.x-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--white);
  background: var(--rose);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(224, 82, 122, .45);
  transition: scale .15s ease, background .15s ease;
}
.x-btn:hover { background: var(--rose-deep); scale: 1.08; }
.x-btn:active { scale: .92; }
.x-btn svg { width: 20px; height: 20px; }
.x-small { width: 32px; height: 32px; border-width: 2px; box-shadow: 0 2px 8px rgba(224, 82, 122, .35); }
.x-small svg { width: 16px; height: 16px; }

.card-close { position: absolute; top: 4px; right: 4px; z-index: 3; }
.card-photo {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--blush);
  cursor: zoom-in;
}
.zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--rose-deep);
  background: rgba(255, 255, 255, .9);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(91, 58, 79, .25);
  transition: scale .15s ease;
}
.zoom-hint svg { width: 17px; height: 17px; }
.card-photo:hover .zoom-hint { scale: 1.12; }
.card-photo img {
  display: block;
  width: 100%;
  max-height: 46vh;
  object-fit: cover;
}
.card-body { padding: 10px 4px 2px; }
.card-title {
  margin: 0;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  color: var(--plum);
}
.card-title:empty { display: none; }
.card-date {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--rose-deep);
}
.card-date::before { content: ''; width: 14px; height: 13px; background: var(--heart) center / contain no-repeat; }
.card-date:empty { display: none; }
.card-caption {
  margin: 10px 0 4px;
  padding: 10px 14px;
  font-family: var(--font-hand);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--plum);
  background: var(--blush-2);
  border-radius: 14px;
}
.card-caption:empty { display: none; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding-top: 10px; border-top: 1.5px dashed var(--rose-soft); }
.card-nav, .card-tools { display: flex; align-items: center; gap: 6px; }
.card-pos { font-weight: 700; font-size: 13px; min-width: 40px; text-align: center; color: var(--plum-soft); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-round svg { width: 20px; height: 20px; margin: auto; }
.btn-soft { display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; font-size: 14px; color: var(--plum); background: var(--blush-2); }
.btn-soft.danger { color: var(--rose-deep); }
.spacer { flex: 1; }

/* ---------- Botones genéricos ---------- */
.btn {
  min-height: 40px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 15px;
  color: var(--rose-deep);
  background: var(--blush-2);
  border: 0;
  border-radius: 999px;
  transition: transform .12s ease, background .15s ease;
}
.btn:hover { background: var(--blush); }
.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn:focus-visible, .fab:focus-visible, .x-btn:focus-visible, .swatch:focus-visible, .menu-item:focus-visible { outline: 3px solid var(--rose-soft); outline-offset: 2px; }
.btn:focus:not(:focus-visible) { outline: none; }
.btn-primary {
  color: var(--white);
  background: linear-gradient(140deg, #ff8fab, var(--rose-deep));
  box-shadow: 0 6px 16px rgba(224, 82, 122, .35);
}
.btn-primary:hover { background: linear-gradient(140deg, #ff7f9f, #d6466f); }
.btn-round { width: 40px; padding: 0; font-size: 24px; line-height: 1; }
.btn-link { background: transparent; color: var(--plum-soft); font-weight: 600; padding: 8px 8px; }
.btn-link:hover { background: var(--blush-2); }
.btn-link.danger { color: var(--rose-deep); }

/* ---------- Formulario ---------- */
.editor {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  color: var(--plum);
  background: var(--white);
  border: 0;
  border-radius: 26px;
  box-shadow: var(--shadow-pop);
}
.editor::backdrop { background: rgba(91, 58, 79, .45); }
.editor[open] { animation: pop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.editor form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.editor h2 { margin: 0; font-family: var(--font-brand); font-weight: 400; font-size: 28px; color: var(--rose-deep); }

.drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 2.5px dashed var(--rose-soft);
  border-radius: 18px;
  background: var(--blush-2);
  cursor: pointer;
  overflow: hidden;
  text-align: center;
  font-weight: 700;
  color: var(--rose-deep);
  transition: background .15s ease;
}
.drop:hover { background: var(--blush); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { width: 100%; max-height: 240px; object-fit: contain; display: block; }
.drop-text { display: grid; justify-items: center; gap: 8px; }
.drop-text svg { width: 40px; height: 36px; fill: var(--rose-soft); }
.drop.is-edit { cursor: default; border-style: solid; }
.drop.is-edit input { display: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { font-weight: 700; font-size: 14px; padding: 0; color: var(--plum); }
.field input, .field textarea, .search-row input, .coords input {
  width: 100%;
  min-width: 0;
  padding: 11px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--plum);
  background: var(--blush-2);
  border: 2px solid transparent;
  border-radius: 14px;
  transition: border-color .15s ease, background .15s ease;
}
.field input::placeholder, .field textarea::placeholder { color: #b9939f; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--rose-soft); background: var(--white); }
.field textarea { resize: vertical; font-family: var(--font-hand); font-size: 22px; line-height: 1.2; }

.search-row, .coords { display: flex; gap: 6px; }
.coords { flex-wrap: wrap; margin-top: 6px; }
.coords input { flex: 1 1 110px; }
.coords .btn { flex: 1 1 100%; }
.search-results {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px;
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  max-height: 190px;
  overflow-y: auto;
}
.search-results li { padding: 9px 11px; cursor: pointer; font-size: 14px; border-radius: 10px; }
.search-results li:hover { background: var(--blush-2); }

.hint { margin: 2px 0 0; font-size: 13px; color: var(--plum-soft); min-height: 1em; }
.hint.ok { color: #c2416a; font-weight: 700; }
.error { margin: 0; padding: 8px 12px; color: #b3264f; background: #ffe0e8; border-radius: 12px; font-weight: 700; }
.editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- Modo marcar en mapa ---------- */
.pick-banner {
  position: fixed;
  z-index: 8;
  left: 50%;
  top: calc(16px + var(--safe-t));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  font-weight: 700;
  background: var(--white);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  white-space: nowrap;
}
body.picking #map { cursor: crosshair; }
body.picking .brand, body.picking .fab-bar, body.picking .card, body.picking .menu { display: none; }

/* ---------- Ayuda iPhone ---------- */
.ios-tip {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  transform: translateX(-50%);
  width: min(340px, calc(100vw - 32px));
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-pop);
  animation: pop .35s ease both;
}
.ios-tip b:first-of-type { display: block; font-family: var(--font-hand); font-size: 24px; color: var(--rose-deep); }
.ios-share { display: inline-grid; vertical-align: -5px; }
.ios-share svg { width: 20px; height: 20px; fill: none; stroke: #2f7cf6; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ios-tip-close { position: absolute; top: -12px; right: -8px; }
.install-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: min(420px, calc(100vw - 32px));
  top: calc(80px + var(--safe-t));
  bottom: auto;
}
.install-icon { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.install-text { flex: 1; display: grid; line-height: 1.3; font-size: 14px; }
.install-tip .install-text b { display: block; font-family: var(--font-body); font-size: 15px; color: var(--plum); }
.install-tip .btn { flex: none; }

/* ---------- Cuenta atrás: etiqueta de arriba ---------- */
.cd-chip {
  position: fixed;
  z-index: 5;
  top: calc(70px + var(--safe-t));
  left: 16px;
  max-width: calc(100vw - 90px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  text-align: left;
  background: rgba(255, 255, 255, .95);
  border: 0;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}
.cd-chip-emoji {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--blush);
  border-radius: 50%;
  flex: none;
}
.cd-chip-text { display: grid; line-height: 1.15; min-width: 0; }
.cd-chip-title { font-size: 12px; font-weight: 700; color: var(--plum-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-chip-time { font-size: 14px; font-weight: 700; color: var(--rose-deep); font-variant-numeric: tabular-nums; white-space: nowrap; }
body.card-open .cd-chip, body.picking .cd-chip { display: none; }
.install-tip { top: calc(124px + var(--safe-t)); }

/* ---------- Cuenta atrás: panel ---------- */
.cd-wrap { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.cd-dlg h2 { margin: 0; font-family: var(--font-brand); font-weight: 400; font-size: 28px; color: var(--rose-deep); }
.cd-list { display: grid; gap: 12px; }
.cd-item {
  position: relative;
  padding: 14px 14px 12px;
  background: var(--blush-2);
  border-radius: 18px;
}
.cd-item.is-done { background: #fff4d6; }
.cd-head { display: flex; align-items: center; gap: 10px; padding-right: 70px; }
.cd-emoji { font-size: 26px; }
.cd-title { margin: 0; font-family: var(--font-hand); font-size: 26px; font-weight: 700; line-height: 1.05; color: var(--plum); overflow-wrap: anywhere; }
.cd-date { margin: 2px 0 0; font-size: 12px; font-weight: 600; color: var(--plum-soft); }
.cd-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.cd-tools button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--plum-soft);
  background: var(--white);
  border: 0;
  border-radius: 50%;
}
.cd-tools button svg { width: 16px; height: 16px; }
.cd-digits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.cd-unit { padding: 8px 4px 6px; text-align: center; background: var(--white); border-radius: 12px; }
.cd-num { display: block; font-size: 24px; font-weight: 700; line-height: 1; color: var(--rose-deep); font-variant-numeric: tabular-nums; }
.cd-lbl { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--plum-soft); }
.cd-done { margin: 10px 0 0; font-weight: 700; color: #a2641c; }
.cd-empty { margin: 0; text-align: center; color: var(--plum-soft); }
.cd-new { align-self: center; }
.cd-form { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1.5px dashed var(--rose-soft); }
.cd-form h3 { margin: 0; font-family: var(--font-hand); font-size: 26px; color: var(--plum); }
.field-label { font-weight: 700; font-size: 14px; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-row button {
  width: 42px;
  height: 42px;
  font-size: 21px;
  padding: 0;
  background: var(--blush-2);
  border: 2px solid transparent;
  border-radius: 12px;
}
.emoji-row button[aria-checked='true'] { border-color: var(--rose); background: var(--white); }
.cd-when { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--rose); flex: none; }
.check small { font-weight: 500; color: var(--plum-soft); }

.push-tip-ico { width: 48px; height: 48px; display: grid; place-items: center; font-size: 26px; background: var(--blush); border-radius: 12px; flex: none; }

/* ---------- Fotos bomba ---------- */
.fab-emoji { font-size: 22px; line-height: 1; }
.fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  background: #ff3b5c;
  border: 2px solid var(--white);
  border-radius: 999px;
}
.fab-bomb.has-bomb { background: #ffe7ec; box-shadow: 0 0 0 3px #ff3b5c, var(--shadow-soft); }
.bomb-intro { margin: -6px 0 0; font-size: 14px; color: var(--plum-soft); }
.bomb-h { margin: 6px 0 8px; font-family: var(--font-hand); font-size: 24px; color: var(--plum); }
.bomb-list { display: grid; gap: 8px; }
.bomb-empty { margin: 0; font-size: 14px; color: var(--plum-soft); }
.bomb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--blush-2);
  border-radius: 16px;
}
.bomb-item .bomb-ico { font-size: 28px; flex: none; }
.bomb-item .bomb-info { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.bomb-item .bomb-info b { font-size: 15px; }
.bomb-item .bomb-info small { font-size: 12px; color: var(--plum-soft); }
.bomb-item.received { background: linear-gradient(120deg, #ffe0e8, #fff2f5); box-shadow: inset 0 0 0 2px #ffb3c6; }
.bomb-item .btn { flex: none; }
.bomb-drop { min-height: 130px; }
.bomb-drop img { max-height: 200px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  flex: 1;
  min-height: 40px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--plum);
  background: var(--blush-2);
  border: 2px solid transparent;
  border-radius: 999px;
}
.seg button[aria-checked='true'] { color: var(--rose-deep); background: var(--white); border-color: var(--rose); }
.bomb-send { width: 100%; min-height: 48px; margin-top: 4px; }

.bomb-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: #120a10;
  animation: fade .2s ease both;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.bomb-viewer canvas { max-width: 100vw; max-height: 100dvh; pointer-events: none; }
.bomb-top {
  position: absolute;
  top: calc(12px + var(--safe-t));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bomb-from {
  flex: 1;
  padding: 6px 14px;
  font-weight: 700;
  color: var(--white);
  background: rgba(0, 0, 0, .45);
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bomb-timer { position: relative; width: 44px; height: 44px; flex: none; }
.bomb-timer svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.bomb-timer circle { fill: none; stroke-width: 3.5; }
.bomb-timer .t-bg { stroke: rgba(255, 255, 255, .25); }
.bomb-timer .t-fg { stroke: var(--rose); stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.bomb-timer b { position: absolute; inset: 0; display: grid; place-items: center; color: var(--white); font-size: 15px; }
.bomb-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(24px + var(--safe-b));
  margin: 0;
  padding: 10px 16px;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 26px;
  line-height: 1.2;
  color: var(--white);
  background: rgba(0, 0, 0, .45);
  border-radius: 16px;
  overflow-wrap: anywhere;
}
.bomb-flash {
  margin: 0;
  padding: 10px 14px;
  text-align: center;
  font-weight: 700;
  color: var(--white);
  background: var(--rose-deep);
  border-radius: 14px;
  animation: pop .3s ease both;
}

/* ---------- Guía de instalación ---------- */
.install-icon.big { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow-soft); }
.steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; text-align: left; counter-reset: paso; }
.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.35;
  background: var(--blush-2);
  border-radius: 14px;
  counter-increment: paso;
  position: relative;
}
.steps li::before {
  content: counter(paso);
  position: absolute;
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  background: var(--rose);
  border-radius: 50%;
}
.step-ico {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(91, 58, 79, .12);
}
.step-ico svg { width: 22px; height: 22px; fill: none; stroke: #2f7cf6; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#steps-android .step-ico svg { stroke: #3c4043; }
#steps-android .step-ico svg circle { fill: #3c4043; stroke: none; }
.step-txt { width: auto; padding: 0 8px; font-size: 13px; font-weight: 700; color: #2f7cf6; }
#steps-android .step-txt { color: #1a73e8; }
.inapp-note { margin: 0 0 14px !important; padding: 10px 12px; font-size: 14px !important; font-weight: 500 !important; text-align: left; background: #fff4d6; border-radius: 12px; }
.inapp-note .btn { display: block; margin-top: 8px; }

/* ---------- Menú: cabecera y textos ---------- */
.menu-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 6px 10px; font-family: var(--font-brand); font-size: 19px; color: var(--rose-deep); }
.menu-text { display: grid; line-height: 1.25; }
.menu-text small { font-size: 12px; font-weight: 500; color: var(--plum-soft); }

/* ---------- Estado vacío: botón ---------- */
.empty .btn { margin-top: 14px; }

/* ---------- Consejo de la primera vez ---------- */
.search-results li.muted { cursor: default; color: var(--plum-soft); }
.search-results li.muted:hover { background: none; }

.coach {
  position: fixed;
  z-index: 8;
  left: 16px;
  bottom: calc(24px + var(--safe-b));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  width: min(420px, calc(100vw - 160px));
  padding: 12px 12px 12px 16px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-pop);
  animation: pop .45s cubic-bezier(.2, 1.5, .4, 1) both;
}
.coach p { margin: 0; flex: 1; font-size: 15px; line-height: 1.35; }
.coach b { color: var(--rose-deep); }
.coach-emoji { font-size: 26px; animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { translate: 0 -5px; } }

/* ---------- Foto a pantalla completa ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: calc(60px + var(--safe-t)) 16px calc(70px + var(--safe-b));
  background: rgba(46, 26, 38, .92);
  animation: fade .25s ease both;
  touch-action: pan-y;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100dvh - 150px - var(--safe-t) - var(--safe-b));
  object-fit: contain;
  border: 6px solid var(--white);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  animation: pop .3s ease both;
}
.lb-close { position: absolute; top: calc(14px + var(--safe-t)); right: 16px; width: 48px; height: 48px; }
.lb-close svg { width: 24px; height: 24px; }
.lb-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--rose-deep);
  background: rgba(255, 255, 255, .92);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.lb-nav:hover { background: var(--white); }
.lb-nav svg { width: 26px; height: 26px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(18px + var(--safe-b));
  margin: 0;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 26px;
  color: var(--white);
}

/* ---------- Formulario: cabecera, foto y lugar ---------- */
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drop-text small { display: block; max-width: 260px; font-weight: 500; font-size: 13px; color: var(--plum-soft); }
.drop-change {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--rose-deep);
  background: rgba(255, 255, 255, .92);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(91, 58, 79, .2);
  pointer-events: none;
}
.btn-pick { width: 100%; margin-top: 6px; }
.coords-details { margin-top: 4px; font-size: 13px; color: var(--plum-soft); }
.coords-details summary { cursor: pointer; width: max-content; padding: 2px 0; }
.coords-details .coords { margin-top: 6px; }

/* ---------- Confirmación ---------- */
.confirm {
  width: min(340px, calc(100vw - 32px));
  padding: 22px 20px 18px;
  text-align: center;
  color: var(--plum);
  background: var(--white);
  border: 0;
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
}
.confirm::backdrop { background: rgba(91, 58, 79, .45); }
.confirm[open] { animation: pop .3s cubic-bezier(.2, 1.4, .4, 1) both; }
.confirm-emoji { font-size: 38px; }
.confirm p { margin: 8px 0 18px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.confirm-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- Avisos de "marcar" y "viaje" ---------- */
.pick-banner { flex-wrap: wrap; justify-content: center; white-space: normal; text-align: center; max-width: calc(100vw - 24px); }
.pick-actions { display: flex; gap: 4px; }
.tour-banner {
  position: fixed;
  z-index: 8;
  left: 50%;
  top: calc(80px + var(--safe-t));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 18px;
  font-weight: 700;
  background: var(--white);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  white-space: nowrap;
  animation: pop .3s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Pantalla de entrada ---------- */
.login {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px 16px;
  overflow-y: auto;
  background: radial-gradient(circle at 50% 35%, var(--blush-2), var(--blush) 60%, #ffd6e2);
}
.login-card {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 22px 22px;
  text-align: center;
  background: var(--white);
  border-radius: 28px;
  box-shadow: var(--shadow-pop);
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.login-card .field { text-align: left; }
.login-heart { width: 56px; height: 51px; margin: 0 auto; fill: var(--rose); filter: drop-shadow(0 6px 12px rgba(224, 82, 122, .35)); }
.login-card h1 { margin: 0; font-family: var(--font-brand); font-weight: 400; font-size: 34px; color: var(--rose-deep); }
.login-sub { margin: -8px 0 4px; font-family: var(--font-hand); font-size: 22px; color: var(--plum-soft); }
.pass-row { display: flex; gap: 6px; }
.pass-row input { flex: 1; }
.login-btn { min-height: 50px; font-size: 17px; margin-top: 4px; }
.login-intro { margin: -4px 0 2px; font-size: 15px; line-height: 1.45; color: var(--plum); }

/* ---------- Ventanas pequeñas (invitar, contraseña) ---------- */
.small-dlg { text-align: center; }
.small-dlg form { display: flex; flex-direction: column; gap: 12px; }
.small-dlg .field { text-align: left; }
.dlg-title { margin: 4px 0 8px !important; font-family: var(--font-brand); font-size: 24px !important; font-weight: 400 !important; color: var(--rose-deep); }
.dlg-text { margin: 0 0 14px !important; font-size: 15px !important; font-weight: 500 !important; }
.link-box {
  width: 100%;
  margin-bottom: 14px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--plum);
  background: var(--blush-2);
  border: 2px dashed var(--rose-soft);
  border-radius: 12px;
  text-overflow: ellipsis;
}

/* ---------- Corazones que flotan ---------- */
.hearts { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.float-heart {
  position: absolute;
  width: 22px;
  height: 20px;
  background: var(--heart) center / contain no-repeat;
  animation: float-up var(--dur, 1.6s) ease-out forwards;
  opacity: 0;
}

/* ---------- Aviso ---------- */
.toast {
  position: fixed;
  z-index: 45;
  left: 50%;
  top: calc(80px + var(--safe-t));
  transform: translateX(-50%);
  max-width: calc(100vw - 40px);
  padding: 11px 20px;
  font-weight: 700;
  color: var(--white);
  background: var(--rose-deep);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  animation: pop .3s ease both;
  text-align: center;
}

/* ---------- Mapa: controles ---------- */
.maplibregl-ctrl-attrib { font-family: system-ui, sans-serif; }
.maplibregl-ctrl-group { border: 0 !important; border-radius: 14px !important; overflow: hidden; box-shadow: var(--shadow-soft) !important; }
.maplibregl-ctrl-top-right { top: var(--safe-t); }

/* ---------- Animaciones ---------- */
@keyframes pop {
  from { opacity: 0; scale: .6; }
  to { opacity: 1; scale: 1; }
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(.96); }
  45% { transform: scale(1.1); }
}
@keyframes pin-beat {
  0%, 100% { scale: 1.18; }
  20% { scale: 1.28; }
  40% { scale: 1.16; }
  60% { scale: 1.24; }
}
@keyframes polaroid-in {
  0% { opacity: 0; transform: rotate(-9deg) translateY(-30px) scale(.8); }
  100% { opacity: 1; transform: rotate(-1.2deg); }
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(0, 0) scale(.4) rotate(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), -180px) scale(var(--s, 1)) rotate(var(--r, 0)); }
}

/* ---------- Móvil: la polaroid sale desde abajo ---------- */
@media (max-width: 640px) {
  .brand h1 { font-size: 20px; padding: 3px 16px 8px; }
  .card {
    top: auto;
    left: 14px;
    right: 14px;
    bottom: calc(14px + var(--safe-b));
    width: auto;
    max-height: 64dvh;
    transform: rotate(-.6deg);
    transform-origin: 50% 100%;
  }
  .card-photo img { max-height: 32dvh; }
  .card.enter { animation-name: sheet-in; }
  body.card-open .fab-bar { display: none; }
  .menu { right: 16px; left: 16px; bottom: calc(100px + var(--safe-b)); min-width: 0; max-height: calc(100dvh - 120px - var(--safe-b) - var(--safe-t)); }
  @keyframes sheet-in {
    from { opacity: 0; transform: translateY(50px) rotate(3deg) scale(.92); }
    to { opacity: 1; transform: rotate(-.6deg); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
