.apg { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: var(--bg); color: var(--fg); }
.apg-top { flex: none; height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface); box-shadow: inset 0 -1px 0 var(--line); position: relative; z-index: 3; }
.apg-back { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; }
.apg-back:hover { background: var(--surface-2); }
.apg-top > b { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; }

.apg-body { flex: 1; min-height: 0; position: relative; display: grid; grid-template-columns: minmax(380px, 480px) 1fr; }
.apg-panel { position: relative; z-index: 2; overflow-y: auto; background: var(--surface); box-shadow: 1px 0 0 var(--line), 12px 0 32px rgba(18, 35, 63, .06); padding: 40px 40px 28px; }
.apg-in { min-height: 100%; display: flex; flex-direction: column; animation: adIn .3s ease-out; }
.apg-mapwrap { position: relative; z-index: 1; min-height: 0; overflow: hidden; }
#apg-map { position: absolute; inset: 0; background: #e8edf2; }
.apg-fade { position: absolute; inset: 0; z-index: 401; pointer-events: none; opacity: 0; transition: opacity .4s; background: linear-gradient(90deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .05) 60%); }
.apg.v-ask.s-start .apg-fade { opacity: 1; }

.apg-pin { position: absolute; left: 50%; top: 50%; z-index: 500; transform: translate(-50%, -100%); pointer-events: none; display: none; transition: transform .15s ease-out; }
.apg[data-pin="1"] .apg-pin { display: block; animation: adDrop .45s cubic-bezier(.2, 1.5, .4, 1); }
.apg-pin .i { width: 48px; height: 48px; color: var(--blue); filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .28)); }
.apg-pin::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 12px; height: 5px; margin-left: -6px; border-radius: 50%; background: rgba(0, 0, 0, .25); transition: transform .15s; }
.apg.moving .apg-pin { transform: translate(-50%, -128%); }
.apg.moving .apg-pin::after { transform: translateY(14px) scale(.6); }
.apg-me { position: absolute; right: 18px; bottom: 22px; z-index: 500; width: 52px; height: 52px; border-radius: 50%; background: var(--surface); color: var(--blue); box-shadow: 0 6px 18px rgba(18, 35, 63, .2); display: none; place-items: center; }
.apg[data-drag="1"] .apg-me { display: grid; }
.apg-me:hover { background: var(--surface-2); }
.apg-pill { position: absolute; top: 16px; left: 16px; right: 16px; z-index: 500; height: 52px; border-radius: 26px; background: var(--surface); box-shadow: 0 6px 18px rgba(18, 35, 63, .16); display: none; align-items: center; gap: 10px; padding: 0 20px; color: var(--muted); font-size: 16px; text-align: left; }
.apg-btn { width: 100%; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 700; background: var(--surface-2); color: var(--fg); transition: transform .1s, box-shadow .15s, background .15s; }
.apg-btn + .apg-btn { margin-top: 10px; }
.apg-btn:hover { background: color-mix(in srgb, var(--surface-2) 85%, var(--fg)); }
.apg-btn.pri { background: var(--blue); color: #fff; box-shadow: 0 10px 22px rgba(0, 74, 173, .28); }
.apg-btn.pri:hover { background: var(--blue-2, var(--blue)); box-shadow: 0 12px 26px rgba(0, 74, 173, .34); }
.apg-btn:active { transform: scale(.98); }
.apg-btn[disabled] { opacity: .45; box-shadow: none; pointer-events: none; }
.apg-link:hover { text-decoration: underline; }
.apg-note { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--red) 8%, transparent); font-size: 13.5px; line-height: 1.45; color: var(--fg); text-align: left; }
.apg-note .i { flex: none; color: var(--red); margin-top: 2px; }
.apg-note b { display: block; margin-bottom: 2px; color: var(--red); }

