/* ============================================================
   TRIP MAKER — the new creation flow (js/plan-magic.js)
   Every rule here is behind html.magic-on (set in plan.html's head before the first
   paint) or on an element only that script creates; if the script cannot start it
   takes the class off and the page falls back to the plain wizard.

   Layout: a globe fixed behind the page; on a wide screen the wizard is the right-hand
   column, the live preview card the left one, and the globe shows between them. On a
   phone the page reads top to bottom — a window onto the globe, the preview card, the
   flight-path progress, the panel — and the globe stays put behind it as it scrolls.
   ============================================================ */

html.magic-on body { background: #050d0c; }
html.magic-on .site-header { background: rgba(8, 18, 16, .55); }
html.magic-on .page-shell,
html.magic-on .site-footer { position: relative; z-index: 1; }
html.magic-on .site-footer { background: linear-gradient(to bottom, transparent, rgba(4, 10, 9, .92) 40%); border-top: 0; }
html.magic-on .wizard-progress { display: none; }

/* ---------------------------------------------------------------- the stage */

.mg-stage {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(ellipse 80% 70% at 50% 35%, #10302f 0%, #08201d 35%, #050f0d 70%, #030807 100%);
}
.mg-sky, .mg-sky i { position: absolute; inset: 0; }
.mg-sky i {
  background-repeat: repeat;
  animation: mg-twinkle 6s ease-in-out infinite;
}
.mg-sky i:nth-child(1) {
  background-image: radial-gradient(1px 1px at 20px 30px, #fff8, transparent), radial-gradient(1px 1px at 140px 90px, #fff6, transparent),
    radial-gradient(1.4px 1.4px at 80px 160px, #ffe7c4aa, transparent), radial-gradient(1px 1px at 190px 220px, #fff5, transparent);
  background-size: 230px 250px;
}
.mg-sky i:nth-child(2) {
  background-image: radial-gradient(1.2px 1.2px at 60px 70px, #fff9, transparent), radial-gradient(1px 1px at 300px 180px, #cfeee6aa, transparent),
    radial-gradient(1.6px 1.6px at 200px 40px, #ffffffcc, transparent);
  background-size: 360px 300px; animation-delay: -2s; animation-duration: 8s;
}
.mg-sky i:nth-child(3) {
  background-image: radial-gradient(2px 2px at 120px 120px, #ffd9a6cc, transparent), radial-gradient(1.5px 1.5px at 420px 330px, #fff, transparent);
  background-size: 520px 440px; animation-delay: -4s; animation-duration: 5s;
}
@keyframes mg-twinkle { 0%, 100% { opacity: .9; } 50% { opacity: .35; } }

/* the stage's own selector: maplibre-gl.css makes every map position: relative */
.mg-stage > .mg-globe { position: absolute; inset: 0; opacity: 0; transition: opacity 1.8s ease; }
.mg-stage > .mg-globe.is-ready { opacity: 1; }
.mg-globe .maplibregl-canvas { outline: none; }
.mg-flatphoto {
  position: absolute; inset: -30px; opacity: 0; transition: opacity 1.2s ease;
  background: var(--img, none) center / cover no-repeat;
  filter: blur(3px) brightness(.5) saturate(1.1);
}
.mg-stage.is-flat .mg-flatphoto { opacity: 1; animation: mg-kb 24s ease-in-out infinite alternate; }
.mg-stage.is-flat .mg-globe { display: none; }
.mg-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(to left, rgba(4, 10, 9, .78) 0%, rgba(4, 10, 9, .35) 34%, transparent 48%),
    linear-gradient(to right, rgba(4, 10, 9, .6) 0%, transparent 30%),
    linear-gradient(to bottom, rgba(4, 10, 9, .55) 0%, transparent 18%, transparent 80%, rgba(4, 10, 9, .7) 100%);
}

/* pins on the globe */
.mg-pin { position: relative; width: 0; height: 0; --c: #ffb45f; }
.mg-pin-dot {
  position: absolute; width: 12px; height: 12px; left: -6px; top: -6px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 0 3px rgba(10, 21, 18, .75), 0 0 18px var(--c);
}
.mg-pin-ring {
  position: absolute; width: 46px; height: 46px; left: -23px; top: -23px; border-radius: 50%;
  border: 2px solid var(--c); opacity: 0; animation: mg-ring 2.4s ease-out infinite;
}
@keyframes mg-ring { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(1.4); opacity: 0; } }
.mg-pin-label {
  position: absolute; bottom: 13px; left: 0; transform: translateX(-50%); transform-origin: 50% 100%;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(10, 21, 18, .84); border: 1px solid color-mix(in srgb, var(--c) 65%, transparent);
  color: var(--paper); font: 700 .82rem/1.2 var(--font-body);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .7);
  animation: mg-pin-in .8s cubic-bezier(.3, 1.6, .5, 1) both;
}
.mg-pin-label img, .mg-pin-label .flag { width: 18px; height: auto; border-radius: 2px; }
@keyframes mg-pin-in { from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.4); } to { opacity: 1; transform: translateX(-50%); } }
.mg-pin-home { --c: #8fd8c4; }
.mg-pin-home .mg-pin-dot { width: 8px; height: 8px; left: -4px; top: -4px; }
.mg-pin-home .mg-pin-label { font-size: .7rem; font-weight: 600; color: var(--mint); padding: 3px 8px; bottom: 9px; }

/* ---------------------------------------------------------------- page copy */

html.magic-on .wizard-shell > h1 { letter-spacing: -.01em; text-shadow: 0 4px 30px rgba(0, 0, 0, .55); }
.mg-shine {
  background: linear-gradient(100deg, #ffb45f 0%, #ffe2b8 25%, #ffb45f 45%, #e8853a 70%, #ffb45f 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: mg-shine 5s linear infinite;
}
@keyframes mg-shine { from { background-position: 120% 0; } to { background-position: -100% 0; } }
html.magic-on .wizard-shell > .page-sub { color: rgba(245, 239, 227, .78); text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }

/* ---------------------------------------------------------------- the panels */

html.magic-on .wizard-panel {
  background: linear-gradient(165deg, rgba(18, 36, 31, .86), rgba(8, 18, 16, .9));
  -webkit-backdrop-filter: blur(18px) saturate(1.25); backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, .13); border-radius: 26px;
  box-shadow: 0 34px 80px -34px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .08);
  transform-origin: 100% 50%;
}
html.magic-on .wizard-panel h2 { font-size: 1.6rem; }
.mg-in-fwd { animation: mg-swing-fwd .75s cubic-bezier(.2, .85, .2, 1) both; }
.mg-in-back { animation: mg-swing-back .75s cubic-bezier(.2, .85, .2, 1) both; }
@keyframes mg-swing-fwd {
  from { opacity: 0; transform: perspective(1300px) rotateY(-22deg) translateX(-50px) scale(.95); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes mg-swing-back {
  from { opacity: 0; transform: perspective(1300px) rotateY(18deg) translateX(50px) scale(.95); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* the CTA: warm, alive, impossible to miss */
html.magic-on .mg-cta {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(115deg, #ffd59e, #ffb45f 30%, #ef8f45 60%, #ffb45f 85%, #ffd59e);
  background-size: 220% 100%;
  box-shadow: 0 0 0 1px rgba(255, 213, 158, .5), 0 14px 34px -10px rgba(232, 133, 58, .85);
  animation: mg-cta-flow 7s linear infinite, mg-cta-glow 2.8s ease-in-out infinite;
}
.mg-cta-glint {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .65) 48%, transparent 66%);
  transform: translateX(130%); animation: mg-glint 3.4s ease-in-out infinite 1s;
}
@keyframes mg-cta-flow { from { background-position: 0 0; } to { background-position: -220% 0; } }
@keyframes mg-cta-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 213, 158, .5), 0 14px 34px -10px rgba(232, 133, 58, .85); }
  50% { box-shadow: 0 0 0 1px rgba(255, 213, 158, .8), 0 14px 46px -6px rgba(255, 180, 95, 1), 0 0 0 7px rgba(255, 180, 95, .12); }
}
@keyframes mg-glint { 0% { transform: translateX(130%); } 55%, 100% { transform: translateX(-130%); } }

/* the interest chips become small tiles with a face */
html.magic-on .interest-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 10px; }
html.magic-on .interest-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 92px; padding: 14px 8px 12px; margin: 0; border-radius: 18px;
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .12);
  color: var(--paper-dim); text-align: center; line-height: 1.2;
  transition: transform .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease, color .25s ease;
  animation: mg-tile-in .55s cubic-bezier(.2, .9, .3, 1.2) backwards; animation-delay: calc(var(--i, 0) * 35ms);
}
html.magic-on .interest-chip:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .08); color: var(--paper); }
html.magic-on .interest-chip .mg-ie { font-size: 1.95rem; line-height: 1; transition: transform .4s cubic-bezier(.3, 1.8, .5, 1); }
html.magic-on .interest-chip .mg-il { font-size: .86rem; font-weight: 600; }
html.magic-on .interest-chip:hover .mg-ie { transform: scale(1.16) rotate(-7deg); }
html.magic-on .interest-chip.selected {
  color: var(--paper);
  background: linear-gradient(160deg, rgba(255, 180, 95, .26), rgba(232, 133, 58, .1));
  border-color: rgba(255, 180, 95, .75);
  box-shadow: 0 0 0 3px rgba(255, 180, 95, .13), 0 12px 26px -14px rgba(255, 180, 95, .8);
}
html.magic-on .interest-chip.selected .mg-ie { transform: scale(1.22); }
@keyframes mg-tile-in { from { opacity: 0; transform: translateY(16px) scale(.9); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- step 1: postcards */

.mg-inspo { margin-top: 20px; }
.mg-inspo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.mg-inspo-head span { font-weight: 700; color: var(--paper); }
.mg-inspo-head small { color: var(--paper-dim); font-size: .8rem; }
.mg-inspo-rail {
  display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 14px 4px 18px; margin-inline: -4px;
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 14px, #000 calc(100% - 46px), transparent);
  mask-image: linear-gradient(to left, transparent 0, #000 14px, #000 calc(100% - 46px), transparent);
}
.mg-inspo-rail::-webkit-scrollbar { display: none; }
.mg-postcard {
  position: relative; flex: 0 0 134px; height: 172px; padding: 0; overflow: hidden;
  border-radius: 18px; border: 1px solid rgba(255, 255, 255, .14);
  background: #12221e; color: var(--paper); font: inherit; text-align: start; cursor: pointer;
  scroll-snap-align: start; transform-origin: 50% 100%;
  box-shadow: 0 14px 26px -16px rgba(0, 0, 0, .9);
  transition: transform .4s cubic-bezier(.2, .9, .3, 1.2), box-shadow .3s ease, border-color .3s ease;
  animation: mg-card-in .7s cubic-bezier(.2, .9, .3, 1.15) backwards; animation-delay: calc(var(--i, 0) * 50ms + .15s);
}
.mg-postcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.mg-pc-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, .25), transparent 35%, rgba(5, 13, 12, .88) 100%); }
.mg-pc-flags { position: absolute; top: 9px; right: 10px; display: flex; gap: 3px; font-size: 1rem; }
.mg-pc-flags img { width: 20px; border-radius: 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.mg-pc-name { position: absolute; right: 11px; left: 10px; bottom: 26px; font-family: var(--font-display); font-size: 1.08rem; line-height: 1.15; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.mg-pc-sub { position: absolute; right: 11px; left: 10px; bottom: 9px; font-size: .74rem; color: rgba(245, 239, 227, .78); }
.mg-pc-check {
  position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--amber); color: #241302;
  transform: scale(0) rotate(-90deg); transition: transform .45s cubic-bezier(.3, 1.8, .5, 1);
}
.mg-pc-check svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mg-postcard:hover { transform: translateY(-7px) rotate(-1.5deg) scale(1.03); box-shadow: 0 22px 34px -16px rgba(0, 0, 0, .95); border-color: rgba(255, 180, 95, .55); }
.mg-postcard:hover img { transform: scale(1.1); }
.mg-postcard:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.mg-postcard.is-on { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(255, 180, 95, .45), 0 18px 30px -16px rgba(255, 180, 95, .6); }
.mg-postcard.is-on .mg-pc-check { transform: none; }
@keyframes mg-card-in {
  from { opacity: 0; transform: perspective(700px) translateY(30px) rotateX(-35deg) scale(.9); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- progress: a flight path */

.mg-progress { position: relative; height: 70px; margin: 6px 0 16px; --at: 0; }
.mg-pp-line {
  position: absolute; top: 25px; right: 28px; left: 28px; height: 2px;
  background: repeating-linear-gradient(to left, rgba(255, 255, 255, .32) 0 7px, transparent 7px 13px);
}
.mg-pp-fill {
  position: absolute; top: 0; bottom: 0; right: 0; width: calc(var(--at) * 33.333%);
  background: linear-gradient(to left, var(--mint), var(--amber));
  box-shadow: 0 0 12px rgba(255, 180, 95, .6);
  transition: width 1s cubic-bezier(.6, 0, .2, 1);
}
.mg-pp-stop {
  position: absolute; top: 8px; right: calc(28px + (100% - 56px) * var(--i) / 3); transform: translateX(50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0; color: var(--paper-dim); font: 600 .8rem var(--font-body); cursor: default;
}
.mg-pp-stop:not(:disabled) { cursor: pointer; }
.mg-pp-n {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(10, 21, 18, .92); border: 1.5px solid rgba(255, 255, 255, .25);
  font-weight: 800; font-size: .9rem; color: var(--paper-dim);
  transition: background .4s ease, border-color .4s ease, color .4s ease, transform .4s cubic-bezier(.3, 1.8, .5, 1);
}
.mg-pp-stop.is-done { color: var(--mint); }
.mg-pp-stop.is-done .mg-pp-n { background: #143a32; border-color: var(--mint); color: var(--mint); }
.mg-pp-stop.is-done:hover .mg-pp-n { transform: scale(1.1); }
.mg-pp-stop.is-here { color: var(--paper); }
.mg-pp-stop.is-here .mg-pp-n {
  background: linear-gradient(135deg, var(--amber), var(--amber-deep)); border-color: #ffd59e; color: #241302;
  transform: scale(1.12); animation: mg-here 2.2s ease-in-out infinite;
}
@keyframes mg-here { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 180, 95, .55); } 50% { box-shadow: 0 0 0 9px rgba(255, 180, 95, 0); } }
.mg-pp-plane {
  position: absolute; top: -12px; z-index: 2; width: 26px; height: 26px; color: #ffe2b8;
  right: calc(28px + (100% - 56px) * var(--at) / 3); transform: translateX(50%);
  transition: right 1s cubic-bezier(.6, 0, .2, 1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)) drop-shadow(0 0 6px rgba(255, 180, 95, .6));
}
.mg-pp-plane svg { width: 100%; height: 100%; fill: currentColor; transform: rotate(-90deg); animation: mg-bob 2.6s ease-in-out infinite; }
@keyframes mg-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }

/* ---------------------------------------------------------------- the preview card */

.mg-preview { perspective: 1500px; animation: mg-float 8s ease-in-out infinite; }
@keyframes mg-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.mg-card {
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 0%;
  position: relative; overflow: hidden; border-radius: 26px;
  background: linear-gradient(170deg, rgba(22, 42, 36, .94), rgba(9, 19, 17, .96));
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 46px 90px -34px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 180, 95, .05);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
  animation: mg-card-rise 1s cubic-bezier(.2, .9, .25, 1) backwards .1s;
}
.mg-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, .13), transparent 45%);
}
.mg-card.is-catch { animation: mg-catch .9s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes mg-card-rise { from { opacity: 0; transform: translateY(40px) rotateX(18deg) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes mg-catch {
  0% { transform: rotateY(0) scale(1); }
  30% { transform: rotateY(-14deg) scale(1.03); }
  60% { transform: rotateY(6deg) scale(.995); }
  100% { transform: rotateY(0) scale(1); }
}

.mg-cover { position: relative; height: 210px; overflow: hidden; background: #0f2420; }
.mg-cover-imgs, .mg-cover-img { position: absolute; inset: 0; }
.mg-cover-img {
  width: 100%; height: 100%; object-fit: cover;
  clip-path: circle(0% at 50% 62%);
  animation: mg-kb 16s ease-in-out infinite alternate;
}
.mg-cover-img.in { animation: mg-reveal 1.5s cubic-bezier(.6, 0, .2, 1) both, mg-kb 16s ease-in-out infinite alternate; }
@keyframes mg-reveal { from { clip-path: circle(0% at 50% 62%); } to { clip-path: circle(120% at 50% 62%); } }
@keyframes mg-kb { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.16) translate(-2%, -2%); } }
.mg-cover-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(5, 13, 12, .45), transparent 34%, transparent 58%, rgba(9, 19, 17, .96) 100%); }
.mg-badge {
  position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700;
  background: rgba(10, 21, 18, .7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .16); color: var(--paper);
}
.mg-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); animation: mg-blink 1.4s ease-in-out infinite; }
@keyframes mg-blink { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 180, 95, .7); } 50% { opacity: .5; box-shadow: 0 0 0 5px rgba(255, 180, 95, 0); } }
.mg-flags { position: absolute; top: 14px; left: 14px; display: flex; gap: 5px; font-size: 1.25rem; }
.mg-flags img { width: 26px; border-radius: 3px; box-shadow: 0 2px 8px rgba(0, 0, 0, .55); animation: mg-pop-in .6s cubic-bezier(.3, 1.8, .5, 1) both; }

