/* The profile (public/profile.js): the next trip, the map of the cities visited, the badges, and the saved trips. */
.profile { padding-bottom: 2rem; }
.pf-part { margin: 0 var(--gutter) 1.5rem; }
.pf-part > h2, .pf-fold > summary span { font-stretch: 80%; font-weight: 800; font-size: 1.125rem; letter-spacing: -0.005em; color: var(--ink); }
.pf-part > h2 { margin-bottom: 0.625rem; }
.pf-empty { padding: 1rem; background: var(--surface); border: 1px dashed var(--control-border); border-radius: 14px; font-size: 0.9375rem; color: var(--ink-2); }
.pf-empty:empty { display: none; }

/* A city's badge: a line drawing on white, or painted on its sky with an accent ring. */
.pf-badge { flex: none; display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--control-border); color: var(--ink); }
.pf-badge svg { width: 66%; height: 66%; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
/* Painted, a badge has a deeper sky at its top and its colours made stronger, so a visited city stands out of the grid. */
.pf-badge.is-painted { background: linear-gradient(180deg, color-mix(in oklab, var(--sky, var(--tint)) 55%, #3f9ad6) 0%, var(--sky, var(--tint)) 80%); border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent), 0 4px 9px -4px rgb(34 48 60 / 0.4); }
.pf-badge.is-painted svg { stroke-width: 1.4; filter: saturate(1.9); }
.pf-badge.is-large { width: 3.5rem; height: 3.5rem; }

/* Next trip: where from and to, when, the flights, the reference. */
.pf-next { display: grid; gap: 0.75rem; }
.pf-trip { padding: 0.875rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow); }
.pf-trip-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "badge way soon" "badge when when"; align-items: center; gap: 0.25rem 0.75rem; }
.pf-trip-head > .pf-badge { grid-area: badge; }
.pf-trip-names { display: contents; }
.pf-way { grid-area: way; }
.pf-when { grid-area: when; align-self: start; }
.pf-soon { grid-area: soon; }
.pf-way { display: flex; flex-wrap: wrap; align-items: center; gap: 0.125rem 0.4375rem; font-stretch: 76%; font-weight: 800; font-size: 1.375rem; line-height: 1.1; }
.pf-way span { overflow-wrap: anywhere; }
.pf-arrow { flex: none; width: 1.125rem; height: 0.75rem; background: var(--accent); clip-path: polygon(0 40%, 62% 40%, 62% 0, 100% 50%, 62% 100%, 62% 60%, 0 60%); }
.pf-when { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
/* The trips booked, as a stack: the one on top whole, the edges of up to two more under it, a pager below. */
.pf-stack { gap: 0.875rem; }
.pf-stage { position: relative; touch-action: pan-y; }
.pf-stage:has(.pf-under) { padding-bottom: 0.5rem; }
.pf-stage:has(.pf-under.is-2) { padding-bottom: 1rem; }
.pf-under { position: absolute; left: calc(var(--depth) * 0.625rem); right: calc(var(--depth) * 0.625rem); bottom: 0; height: 3rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow); opacity: calc(1 - var(--depth) * 0.22); }
.pf-under.is-2 ~ .pf-under.is-1 { bottom: 0.5rem; }
.pf-trip.is-top { position: relative; animation: pf-turn 260ms var(--ease-out) both; }
.pf-trip[data-from="left"] { --from: -1.5rem; }
@keyframes pf-turn { from { opacity: 0; translate: var(--from, 1.5rem) 0; } }
@media (prefers-reduced-motion: reduce) { .pf-trip.is-top { animation: none; } }
.pf-nav { margin-top: 0.125rem; }
/* The dates: two leaves of one size with the nights between them, the stay's whole width. */
.pf-dates.stay { max-width: none; margin-top: 0.875rem; padding-top: 0.75rem; border-top: 1px solid var(--rule); gap: 0.75rem; }
.pf-dates .leaf { width: 3.5rem; border-radius: 9px; animation: none; }
.pf-dates .leaf-day { font-size: 0.6875rem; padding: 0.1875rem 0; }
.pf-dates .leaf b { font-size: 1.5rem; }
.pf-dates .leaf-month { font-size: 0.75rem; }
.pf-dates .stay-count { font-size: 0.8125rem; }
.pf-soon { padding: 0.25rem 0.5625rem; background: var(--tint); border-radius: 999px; font-size: 0.8125rem; font-weight: 750; color: var(--accent); white-space: nowrap; }
.pf-soon.is-now { background: var(--accent); color: var(--on-accent); }
.pf-legs.detail { display: grid; gap: 0.5rem; margin: 0.875rem 0 0; padding: 0.75rem 0 0; border-top: 1px solid var(--rule); background: none; }
.pf-ref { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; margin-top: 0.75rem; padding-top: 0.625rem; border-top: 1px solid var(--rule); font-size: 0.875rem; color: var(--ink-2); }
.pf-ref b { font-weight: 800; color: var(--ink); letter-spacing: 0.02em; }
.pf-paid { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* The map: every city a dot, a booked one a dashed ring, a visited one its painted badge. */
.pf-map {
  aspect-ratio: 472.6 / 440;
  background: linear-gradient(165deg, #c4e0e6 0%, #d7ebee 45%, #e6f2f0 100%);
  border: 1px solid #c3d6d6;
  border-radius: 14px;
  box-shadow: inset 0 0 0 3px rgb(255 255 255 / 0.55), 0 6px 18px -12px rgb(34 48 60 / 0.45);
  overflow: clip;
}
.pf-map svg { display: block; width: 100%; height: 100%; }
.pf-map .land { fill: #fdfcf8; stroke: #9dbcbc; stroke-width: 0.75; vector-effect: non-scaling-stroke; filter: drop-shadow(0 1px 1.5px rgb(60 110 120 / 0.28)); }
/* The sea's lines, every ten degrees; the trips, as lines from home. */
.pf-grid { fill: none; stroke: #fff; stroke-opacity: 0.55; stroke-width: 0.75; vector-effect: non-scaling-stroke; }
.pf-arc { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pf-arc.is-booked { stroke-dasharray: 4 4; opacity: 0.75; }
.pf-home { fill: var(--ink); stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.pf-pin .pf-art { filter: saturate(1.9); }
.pf-dot { fill: #fff; stroke: var(--ink-2); stroke-width: 1; opacity: 0.7; vector-effect: non-scaling-stroke; }
.pf-ring { fill: var(--surface); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 2.5; vector-effect: non-scaling-stroke; }
.pf-plate { fill: var(--sky); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0.5px 0.8px rgb(34 48 60 / 0.3)); }
.pf-art { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pf-name { fill: var(--ink); stroke: #fdfcf8; stroke-width: 3; stroke-linejoin: round; paint-order: stroke; font-stretch: 85%; font-weight: 750; }
.pf-keys { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.pf-key { display: inline-flex; align-items: center; gap: 0.375rem; }
.pf-key i { width: 0.6875rem; height: 0.6875rem; border-radius: 50%; background: #fff; border: 1px solid var(--ink-2); }
.pf-key i.is-visited { background: var(--sky, #d3e9f6); border: 2px solid var(--accent); }
.pf-key i.is-booked { background: var(--surface); border: 2px dashed var(--accent); }
.pf-key i.is-home { background: var(--ink); border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--ink-2); }

/* A picture to share: under the map, and under the badges. */
.pf-share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.pf-fold .pf-share { margin: 0; padding: 0 0.75rem 0.875rem; }
.pf-share-button { display: inline-flex; align-items: center; gap: 0.4375rem; min-height: 2.75rem; padding: 0 1rem; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 0.9375rem; font-weight: 700; cursor: pointer; transition: transform 140ms var(--ease-out), background 140ms var(--ease-out); }
.pf-share-button svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pf-share-button.is-instagram { border-color: transparent; background: linear-gradient(45deg, #f09433, #dc2743 55%, #bc1888); color: #fff; }
.pf-share-button:active { transform: scale(0.97); }
@media (hover: hover) { .pf-share-button:not(.is-instagram):hover { background: var(--tint); } .pf-share-button.is-instagram:hover { filter: brightness(1.06); } }
.pf-share-note { flex: 1 1 100%; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.pf-share-note:empty { display: none; }

/* The parts that open: the badges and the saved trips. */
.pf-fold { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
.pf-fold > summary { display: flex; align-items: center; gap: 0.5rem; min-height: 3.25rem; padding: 0 0.875rem; cursor: pointer; list-style: none; border-radius: 14px; }
.pf-fold > summary::-webkit-details-marker { display: none; }
.pf-fold > summary b { padding: 0.125rem 0.5rem; background: var(--tint); border-radius: 999px; font-size: 0.8125rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.pf-fold > summary::after { content: ""; margin-left: auto; width: 0.5625rem; height: 0.5625rem; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); rotate: 45deg; translate: 0 -2px; transition: rotate 200ms var(--ease-out), translate 200ms var(--ease-out); }
.pf-fold[open] > summary::after { rotate: 225deg; translate: 0 2px; }
.pf-fold > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pf-cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr)); gap: 0.875rem 0.375rem; margin: 0; padding: 0.25rem 0.75rem 1rem; list-style: none; }
.pf-city { display: grid; justify-items: center; align-content: start; gap: 0.3125rem; }
.pf-city-name { font-size: 0.75rem; font-weight: 600; line-height: 1.2; color: var(--ink-2); text-align: center; overflow-wrap: anywhere; }
.pf-city:not(.is-visited) .pf-badge { opacity: 0.55; }
.pf-city.is-visited .pf-city-name { font-weight: 750; color: var(--ink); }
.pf-city.is-booked .pf-badge { opacity: 1; border: 2px dashed var(--accent); }
.pf-saved-sub { padding: 0 0.875rem 0.75rem; font-size: 0.875rem; color: var(--ink-2); }
.pf-fold .trips { padding-bottom: 0.25rem; }

/* The profile opens on its three parts at once: the next Escapadas small, the map, the badges. */
.pf-headline { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.625rem; min-height: 2.5rem; }
.pf-headline > h2 { margin: 0; flex: 1; }
.pf-headline .pf-nav { margin: 0; gap: 0.5rem; }
.pf-headline .pf-nav .deck-step { width: 2.25rem; height: 2.25rem; }
.pf-headline .pf-nav .deck-count { font-size: 0.9375rem; font-weight: 600; color: var(--ink-2); }
.pf-share.is-small { margin: 0; flex-wrap: nowrap; gap: 0.5rem; }
.pf-share.is-small .pf-share-button { width: 2.375rem; min-height: 2.375rem; padding: 0; justify-content: center; border-radius: 50%; }
.pf-share.is-small .pf-share-button span { display: none; }
.pf-share.is-small .pf-share-note { position: absolute; left: var(--gutter); right: var(--gutter); margin-top: 3.25rem; }
.pf-part { position: relative; margin-bottom: 1.125rem; }
/* A booked trip closed: its badge, from and to, how far off, and its two dates small. */
.pf-trip { padding: 0.75rem; cursor: pointer; }
.pf-trip-head { grid-template-areas: "badge way soon" "badge dates more"; }
.pf-trip-head > .pf-dates.stay { grid-area: dates; margin: 0; padding: 0; border: 0; max-width: 12rem; gap: 0.5rem; }
.pf-trip-head > .pf-dates .leaf { width: 2.125rem; border-radius: 7px; }
.pf-trip-head > .pf-dates .leaf-day { font-size: 0.5625rem; padding: 0.0625rem 0; }
.pf-trip-head > .pf-dates .leaf b { font-size: 0.9375rem; }
.pf-trip-head > .pf-dates .leaf-month { font-size: 0.625rem; }
.pf-trip-head > .pf-dates .stay-count { display: none; }
.pf-more { grid-area: more; justify-self: end; width: 2rem; height: 2rem; border: 0; background: none; cursor: pointer; }
.pf-more::after { content: ""; display: block; margin: auto; width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); rotate: 45deg; translate: 0 -2px; transition: rotate 200ms var(--ease-out); }
.pf-trip.is-open .pf-more::after { rotate: 225deg; translate: 0 2px; }
.pf-trip.is-still { animation: none; }
.pf-under { height: 2.5rem; }

/* Cancelling a booking: its way in at the foot of an open card, and the sheet. */
.pf-cancel-open { display: block; margin: 0.75rem 0 0; min-height: 2.75rem; padding: 0 0.25rem; border: 0; background: none; font: inherit; font-size: 0.9375rem; font-weight: 700; color: var(--bad); cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.pf-cancel { width: min(26rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); margin: auto; padding: 1.25rem; border: 0; border-radius: 18px; background: var(--ground); color: var(--ink); box-shadow: 0 24px 60px -20px rgb(34 48 60 / 0.5); overflow-y: auto; }
.pf-cancel::backdrop { background: rgb(34 48 60 / 0.45); }
.pf-cancel[open] { display: grid; gap: 0.875rem; animation: enter 220ms var(--ease-out) both; }
.pf-cancel h2 { font-stretch: 78%; font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.pf-cancel-trip { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
.pf-cancel-trip div { display: grid; gap: 0.125rem; min-width: 0; }
.pf-cancel-trip b { font-stretch: 80%; font-size: 1.1875rem; font-weight: 800; }
.pf-cancel-trip span:not(.pf-badge) { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.pf-cancel-sums { display: grid; grid-template-columns: 1fr auto; gap: 0.375rem 1rem; margin: 0; padding: 0.75rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; font-size: 0.9375rem; }
.pf-cancel-sums dt { color: var(--ink-2); font-weight: 600; }
.pf-cancel-sums dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.pf-cancel-sums dd.is-strong { font-stretch: 80%; font-size: 1.375rem; font-weight: 800; color: var(--good); }
.pf-cancel-note, .pf-cancel-wait { font-size: 0.875rem; color: var(--ink-2); }
.pf-cancel-wait { font-weight: 700; }
.pf-cancel-note.is-bad { padding: 0.625rem 0.75rem; background: var(--bad-ground); border-radius: 10px; font-weight: 700; color: var(--bad); }
.pf-cancel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.pf-cancel-actions > :only-child { grid-column: 1 / -1; }
.pf-cancel-keep, .pf-cancel-go { min-height: 3rem; padding: 0 0.75rem; border-radius: 999px; font: inherit; font-size: 1rem; font-weight: 750; cursor: pointer; }
.pf-cancel-keep { border: 0; background: var(--accent); color: var(--on-accent); }
.pf-cancel-go { border: 1.5px solid var(--bad); background: var(--surface); color: var(--bad); }
.pf-cancel-tick { justify-self: start; width: 3rem; height: 3rem; border-radius: 50%; background: var(--good); position: relative; }
.pf-cancel-tick::after { content: ""; position: absolute; left: 1.05rem; top: 0.7rem; width: 0.7rem; height: 1.2rem; border-right: 3px solid #fff; border-bottom: 3px solid #fff; rotate: 45deg; }
@media (hover: hover) { .pf-cancel-go:hover { background: var(--bad-ground); } .pf-cancel-keep:hover { filter: brightness(1.06); } }
@media (prefers-reduced-motion: reduce) { .pf-cancel[open] { animation: none; } }

/* The top of the profile: a round picture the traveller chooses, their name beside it. */
.pf-me { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.pf-me > div { min-width: 0; }
.pf-me h1 { overflow-wrap: anywhere; }
#profile-sub:empty { display: none; }
.pf-photo { position: relative; flex: none; display: grid; place-items: center; width: 3.75rem; height: 3.75rem; padding: 0; border: 2px solid var(--accent); border-radius: 50%; background: var(--tint); color: var(--accent); cursor: pointer; }
.pf-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pf-photo > span { font-stretch: 80%; font-size: 1.625rem; font-weight: 800; }
.pf-photo > svg { width: 1.75rem; height: 1.75rem; fill: currentColor; }
.pf-photo > i { position: absolute; right: -0.25rem; bottom: -0.25rem; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--accent); }
.pf-photo > i svg { width: 0.875rem; height: 0.875rem; fill: none; stroke: var(--accent); stroke-width: 1.3; stroke-linejoin: round; }

/* A flip clock: each figure on a white leaf, split across its middle, rolling slowly to its figure. */
.pf-clock { display: inline-flex; align-items: center; gap: 0.125rem; vertical-align: middle; font-variant-numeric: tabular-nums; }
.pf-flip { position: relative; display: inline-block; width: 0.85em; font-size: 1em; height: 1.3em; overflow: hidden; background: linear-gradient(#fff, #f3f3f3); border: 1px solid rgb(34 48 60 / 0.28); border-radius: 0.25em; box-shadow: 0 1px 0 rgb(34 48 60 / 0.18); }
.pf-flip::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgb(34 48 60 / 0.22); }
.pf-strip { display: block; width: 100%; transition: transform 1.1s ease-in-out; transition-delay: calc(0.3s + var(--at) * 0.28s); }
.pf-fig { display: block; height: 1.3em; line-height: 1.3em; text-align: center; font-size: 1em; font-weight: 800; color: var(--ink); }
.pf-clock.is-turned .pf-strip { transform: translateY(calc(var(--to) * -10%)); }
.pf-clock-dots { width: 0.1875em; height: 0.6em; background: radial-gradient(circle, var(--ink) 0 62%, transparent 66%) top / 100% 0.1875em no-repeat, radial-gradient(circle, var(--ink) 0 62%, transparent 66%) bottom / 100% 0.1875em no-repeat; }
@media (prefers-reduced-motion: reduce) { .pf-strip { transition: none; } }
.profile > .trip-summary { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.profile > .trip-summary #profile-close { flex: none; width: auto; }

/* The map: a country a trip was booked to is filled; its city is a solid dot with its name. */
.pf-country { fill: #3fa89c; stroke: #fdfcf8; stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pf-here { fill: var(--ink); stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.pf-key i.is-visited { width: 0.875rem; height: 0.6875rem; border-radius: 3px; background: #3fa89c; border: 1px solid #fdfcf8; box-shadow: 0 0 0 1px #9dbcbc; }

/* The extras of a booked trip: a chip each, under the flight it is on. */
.pf-extras { display: grid; gap: 0.375rem; margin-top: 0.75rem; }
.pf-extras h4 { font-size: 0.8125rem; font-weight: 750; color: var(--ink-2); }
.pf-extra-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.pf-extra-flight { flex: 0 0 100%; font-size: 0.75rem; font-weight: 700; color: var(--ink); }
.pf-extra { display: inline-flex; align-items: center; gap: 0.3125rem; min-height: 1.75rem; padding: 0.125rem 0.5625rem 0.125rem 0.4375rem; background: var(--tint); border-radius: 999px; font-size: 0.8125rem; font-weight: 650; color: var(--ink); }
.pf-extra svg { width: 0.9375rem; height: 0.9375rem; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pf-extras-none { margin-top: 0.625rem; font-size: 0.8125rem; color: var(--ink-2); }

/* A trip's title, "Madrid → Barcelona", is one line whatever the names: `fitWay` in profile.js makes the letters
   smaller when they do not fit, and past that the name of the destination is cut with three dots. */
.pf-way { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; min-width: 0; }
.pf-way span { overflow-wrap: normal; flex: none; }
.pf-way span:last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pf-way .pf-arrow { flex: none; }