.apg-panel h2 { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.1; margin: 0 0 18px; }
.apg-input { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); transition: box-shadow .15s, background .15s; }
.apg-input:focus-within { box-shadow: inset 0 0 0 2px var(--blue), 0 0 0 4px var(--blue-soft); background: var(--surface); }
.apg-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 17px; color: var(--fg); }
.apg-list { margin-top: 8px; }
.apg-item { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px; border-radius: 14px; text-align: left; animation: adIn .2s ease-out; }
.apg-item:hover { background: var(--surface-2); }
.apg-ico { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.apg-item:hover .apg-ico { background: var(--surface); }
.apg-item > span:not(.apg-ico) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.apg-item b { font-size: 16px; font-weight: 600; }
.apg-item em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--orange); }
.apg-item small { font-size: 13px; color: var(--muted); }
.apg-item > .i:last-child { color: var(--muted); }
.apg-item.me { margin-top: 10px; }
.apg-item.me .apg-ico { background: var(--blue); color: #fff; }
.apg-item.me b { color: var(--blue); }
.apg-sub { margin: 20px 8px 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.apg-empty { margin: 14px 8px; font-size: 14px; line-height: 1.45; color: var(--muted); }

.apg-card { margin: auto 0; }
.apg-k { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.apg-addr { display: block; margin: 8px 0 8px; font-family: var(--display); font-size: 28px; font-weight: 800; line-height: 1.12; }
.apg-addr-sub { display: block; margin: 0 0 22px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.apg-addr-sub.warn { color: var(--orange); font-weight: 600; }
.apg-link { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 14px auto 0; padding: 6px; color: var(--blue); font-weight: 600; font-size: 15px; }
.apg-num { color: var(--blue); white-space: nowrap; }
.apg-btn .i:last-child:not(:first-child) { margin-left: 2px; }

.apg-later { display: none; height: 40px; padding: 0 14px; border-radius: 20px; font-size: 15px; font-weight: 600; color: #fff; }
.apg-later:hover { background: rgba(255, 255, 255, .14); }
.apg.m-hero .apg-top { position: absolute; top: 0; left: 0; right: 0; background: transparent; box-shadow: none; color: #fff; }
.apg.m-hero .apg-top > b { visibility: hidden; }
.apg.m-hero .apg-back:hover { background: rgba(255, 255, 255, .14); }
.apg.m-hero.s-start .apg-later { display: block; }
.apg.m-hero .apg-body { display: block; }
.apg.m-hero .apg-mapwrap { position: absolute; inset: 0; visibility: visible; }
.apg.m-hero .apg-panel { position: absolute; inset: 0; padding: 76px 24px calc(28px + var(--bot, 0px)); background: transparent; box-shadow: none; color: #fff; border-radius: 0; max-height: none; }
.apg.m-hero .apg-panel::before, .apg.m-hero .apg-panel::after { content: ""; position: absolute; inset: 0; pointer-events: none; transition: opacity 1s ease; }
.apg.m-hero .apg-panel::before { background: linear-gradient(180deg, rgba(0, 46, 112, .9), rgba(0, 74, 173, .8) 45%, rgba(0, 46, 112, .95) 78%, #002b6b); }
.apg.m-hero .apg-panel::after { opacity: 0; background: linear-gradient(180deg, rgba(0, 43, 107, 0) 60%, rgba(0, 43, 107, .88) 80%, #002b6b), radial-gradient(circle at var(--sx, 50%) var(--sy, 35%), rgba(0, 74, 173, 0) 0, rgba(0, 74, 173, .06) 90px, rgba(0, 58, 140, .72) 220px, rgba(0, 46, 112, .94) 420px, #002b6b 640px); }
.apg[data-stage="2"] .apg-panel::before, .apg[data-stage="3"] .apg-panel::before { opacity: 0; }
.apg[data-stage="2"] .apg-panel::after, .apg[data-stage="3"] .apg-panel::after { opacity: 1; }
.apg.m-hero .apg-in { position: relative; z-index: 1; }
.apg.leaving { opacity: 0; transform: scale(1.02); transition: opacity .3s, transform .3s; }

.apg-h2 { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; max-width: 520px; margin: 0 auto; }
.apg-spotbox { flex: 1; min-height: 190px; display: grid; place-items: center; }
.apg-spot { position: relative; width: 168px; height: 168px; display: grid; place-items: center; }
.apg-spot > i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .06); opacity: 0; animation: adPing 3.2s ease-out infinite; }
.apg-spot > i:nth-child(2) { animation-delay: 1.06s; }
.apg-spot > i:nth-child(3) { animation-delay: 2.13s; }
.apg.s-run .apg-spot > i { animation-duration: 1.6s; }
.apg.s-run .apg-spot > i:nth-child(2) { animation-delay: .53s; }
.apg.s-run .apg-spot > i:nth-child(3) { animation-delay: 1.06s; }
.apg-me2, .apg-ok2 { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--blue); box-shadow: 0 12px 30px rgba(0, 20, 60, .35); transition: transform .35s ease, opacity .35s; }
.apg-me2 .i { width: 36px; height: 36px; }
.apg.s-start .apg-me2 { animation: adBob 2.4s ease-in-out infinite; }
.apg-pin2 { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); opacity: 0; pointer-events: none; }
.apg-pin2 .i { width: 64px; height: 64px; color: var(--blue); fill: #fff; filter: drop-shadow(0 8px 10px rgba(0, 20, 60, .4)); }
.apg-pin2::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 16px; height: 6px; margin-left: -8px; border-radius: 50%; background: rgba(0, 0, 0, .3); }
.apg-ok2 { background: var(--green); color: #fff; opacity: 0; transform: scale(.3); }
.apg-ok2 .i { width: 44px; height: 44px; }
.apg[data-stage="2"] .apg-spot > i, .apg[data-stage="3"] .apg-spot > i { border-color: var(--blue); background: rgba(0, 74, 173, .1); }
.apg[data-stage="2"] .apg-me2, .apg[data-stage="3"] .apg-me2 { opacity: 0; transform: scale(.4); }
.apg[data-stage="2"] .apg-pin2 { opacity: 1; animation: adDrop .5s cubic-bezier(.2, 1.5, .4, 1) .9s backwards; }
.apg[data-stage="3"] .apg-spot > i { animation: none; }
.apg[data-stage="3"] .apg-ok2 { opacity: 1; transform: none; animation: adPop .5s cubic-bezier(.2, 1.5, .4, 1); }
.apg.s-denied .apg-me2, .apg.s-error .apg-me2 { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
.apg.s-denied .apg-spot > i, .apg.s-error .apg-spot > i { display: none; }

.apg-hb { width: 100%; display: flex; flex-direction: column; align-items: center; }
.apg-hb h1 { font-family: var(--display); font-weight: 900; font-size: 32px; line-height: 1.1; margin: 0 0 12px; letter-spacing: -.01em; text-wrap: balance; }
.apg-hb h1.long { font-size: 27px; line-height: 1.2; font-weight: 800; margin-bottom: 28px; }
.apg-hb h1.swap { animation: adIn .35s ease-out; }
.apg-hb .apg-num { color: #fff; }
.apg-hs { min-height: 22px; margin: 0 0 22px; font-size: 16px; line-height: 1.45; color: rgba(255, 255, 255, .82); text-wrap: balance; }
.apg-hs:empty { visibility: hidden; }
.apg-btn.wh { background: #fff; color: var(--blue); box-shadow: 0 14px 34px rgba(0, 15, 50, .35); }
.apg-btn.wh:hover { background: #f1f5fc; }
.apg-btn.big { height: 64px; border-radius: 20px; font-size: 18px; }
.apg-btn.big .i { width: 22px; height: 22px; }
.apg-link.wh { color: #fff; margin-top: 16px; }
.apg-hp { margin: 22px 0 0; font-size: 13px; color: rgba(255, 255, 255, .62); }
.apg-prog { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; max-width: 280px; margin-top: 4px; }
.apg-prog i { position: relative; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.apg-prog i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform .5s ease; }
.apg-prog i.on::after { transform: scaleX(.85); transition: transform 2.5s cubic-bezier(.1, .7, .3, 1); }
.apg-prog i.done::after { transform: none; }
.apg[data-stage="3"] .apg-prog i::after { background: #7ee2a8; }

@media (max-width: 860px) {
  .apg-top { height: 56px; padding: 0 8px; }
  .apg-body { display: block; }
  .apg-mapwrap { position: absolute; inset: 0; }
  .apg-panel { position: absolute; inset: 0; padding: 26px 20px calc(22px + var(--bot, 0px)); box-shadow: none; }
  .apg.m-full .apg-mapwrap { visibility: hidden; }
  .apg.m-top .apg-mapwrap { bottom: 50%; }
  .apg.m-top .apg-panel { top: 46%; border-radius: 26px 26px 0 0; box-shadow: 0 -10px 30px rgba(18, 35, 63, .1); padding-top: 26px; }
  .apg.m-card .apg-panel { top: auto; max-height: 70%; border-radius: 26px 26px 0 0; box-shadow: 0 -10px 30px rgba(18, 35, 63, .16); padding-top: 22px; }
  .apg.m-card .apg-me { bottom: auto; top: 76px; }
  .apg-addr { font-size: 24px; }
  .apg-fade { display: none; }
  .apg.m-hero .apg-panel { padding: 64px 20px calc(22px + var(--bot, 0px)); }
  .apg-hb h1 { font-size: 28px; }
  .apg-hb h1.long { font-size: 23px; margin-bottom: 24px; }
  .apg-spotbox { min-height: 170px; }
}

@keyframes adIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes adDrop { from { transform: translate(-50%, -190%); opacity: 0; } }
@keyframes adPing { 0% { transform: scale(.35); opacity: .6; } 100% { transform: scale(1); opacity: 0; } }
@keyframes adBob { 50% { transform: translateY(-4px); } }
@keyframes adPop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .apg *, .apg *::before, .apg *::after { animation: none !important; transition: none !important; } }