.mg-head { position: relative; padding: 0 20px 4px; margin-top: -40px; }
.mg-title { font-family: var(--font-display); font-size: 1.62rem; line-height: 1.15; min-height: 1.2em; text-shadow: 0 2px 16px rgba(0, 0, 0, .65); }
.mg-ch { display: inline-block; animation: mg-letter .55s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: var(--d); }
@keyframes mg-letter { from { opacity: 0; transform: translateY(.45em) rotateX(-80deg); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.mg-meta { margin-top: 6px; color: var(--paper-dim); font-size: .92rem; font-weight: 600; min-height: 1.3em; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.mg-season { display: inline-flex; padding: 1px 9px; border-radius: 999px; background: rgba(143, 216, 196, .12); color: var(--mint); font-size: .8rem; animation: mg-pop-in .5s cubic-bezier(.3, 1.8, .5, 1) both; }
.mg-meta-hint { color: rgba(245, 239, 227, .5); font-weight: 400; }

.mg-body { padding: 8px 20px 20px; display: grid; gap: 4px; }
.mg-sec { padding: 12px 0 10px; border-top: 1px dashed rgba(255, 255, 255, .1); }
.mg-sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 9px; font: 700 .74rem var(--font-body); letter-spacing: .06em; color: rgba(245, 239, 227, .55); }
.mg-sec-aside { font-weight: 600; letter-spacing: 0; color: var(--amber); font-size: .8rem; }

.mg-skel {
  display: block; height: 10px; margin: 7px 0; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .13) 50%, rgba(255, 255, 255, .05) 100%);
  background-size: 200% 100%; animation: shimmer 1.8s linear infinite;
}
.mg-title .mg-skel { height: 24px; margin: 6px 0; }
.mg-meta .mg-skel { width: 45%; }

