/* turisteo: cuarto oscuro cálido, tipografía de época y una sola polaroid como gesto memorable. */

@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #1a1612;
  --surface: #231e19;
  --raised: #2d2620;
  --raised-2: #372f28;
  --line: rgba(237, 229, 216, 0.09);
  --line-2: rgba(237, 229, 216, 0.16);
  --text: #f2eadf;
  --muted: #a89a88;
  --faint: #74685a;
  --paper: #e9e0d1;
  --paper-ink: #2a221b;
  --amber: #f0a048;
  --amber-ink: #24170a;
  --ok: #67b8a0;
  --danger: #e5603f;
  --c-museum: #7fa6d9;
  --c-sight: #f0a048;
  --c-park: #67b8a0;
  --c-food: #e07a8b;
  --c-night: #a98bdb;
  --c-shop: #d8c25e;
  --c-neutral: #a89a88;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --top: 56px;
  --tabs: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--ui);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* grano de película, muy sutil */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .88 0 0 0 .7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: 0.35; cursor: default; }
input, textarea { font: inherit; color: var(--text); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.ic { flex: none; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
code { font-size: 0.9em; background: var(--raised); padding: 1px 5px; border-radius: 4px; }

/* ---------- barra superior y pestañas ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  height: calc(var(--top) + var(--safe-t));
  padding: var(--safe-t) 12px 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--paper); display: flex; }
.top-trip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 14px;
  max-width: 45vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.top-set { position: relative; margin-left: auto; }
.top-trip + .top-set { margin-left: 0; }
.no-profile .top { display: none; }
.sync-dot { position: absolute; top: 8px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 2px var(--bg); }
.sync-dot.st-ok { background: var(--ok); }
.sync-dot.st-busy { background: var(--amber); }
.sync-dot.st-err, .sync-dot.st-auth { background: var(--danger); }
.sync-dot.st-off { display: none; }

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(var(--tabs) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs a { display: grid; place-items: center; align-content: center; gap: 3px; color: var(--faint); font-size: 11px; letter-spacing: 0.01em; }
.tabs a.on { color: var(--text); }
.tabs a.on .ic { color: var(--amber); }
.no-tabs .tabs { display: none; }

.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.icon-btn:active { background: var(--raised); }

/* ---------- contenedor de vista ---------- */

.view { padding: 20px 16px calc(var(--tabs) + var(--safe-b) + 96px); max-width: 640px; margin: 0 auto; }
.no-tabs .view { padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--faint); font-size: 13px; margin-top: 8px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.hint.warn { color: var(--amber); }
.amber { color: var(--amber); }
.pad { padding: 12px 4px; }

.block { margin-top: 32px; }
.block h2 { font: 600 19px/1.25 var(--display); margin-bottom: 12px; }

/* ---------- cabecera del día ---------- */

.dayhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dayhead h1, .triphead h1 { font: 600 28px/1.1 var(--display); letter-spacing: -0.01em; }
.d-sub { color: var(--muted); margin-top: 6px; font-size: 15px; }
.d-note { color: var(--muted); font-size: 14px; margin-top: 16px; padding-left: 12px; border-left: 2px solid var(--line-2); }
.d-stats { color: var(--faint); font-size: 13px; margin-top: 20px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.d-stats.late { color: var(--amber); }
.daynav { display: flex; justify-content: space-between; margin: -8px -8px 8px; }
.daynav span { display: flex; }

.wx { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--surface); color: var(--muted); flex: none; }
.wx-t { font: 600 17px/1 var(--display); color: var(--text); }
.wx-t small { font: 400 13px var(--ui); color: var(--muted); }
.wx-p { font-size: 12px; color: var(--c-museum); }

/* ---------- la polaroid ---------- */

.hero { margin-top: 24px; }
.polaroid {
  margin: 0 auto;
  width: min(100%, 340px);
  background: var(--paper);
  padding: 12px 12px 0;
  border-radius: 2px;
  transform: rotate(-1.4deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(255, 255, 255, 0.3) inset;
}
.pol-photo {
  position: relative;
  aspect-ratio: 1 / 0.64;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(255, 196, 120, 0.55), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--tint) 85%, #fff 0%), color-mix(in srgb, var(--tint) 45%, #1a1612));
}
.pol-photo::after {
  /* viñeta y grano de copia */
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 100% at 50% 40%, transparent 55%, rgba(26, 16, 8, 0.45));
  mix-blend-mode: multiply;
}
.pol-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) contrast(1.02) sepia(0.12); }
.pol-photo .ic { filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25)); }
.pol-photo.cover-sch { background: var(--surface); color: var(--muted); }
.pol-photo.cover-sch .schematic { position: absolute; inset: 0; width: 100%; height: 100%; }
.pol-tag {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(26, 22, 18, 0.72);
  color: var(--paper);
  font-size: 13px;
  backdrop-filter: blur(6px);
}
.pol-time {
  position: absolute;
  left: 14px;
  bottom: 10px;
  z-index: 1;
  font: 600 30px/1 var(--display);
  color: #fffaf2;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
.polaroid figcaption { padding: 14px 4px 18px; color: var(--paper-ink); display: grid; gap: 4px; }
.pol-name { font: 600 23px/1.15 var(--display); text-align: left; color: var(--paper-ink); }
.pol-sub { font-size: 14px; color: rgba(42, 34, 27, 0.68); }
.hero-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }

/* ---------- botones y chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--raised);
  color: var(--text);
  font-weight: 500;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--amber); color: var(--amber-ink); border-color: transparent; font-weight: 600; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; margin-top: 20px; }
.link { color: var(--amber); font-size: 14px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.row-btns.col { flex-direction: column; align-items: stretch; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip.on { background: var(--paper); color: var(--paper-ink); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.day-actions { display: flex; gap: 8px; overflow-x: auto; margin: 28px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
.day-actions::-webkit-scrollbar { display: none; }

.seg { display: flex; background: var(--surface); border-radius: 10px; padding: 3px; border: 1px solid var(--line); }
.seg button { flex: 1; min-height: 38px; border-radius: 8px; color: var(--muted); font-size: 14px; padding: 0 8px; }
.seg button.on { background: var(--raised-2); color: var(--text); }
.seg.small button { min-height: 34px; font-size: 13px; }
.seg.col3 { flex-wrap: wrap; }

.fab {
  position: fixed;
  right: max(16px, calc(50vw - 304px));
  bottom: calc(var(--tabs) + var(--safe-b) + 16px);
  z-index: 30;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--amber-ink);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
.fab:active { transform: scale(0.96); }

/* ---------- avisos ---------- */

.banner { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 12px 12px 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.banner p { flex: 1; font-size: 14px; color: var(--text); }
.banner .ic { color: var(--amber); }
.banner.rain .ic { color: var(--c-museum); }
.banner.inbox { border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--danger); margin-top: 4px; }
.flag.soft { color: var(--amber); }

/* ---------- línea del día ---------- */