.mg-route { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; }
.mg-stop {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--c, #8fd8c4) 15%, transparent); border: 1px solid color-mix(in srgb, var(--c, #8fd8c4) 50%, transparent);
  font-size: .86rem; animation: mg-pop-in .55s cubic-bezier(.3, 1.6, .5, 1) both;
}
.mg-stop img { width: 18px; border-radius: 2px; }
.mg-stop-home { --c: #8fd8c4; color: var(--mint); font-size: .78rem; }
.mg-leg { position: relative; width: 30px; height: 14px; }
.mg-leg::before { content: ''; position: absolute; top: 50%; right: 0; left: 0; border-top: 2px dotted color-mix(in srgb, var(--c) 70%, transparent); }
.mg-leg i { position: absolute; top: -1px; right: 0; width: 15px; height: 15px; color: var(--c); animation: mg-leg-fly 2.4s ease-in-out infinite; }
.mg-leg svg { width: 100%; height: 100%; fill: currentColor; transform: rotate(-90deg); }
@keyframes mg-leg-fly { 0% { right: -2px; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { right: calc(100% - 13px); opacity: 0; } }

.mg-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.mg-day {
  height: 36px; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 20%, rgba(255, 255, 255, .02)); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  transition: background .5s ease, border-color .5s ease;
  animation: mg-day-in .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: var(--d, 0ms);
}
.mg-day b { font-size: .78rem; line-height: 1; color: var(--paper); }
.mg-day small { font-size: .58rem; color: rgba(245, 239, 227, .6); margin-top: 2px; line-height: 1; }
.mg-days.is-long { grid-template-columns: repeat(10, 1fr); gap: 4px; }
.mg-days.is-long .mg-day { height: 24px; border-radius: 6px; }
.mg-days.is-long .mg-day small { display: none; }
.mg-days.is-long .mg-day b { font-size: .62rem; }
@keyframes mg-day-in { from { opacity: 0; transform: scale(.3) translateY(10px); } to { opacity: 1; transform: none; } }
.mg-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 9px; font-size: .76rem; color: var(--paper-dim); }
.mg-legend:empty { display: none; }
.mg-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mg-legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.mg-legend em { flex-basis: 100%; font-style: normal; color: rgba(245, 239, 227, .42); font-size: .7rem; }