.tl { list-style: none; margin: 8px 0 0; padding: 0; }
.row { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.leg {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 0 4px 66px;
  color: var(--faint);
  font-size: 13px;
  position: relative;
}
.leg::before { content: ''; position: absolute; left: 75px; top: 0; bottom: 0; border-left: 2px dotted var(--line-2); }
.leg .ic:first-child { position: relative; z-index: 1; background: var(--bg); padding: 2px 0; margin-left: 2px; }
.leg-note { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.leg-go { margin-left: auto; opacity: 0.6; }
.row:first-child .leg::before { top: 50%; }
.row-main { display: grid; grid-template-columns: 52px 28px 1fr auto auto auto; align-items: center; gap: 0 6px; min-height: 64px; }
.r-time { display: grid; text-align: right; padding-right: 4px; }
.t1 { font: 600 17px/1.1 var(--display); }
.t2 { font-size: 12px; color: var(--faint); }
.r-rail { position: relative; height: 100%; display: grid; place-items: center; }
.r-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--cat) 22%, var(--bg));
  color: var(--cat);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cat) 45%, transparent);
}
.r-body { text-align: left; padding: 10px 4px; min-width: 0; display: grid; gap: 2px; }
.r-name { font-weight: 600; font-size: 16px; line-height: 1.25; }
.r-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 8px; }
.unverified { color: var(--faint); font-style: italic; }
.r-photo { width: 38px; height: 38px; object-fit: cover; border: 3px solid var(--paper); border-bottom-width: 7px; transform: rotate(3deg); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); }
.r-check {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: transparent;
  border: 2px solid var(--line-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.r-check:active { transform: scale(0.94); }
.grip { width: 24px; height: 44px; display: grid; place-items: center; color: var(--faint); touch-action: none; cursor: grab; opacity: 0.7; }
.row.st-done .r-check, .mrow.st-done .r-check { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.row.st-done .r-name { color: var(--muted); }
.row.st-done .r-dot { background: var(--surface); color: var(--faint); box-shadow: none; }
.row.st-done .t1 { color: var(--faint); }
.row.is-now .r-dot { background: var(--cat); color: var(--bg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cat) 25%, transparent); }
.row.is-now .r-name { color: var(--text); }
.row.home .row-main { grid-template-columns: 52px 28px 1fr; min-height: 56px; }
.row.home a.r-body { color: inherit; text-decoration: none; }
.row.home .r-name { color: var(--muted); }
.row.home .r-dot { background: var(--bg); color: var(--muted); box-shadow: 0 0 0 1px var(--line-2); }
.row.home .t1 { color: var(--muted); }
.drop-end { min-height: 12px; list-style: none; }
.empty-day { list-style: none; display: grid; justify-items: start; gap: 12px; padding: 24px 0 8px 66px; color: var(--muted); }

.skipped { margin-top: 16px; color: var(--faint); font-size: 14px; }
.skipped summary { cursor: pointer; padding: 8px 0; }
.skipped ul { list-style: none; padding: 0; margin: 0; }
.skipped li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); }

/* ---------- viaje completo ---------- */

.triphead .d-stats { margin-top: 10px; }
.tdays { display: grid; gap: 14px; margin-top: 16px; }
.tday { background: var(--surface); border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.tday.is-today { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.tday.is-closed .tday-head { opacity: 0.7; }
.tday.ideas { background: transparent; border-style: dashed; }
.tday-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 10px 14px; color: var(--muted); }
.tday-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--text); font: 600 14px var(--display); flex: none; }
.tday.is-today .tday-n { background: var(--amber); color: var(--amber-ink); }
.tday-txt { display: grid; min-width: 0; flex: 1; }
.tday-date { font-size: 13px; color: var(--faint); }
.tday-title { font: 600 17px/1.25 var(--display); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tday-count { font-size: 13px; color: var(--faint); }
.tday-late { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--amber) 8%, transparent); color: var(--amber); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.tday-late span { flex: 1; color: var(--muted); }
.tday-late strong { font-weight: 600; }
.mini { list-style: none; margin: 0; padding: 0 6px 8px; min-height: 20px; }
.mrow { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 2px 0 8px; border-top: 1px solid var(--line); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; background: inherit; }
.m-time { font: 600 14px var(--display); width: 44px; color: var(--muted); flex: none; }
.m-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cat); flex: none; }
.m-dot.hollow { background: transparent; box-shadow: inset 0 0 0 2px var(--cat); }
.m-name { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.m-flag { color: var(--danger); }
.m-cat { font-size: 12px; color: var(--faint); }
.mrow.st-done .m-name { color: var(--faint); }
.r-check.sm { width: 30px; height: 30px; }
.mini .drop-end { color: var(--faint); font-size: 13px; padding: 10px 8px; min-height: 8px; text-align: center; }
.mini .drop-end:empty { padding: 4px; }
ul.plain, ul.tips { list-style: none; margin: 0; padding: 0; }
ul.plain li { display: flex; align-items: center; border-top: 1px solid var(--line); }
ul.plain li > a, .link-row { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 50px; color: var(--text); text-align: left; }
ul.plain small, .link-row small { margin-left: auto; color: var(--faint); padding-left: 8px; }
ul.tips li { padding: 10px 0 10px 18px; position: relative; color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); }
ul.tips li::before { content: ''; position: absolute; left: 2px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
ol.mini .mrow:first-child { border-top: 0; }

/* ---------- arrastrar ---------- */

.dnd-ghost {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  background: var(--raised-2);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  transform: rotate(-1.5deg) scale(1.02);
  opacity: 0.96;
  list-style: none;
}
.dnd-ghost .leg { display: none; }
.dnd-src { display: none; }
.dnd-ph { list-style: none; border: 2px dashed color-mix(in srgb, var(--amber) 60%, transparent); border-radius: 12px; margin: 4px 0; background: color-mix(in srgb, var(--amber) 6%, transparent); }
.dnd-on, .dnd-on * { cursor: grabbing !important; }
.dnd-on .leg { opacity: 0.25; }
.dz-hot { box-shadow: 0 0 0 1px color-mix(in srgb, var(--amber) 35%, transparent); }

/* ---------- tus viajes ---------- */

.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
.tcard { display: grid; gap: 4px; text-align: left; }
.tcard-pol { display: block; aspect-ratio: 1 / 0.9; background: var(--paper); padding: 7px 7px 26px; border-radius: 2px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4); transform: rotate(-1.2deg); position: relative; }
.tcard:nth-child(even) .tcard-pol { transform: rotate(1.4deg); }
.tcard-pol img, .tcard-pol svg { width: 100%; height: 100%; object-fit: cover; background: var(--surface); display: block; }
.tcard.is-active .tcard-pol { outline: 2px solid var(--amber); outline-offset: 4px; }
.tcard-title { font: 600 17px var(--display); margin-top: 10px; }
.tcard-dates { font-size: 13px; color: var(--faint); }
.schematic { display: block; }
.sch-grid path { stroke: rgba(233, 224, 209, 0.05); stroke-width: 1; }