.mg-vibes { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-vibe { padding: 4px 11px; border-radius: 999px; font-size: .84rem; background: rgba(255, 180, 95, .12); border: 1px solid rgba(255, 180, 95, .35); color: #ffe2b8; }
.mg-vibe.is-new { animation: mg-pop-in .6s cubic-bezier(.3, 1.8, .5, 1) both; }
.mg-vibe-empty { font-size: .82rem; color: rgba(245, 239, 227, .45); }
.mg-note { margin-top: 10px; padding: 8px 12px; border-inline-start: 3px solid var(--mint); border-radius: 4px; background: rgba(143, 216, 196, .07); font-size: .86rem; color: var(--paper-dim); line-height: 1.45; }
@keyframes mg-pop-in { from { opacity: 0; transform: scale(.5) translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- sparks */

.mg-spark {
  position: fixed; z-index: 300; width: 7px; height: 7px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fffaf0 0%, var(--c, #ffb45f) 55%, transparent 72%);
  box-shadow: 0 0 10px var(--c, #ffb45f);
}
.mg-spark-emoji { width: auto; height: auto; background: none; box-shadow: none; font-size: 1.3rem; }

/* ---------------------------------------------------------------- take-off */

html.mg-launching { overflow: hidden; }
html.mg-launching .page-shell,
html.mg-launching .site-header,
html.mg-launching .site-footer { opacity: 0; transition: opacity .6s ease; }
.mg-launch {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .5s ease;
}
.mg-launch.is-on { opacity: 1; pointer-events: auto; }
.mg-launch-sky { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 46%, rgba(5, 13, 12, .1), rgba(5, 13, 12, .78) 75%); }
.mg-pass-lift { position: relative; width: min(430px, 100%); filter: drop-shadow(0 40px 50px rgba(0, 0, 0, .7)) drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.mg-pass {
  position: relative; width: 100%; border-radius: 24px; color: #13211d;
  background: linear-gradient(180deg, #fbf6ea, #f2eadb);
  /* the two bites at the tear line are cut out of the ticket itself, so the globe shows
     through them — a mask, which also clips a box-shadow, hence the drop-shadow */
  --tear: calc(100% - 72px);
  -webkit-mask: radial-gradient(circle 12px at 0 var(--tear), transparent 11.5px, #000 12px) left / 51% 100% no-repeat,
    radial-gradient(circle 12px at 100% var(--tear), transparent 11.5px, #000 12px) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 12px at 0 var(--tear), transparent 11.5px, #000 12px) left / 51% 100% no-repeat,
    radial-gradient(circle 12px at 100% var(--tear), transparent 11.5px, #000 12px) right / 51% 100% no-repeat;
  animation: mg-print 1.3s .2s cubic-bezier(.2, .9, .25, 1) backwards;
  transform-origin: 50% 100%;
}
@keyframes mg-print {
  from { opacity: 0; transform: perspective(1000px) translateY(80px) rotateX(65deg) scale(.88); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
.mg-pass-top {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 22px;
  background: linear-gradient(120deg, #0a1512, #16302a); color: var(--paper); border-radius: 24px 24px 0 0;
}
.mg-pass-brand { font: 800 .95rem/1 var(--font-display); letter-spacing: .04em; color: var(--amber); }
.mg-pass-brand b { color: var(--paper); font-weight: inherit; }
.mg-pass-kind { font-size: .8rem; color: var(--paper-dim); font-weight: 600; }
.mg-pass-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 18px 22px 10px; }
.mg-pass-pt { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.mg-pass-pt small { font-size: .72rem; color: #6a7570; font-weight: 700; }
.mg-pass-pt b { font: 400 2rem/1.1 var(--font-display); color: #0a1512; }
.mg-pass-pt b img { width: 40px; border-radius: 4px; vertical-align: middle; }
.mg-pass-pt span { font-size: .9rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-pass-fly { position: relative; width: 92px; height: 30px; color: #e8853a; display: flex; align-items: center; }
.mg-pass-fly i { flex: 1; border-top: 2px dashed rgba(10, 21, 18, .3); }
.mg-pass-fly svg { width: 26px; height: 26px; fill: currentColor; transform: rotate(-90deg); animation: mg-pass-fly 2.2s ease-in-out infinite; }
@keyframes mg-pass-fly { 0%, 100% { translate: 8px 0; } 50% { translate: -8px -3px; } }
.mg-pass-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px 22px 16px; }
.mg-pass-grid div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mg-pass-grid small { font-size: .68rem; color: #6a7570; font-weight: 700; }
.mg-pass-grid b { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-pass-tear {
  position: relative; height: 0; margin: 0 22px; border-top: 2px dashed rgba(10, 21, 18, .2);
}
.mg-pass-foot { display: flex; align-items: center; gap: 14px; padding: 14px 22px 18px; padding-left: 130px; }
.mg-pass-code {
  flex: none; width: 120px; height: 38px; opacity: .85;
  background: repeating-linear-gradient(90deg, #0a1512 0 2px, transparent 2px 4px, #0a1512 4px 5px, transparent 5px 8px, #0a1512 8px 11px, transparent 11px 13px);
}
.mg-pass-title { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mg-stamp {
  position: absolute; left: 22px; bottom: 16px; padding: 7px 13px; border: 3px solid #d2453a; border-radius: 12px;
  color: #d2453a; font: 400 1.15rem/1.05 var(--font-display); text-align: center;
  opacity: 0; transform: rotate(-14deg) scale(2.6); mix-blend-mode: multiply;
}
.mg-launch.is-landed .mg-stamp { animation: mg-stamp .5s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes mg-stamp { from { opacity: 0; transform: rotate(-14deg) scale(2.6); } to { opacity: .9; transform: rotate(-14deg) scale(1); } }
.mg-launch.is-landed .mg-pass { animation: mg-print 1.3s .2s cubic-bezier(.2, .9, .25, 1) backwards, mg-thud .4s .05s ease-out; }
@keyframes mg-thud { 0%, 100% { translate: 0 0; } 40% { translate: 0 4px; } }
.mg-launch-lines { position: relative; list-style: none; display: grid; gap: 9px; min-width: min(320px, 100%); }
.mg-launch-lines li {
  display: flex; align-items: center; gap: 11px; color: rgba(245, 239, 227, .4); font-weight: 600; font-size: .98rem;
  transition: color .4s ease; animation: mg-line-in .5s cubic-bezier(.2, .9, .3, 1) both; animation-delay: calc(.9s + var(--i) * 90ms);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}
.mg-ll-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(245, 239, 227, .3); flex: none; position: relative; transition: all .35s ease; }
.mg-launch-lines li.is-now { color: var(--paper); }
.mg-launch-lines li.is-now .mg-ll-dot { border-color: var(--amber); border-top-color: transparent; animation: mg-spin .8s linear infinite; }
.mg-launch-lines li.is-done { color: var(--mint); }
.mg-launch-lines li.is-done .mg-ll-dot { border-color: var(--mint); background: var(--mint); animation: none; }
.mg-launch-lines li.is-done .mg-ll-dot::after {
  content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
  border: solid #0a1512; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
@keyframes mg-spin { to { transform: rotate(360deg); } }
@keyframes mg-line-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.mg-launch-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 45%, #fff9ec 0%, #ffd59e 35%, rgba(255, 180, 95, .6) 60%, rgba(10, 21, 18, 0) 100%); }
.mg-launch.is-gone .mg-launch-flash { animation: mg-flash .5s ease-in both; }
.mg-launch.is-gone .mg-pass-lift { transition: transform .45s ease-in, opacity .45s ease-in; transform: translateY(-40px) scale(1.08); opacity: 0; }
@keyframes mg-flash { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- wide screens */

@media (min-width: 1000px) {
  html.magic-on .wizard-shell {
    width: min(1400px, calc(100% - 56px));
    display: grid; grid-template-columns: minmax(0, 560px) minmax(40px, 1fr) minmax(320px, 390px);
    align-items: start; column-gap: 24px; padding-top: 112px;
  }
  html.magic-on .wizard-shell > * { grid-column: 1; }
  html.magic-on .wizard-shell > .mg-preview { grid-column: 3; grid-row: 1 / span 12; position: sticky; top: 106px; }
  html.magic-on .wizard-shell > h1 { font-size: clamp(2.3rem, 3.4vw, 3.1rem); }
  html.magic-on .wizard-panel { padding: 30px 30px 28px; }
}

/* ---------------------------------------------------------------- phones and tablets */

@media (max-width: 999px) {
  .mg-vignette {
    background:
      linear-gradient(to bottom, rgba(4, 10, 9, .5) 0%, transparent 16%, transparent 36%, rgba(4, 10, 9, .8) 58%, rgba(4, 10, 9, .96) 75%);
  }
  html.magic-on .wizard-shell { padding-top: calc(98px + env(safe-area-inset-top)); }
  html.magic-on .wizard-shell > h1 { font-size: 1.85rem; text-align: center; }
  html.magic-on .wizard-shell > .page-sub { text-align: center; font-size: .92rem; margin: 6px 0 0; }
  .mg-preview { margin-top: calc(30vh - 60px); animation: none; }
  .mg-card { display: grid; grid-template-columns: 108px minmax(0, 1fr); border-radius: 22px; }
  .mg-cover { grid-row: 1 / span 2; height: auto; min-height: 124px; }
  .mg-cover-shade { background: linear-gradient(to left, transparent 60%, rgba(9, 19, 17, .5)); }
  .mg-badge { display: none; }
  .mg-flags { top: auto; bottom: 9px; left: 9px; right: 9px; flex-wrap: wrap; }
  .mg-flags img { width: 22px; }
  .mg-head { margin-top: 0; padding: 13px 14px 0; }
  .mg-title { font-size: 1.22rem; }
  .mg-title .mg-skel { height: 18px; }
  .mg-meta { font-size: .82rem; margin-top: 4px; }
  .mg-body { padding: 6px 14px 12px; gap: 0; }
  .mg-sec { border: 0; padding: 4px 0; }
  .mg-sec-h, .mg-sec-route, .mg-legend, .mg-note { display: none; }
  .mg-days, .mg-days.is-long { display: flex; gap: 2px; }
  .mg-day, .mg-days.is-long .mg-day { flex: 1; height: 7px; border-radius: 3px; border: 0; background: var(--c); }
  .mg-day b, .mg-day small { display: none; }
  .mg-vibes { flex-wrap: nowrap; overflow: hidden; gap: 4px; -webkit-mask-image: linear-gradient(to left, #000 80%, transparent); mask-image: linear-gradient(to left, #000 80%, transparent); }
  .mg-vibe { font-size: .74rem; padding: 2px 8px; white-space: nowrap; }
  .mg-vibes .mg-skel { height: 8px; margin: 3px 0; }
  .mg-vibe-empty { font-size: .74rem; }
  .mg-progress { margin-top: 14px; }
  html.magic-on .wizard-panel { padding: 24px 18px 22px; border-radius: 24px; }
  html.magic-on .wizard-panel h2 { font-size: 1.4rem; }
  html.magic-on .interest-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  html.magic-on .interest-chip { min-height: 84px; }
  .mg-postcard { flex-basis: 124px; height: 160px; }
  .mg-pass-grid { grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
  .mg-pass-pt b { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html.magic-on *, html.magic-on *::before, html.magic-on *::after, .mg-launch, .mg-launch * {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
}

/* ---------------------------------------------------------------- the empty card
   Before the first destination the card is an invitation, not a loading state: no
   shimmer anywhere (on a phone a row of shimmering bars read as "stuck"), a question
   for a title, a ghost stop at the end of the route, and the days as outlines. */
.mg-ghost { color: rgba(245, 239, 227, .55); }
.mg-stop-ghost { --c: #ffb45f; border-style: dashed; background: transparent; color: var(--amber); animation: mg-blink 2s ease-in-out infinite; }
.mg-days.is-ghost .mg-day { background: transparent; border: 1px dashed rgba(255, 255, 255, .25); }
.mg-days.is-ghost .mg-day b { color: rgba(245, 239, 227, .45); }
@media (max-width: 999px) {
  .mg-days.is-ghost { display: none; }
  .mg-meta-hint { font-size: .8rem; line-height: 1.35; }
}

/* ---------------------------------------------------------------- legibility over the globe
   Anything that sits in the page flow above the panels (the saved-draft banner, the
   "already planning a trip" nudge) floats over the globe, so it gets a solid glass
   backing of its own — the classic wizard's 8% mint tint vanished into the imagery. */
html.magic-on .draft-banner,
html.magic-on .draft-waiting {
  position: relative; z-index: 2;
  background: rgba(8, 20, 17, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(143, 216, 196, .45);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .9);
  color: var(--paper);
}
html.magic-on .draft-banner #draft-banner-text { color: var(--paper); line-height: 1.45; }
html.magic-on .draft-banner .btn-ghost { color: var(--paper); border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06); }
/* the plane hovers clear of the step it marks, never on top of its number */
@media (max-width: 999px) {
  .mg-pp-plane { top: -24px; width: 22px; height: 22px; }
  .mg-progress { margin-top: 26px; }
  html.magic-on .draft-banner { margin: 14px 0 0; }
}

/* the globe's credits: one small "i" beside the footer line, the text on a tap */
.mg-credit-i { position: static; margin-inline-start: 8px; vertical-align: middle; }
html.magic-on .site-footer { position: relative; }
.mg-credit-i.is-open::after { left: 16px; right: 16px; bottom: 100%; width: auto; max-width: none; text-align: center; }