/* ---------- cartera ---------- */

.hotel-card { margin-top: 20px; padding: 18px; border-radius: 14px; background: var(--paper); color: var(--paper-ink); display: grid; gap: 4px; transform: rotate(-0.6deg); }
.hc-k { font-size: 13px; color: rgba(42, 34, 27, 0.6); }
.hc-name { font: 600 21px/1.2 var(--display); }
.hc-addr { font-size: 15px; }
.hc-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hc-actions .btn { background: rgba(42, 34, 27, 0.08); color: var(--paper-ink); border-color: rgba(42, 34, 27, 0.12); }
.wallet { list-style: none; margin: 24px 0 0; padding: 0; }
.wrow { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.w-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; color: var(--muted); flex: none; }
.wrow.st-pending .w-ic { color: var(--amber); }
.w-body { flex: 1; display: grid; gap: 3px; min-width: 0; }
.w-title { font-weight: 600; text-align: left; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.results li > button.on { color: var(--amber); }
.w-meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.w-details { font-size: 13px; color: var(--faint); }
.w-code { justify-self: start; display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; padding: 4px 10px; border-radius: 6px; background: var(--raised); font: 600 15px var(--display); letter-spacing: 0.04em; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.tag.muted { background: var(--raised); color: var(--muted); }

/* ---------- ajustes y formularios ---------- */

.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.field input, textarea, .time-in {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 16px;
}
textarea { resize: vertical; min-height: 64px; }
.time-in { width: auto; min-width: 130px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.version { color: var(--faint); font-size: 12px; margin-top: 40px; text-align: center; }

/* ---------- primera vez ---------- */

.onb { min-height: 70dvh; display: grid; align-content: center; justify-items: center; text-align: center; gap: 20px; padding-top: 24px; }
.onb-brand { color: var(--paper); display: grid; justify-items: center; gap: 12px; }
.onb-brand p { color: var(--muted); }
.onb h2 { font: 600 22px var(--display); margin-top: 24px; }
.onb-pols { display: flex; gap: 22px; }
.mini-pol { background: var(--paper); padding: 8px 8px 0; width: 130px; transform: rotate(var(--r)); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45); border-radius: 2px; }
.mp-photo { display: grid; place-items: center; aspect-ratio: 1; background: linear-gradient(160deg, #f0a048, #7a4a2a); color: #fff8ee; font: 600 52px var(--display); }
.mini-pol:nth-child(2) .mp-photo { background: linear-gradient(160deg, #7fa6d9, #2f3f5c); }
.mp-name { display: block; padding: 10px 0 14px; color: var(--paper-ink); font: 600 18px var(--display); }

/* ---------- hojas ---------- */

.sheet-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.sheet-root.open { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: rgba(10, 8, 6, 0.55); animation: fade 0.18s ease-out; }
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--line-2);
  padding: 0 18px calc(24px + var(--safe-b));
  max-width: 640px;
  margin: 0 auto;
  animation: up 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes up { from { transform: translateY(24px); opacity: 0.6; } }
@keyframes fade { from { opacity: 0; } }
.sh-bar { display: grid; place-items: center; padding: 8px 0 2px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.grabber { width: 36px; height: 4px; border-radius: 4px; background: var(--line-2); }
.sh-head { display: flex; align-items: center; gap: 10px; min-height: 48px; position: sticky; top: 14px; background: var(--surface); z-index: 2; }
.sh-head h2 { font: 600 20px var(--display); flex: 1; display: flex; }
.sh-head .icon-btn { margin-right: -8px; }
.sh-body { display: grid; gap: 10px; padding-top: 4px; }
.sh-title { font: 600 26px/1.15 var(--display); }
.sh-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; font: 400 14px var(--ui); color: var(--cat); }
.sh-addr, .sh-when, .sh-hours { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 14px; text-align: left; }
.sh-addr .ic, .sh-when .ic, .sh-hours .ic { margin-top: 2px; color: var(--faint); }
.sh-text { font-size: 15px; color: var(--text); }
.sh-text.tip { color: var(--muted); padding-left: 12px; border-left: 2px solid var(--amber); }
.sh-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 4px; }
.act { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px; background: var(--raised); font-size: 12px; color: var(--muted); }
.act .ic { color: var(--text); }
.act.on .ic { color: var(--ok); }
.sh-sec { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sh-sec.col { flex-direction: column; align-items: stretch; }
.sh-k { font-size: 13px; color: var(--faint); margin-top: 6px; }
.stepper { display: flex; align-items: center; gap: 6px; background: var(--raised); border-radius: 999px; padding: 3px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.stepper span { min-width: 64px; text-align: center; font: 600 16px var(--display); }
.stars { display: flex; gap: 2px; }
.stars button { color: var(--faint); padding: 4px; }
.stars button.on { color: var(--amber); }
.stars button.on .ic { fill: var(--amber); }
.other-note { font-size: 14px; color: var(--muted); }
.sh-photo { width: 120px; height: 120px; object-fit: cover; border: 6px solid var(--paper); border-bottom-width: 20px; transform: rotate(-2deg); }
.search { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 48px; border-radius: 12px; background: var(--raised); color: var(--faint); }
.search input { flex: 1; border: 0; background: transparent; outline: 0; min-height: 46px; font-size: 16px; }
.results { list-style: none; margin: 0; padding: 0; }
.results li { border-top: 1px solid var(--line); display: flex; align-items: center; }
.results li > button, .results li > a { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 54px; text-align: left; }
.res-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--cat, var(--muted)) 20%, var(--surface)); color: var(--cat, var(--muted)); flex: none; font: 600 14px var(--display); }
.res-txt { display: grid; min-width: 0; }
.res-txt small { color: var(--faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; }
.pick button { width: 100%; display: grid; grid-template-columns: 76px 1fr auto; gap: 8px; align-items: center; min-height: 50px; padding: 0 14px; border-radius: 12px; background: var(--raised); text-align: left; }
.pick button.on { outline: 2px solid var(--amber); }
.pick small { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decide { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.decide li { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.dc-name { font-weight: 600; display: block; }
.decide small { color: var(--faint); }
.trim-end { margin: 16px 0; font-size: 14px; color: var(--muted); }
.trim-end.late { color: var(--amber); }
.summary { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
.summary li { display: flex; gap: 8px; align-items: flex-start; }
.summary .ic { color: var(--amber); margin-top: 1px; }
.errs { color: var(--danger); font-size: 13px; padding-left: 18px; margin: 0; }
.steps { color: var(--muted); font-size: 14px; padding-left: 20px; margin: 0; display: grid; gap: 6px; }
.recap-frame { display: grid; place-items: center; min-height: 200px; background: var(--bg); border-radius: 12px; padding: 12px; }
.recap-canvas { width: min(100%, 300px); height: auto; border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.addr-full { position: absolute; inset: 0; background: var(--paper); color: var(--paper-ink); display: grid; align-content: center; gap: 18px; padding: 32px; text-align: left; }
.af-k { font-size: 18px; color: rgba(42, 34, 27, 0.6); }
.af-name { font: 600 40px/1.1 var(--display); }
.af-addr { font-size: 30px; line-height: 1.25; }
.af-hint { font-size: 14px; color: rgba(42, 34, 27, 0.5); margin-top: 24px; }

/* ---------- mapa ---------- */

.v-mapa { padding: 0; max-width: none; }
.mapwrap { position: fixed; top: calc(var(--top) + var(--safe-t)); bottom: calc(var(--tabs) + var(--safe-b)); left: 0; right: 0; }
.map { position: absolute; inset: 0; background: #15120f; }
/* Teselas claras de OpenStreetMap invertidas a un oscuro cálido */
.map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.82) contrast(0.92) saturate(0.35) sepia(0.4); }
.map.offline { display: grid; place-items: center; padding: 60px 12px 140px; }
.map.offline .schematic { width: 100%; height: 100%; }
.map-off { position: absolute; top: 64px; left: 0; right: 0; text-align: center; color: var(--faint); font-size: 13px; }
.map-chips { position: absolute; z-index: 500; top: 10px; left: 0; right: 0; display: flex; gap: 6px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
.map-chips::-webkit-scrollbar { display: none; }
.map-chips .chip { background: rgba(35, 30, 25, 0.92); backdrop-filter: blur(8px); }
.map-chips .chip.on { background: var(--paper); }
.map-locate { position: absolute; z-index: 500; right: 12px; bottom: 132px; background: rgba(35, 30, 25, 0.92); color: var(--text); width: 46px; height: 46px; }
.map-card { position: absolute; z-index: 500; left: 12px; right: 12px; bottom: 12px; padding: 14px; border-radius: 16px; background: rgba(35, 30, 25, 0.96); border: 1px solid var(--line-2); backdrop-filter: blur(10px); max-width: 560px; margin: 0 auto; }
.map-card .row-btns { margin-top: 12px; }
.mc-row { display: flex; align-items: center; gap: 12px; }
.mc-row > div { flex: 1; display: grid; min-width: 0; }
.mc-row b { font: 600 18px/1.2 var(--display); }
.mc-row small, .mc-hint { color: var(--muted); font-size: 13px; }
.mc-hint { margin-top: 4px; }
.mc-sum { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 14px; color: var(--muted); }
.mc-sum b { color: var(--text); font: 600 16px var(--display); }
.mc-sum .link { margin-left: auto; }
.mc-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--cat) 22%, var(--surface)); color: var(--cat); flex: none; }
.tpin-wrap { background: none; border: 0; }
.tpin {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 2.5px solid var(--pin);
  color: var(--pin);
  font: 700 12px var(--ui);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.tpin.is-done { background: var(--pin); color: var(--bg); }
.tpin.is-current { background: var(--pin); color: var(--bg); box-shadow: 0 0 0 6px color-mix(in srgb, var(--pin) 30%, transparent), 0 4px 12px rgba(0, 0, 0, 0.5); }
.tpin.idea { background: rgba(26, 22, 18, 0.7); border-width: 2px; opacity: 0.85; }
.tpin.base { border-radius: 7px; background: var(--paper); border-color: var(--paper); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #fffaf2; border: 4px solid var(--c-museum); box-shadow: 0 0 0 6px rgba(127, 166, 217, 0.25); }
.leaflet-container { font-family: var(--ui); background: #15120f; }
.leaflet-control-attribution { background: rgba(26, 22, 18, 0.7) !important; color: var(--faint) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted) !important; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  z-index: 150;
  left: 16px;
  right: 16px;
  margin: 0 auto;
  width: fit-content;
  bottom: calc(var(--tabs) + var(--safe-b) + 84px);
  transform: translateY(20px);
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--paper-ink);
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast .link { color: #9a4f0b; font-weight: 600; white-space: nowrap; }
.sheet-open .toast { top: calc(var(--safe-t) + 12px); bottom: auto; transform: translateY(-20px); }
.sheet-open .toast.show { transform: none; }

@media (min-width: 720px) {
  .view { padding-top: 32px; }
  .dayhead h1, .triphead h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
