*{box-sizing:border-box}body{margin:0;overflow:hidden;background:#a2d1c6;color:#374d43;font:17px 'Malgun Gothic',sans-serif}button{font:inherit;font-weight:700;cursor:pointer;min-height:48px;padding:10px 17px;background:#fff9e9;border:1px solid #a5ae92;border-radius:16px;color:#39574b;box-shadow:0 3px 0 #566d4930}button:hover{background:#fff2c8}button:focus-visible{outline:4px solid #e7ab3b;outline-offset:3px}button.primary{background:#456b58;color:#fff9e9;border-color:#456b58}button:disabled{opacity:.55;cursor:default}#world{position:fixed;width:100%;height:100%;touch-action:none}header{position:absolute;inset:20px 24px auto;display:flex;justify-content:space-between;align-items:start;gap:16px;pointer-events:none}.brand,nav{pointer-events:auto}.brand{padding:15px 24px;background:#fff9e9ed;border:2px solid #e6d9b4;border-radius:6px 24px 24px;box-shadow:0 6px 18px #213f2520}.brand small{display:block;font-size:12px;letter-spacing:2px;margin-bottom:6px}.brand b{font-size:22px}nav{display:flex;gap:10px}#task{position:absolute;left:24px;bottom:54px;width:min(420px,calc(100% - 48px));background:#fff9eeed;padding:22px 25px;border-radius:24px;border:2px solid #e2d6b4;box-shadow:0 8px 30px #17352c25}#eyebrow{color:#7a8064;font-size:13px;letter-spacing:1px}h1{font-size:24px;margin:10px 0}p{line-height:1.7;margin:12px 0}#actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}#hint{font-size:15px}footer{position:absolute;bottom:12px;left:24px;right:24px;display:flex;justify-content:space-between;gap:20px;font-size:12px;text-shadow:0 1px #fff;background:#fff9e8b0;padding:7px 12px;border-radius:10px}.pin{position:absolute;transform:translate(-50%,-100%);border:2px solid #fff8da;background:#466a57;color:#fff;white-space:nowrap;box-shadow:0 4px 12px #223e3350;min-height:48px}.pin:after{content:'';position:absolute;left:calc(50% - 7px);bottom:-10px;border:7px solid transparent;border-top-color:#466a57;border-bottom:0}dialog{border:2px solid #c6bc98;border-radius:24px;background:#fff9ee;color:#374d43;width:min(640px,92vw);max-height:85vh;padding:30px;box-shadow:0 20px 80px #24403560}dialog::backdrop{background:#1d3a3555}#close{float:right;min-width:48px;font-size:24px}dialog h2{font-size:24px;margin:8px 48px 18px 0}.row{padding:14px 0;border-bottom:1px solid #ded5b9}.row small{display:block;color:#78816b;margin:6px 0}.row button{margin:5px 6px 0 0}.reply{background:#f0ecd9;border-radius:14px;padding:16px}.sr{position:absolute;clip:rect(0,0,0,0)}[hidden]{display:none!important}#packing{position:fixed;inset:0;background:#435d49;z-index:20}iframe{width:100%;height:100%;border:0}.voyage{pointer-events:none} @media(max-width:700px){header{inset:12px}.brand{padding:10px 14px}.brand b{font-size:17px}.brand small{font-size:10px}nav{gap:5px}nav button{font-size:13px;padding:8px}#task{left:12px;bottom:60px;width:calc(100% - 24px);padding:16px}footer{left:12px;right:12px}footer span:last-child{display:none}h1{font-size:21px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

#movement{position:absolute;right:24px;bottom:65px;display:grid;grid-template-columns:repeat(3,56px);gap:7px;touch-action:none;user-select:none}#movement button{height:56px;font-size:26px;padding:0;touch-action:none;background:#fff9e9ee}#movement button:first-child{grid-column:2}#movement button:nth-child(2){grid-column:1}.pin{background:#775b28;border-color:#ffe49a}.pin:after{border-top-color:#775b28}@media(max-width:700px){#movement{bottom:290px;right:12px}#task{padding:12px}#hint{margin:6px 0;font-size:13px}#actions{margin-top:8px}h1{font-size:18px;margin:6px 0}}

#task{width:340px;padding:16px 20px}h1{font-size:21px}#hint{font-size:14px;margin:8px 0}#routeMap{position:absolute;right:24px;top:86px;width:210px;border-radius:16px;background:#fff9e9ed;overflow:hidden;box-shadow:0 4px 16px #28452d25;font-size:12px}#routeMap summary{padding:9px;cursor:pointer;min-height:40px}#mini{display:block;width:210px;height:135px}.offscreen{border-style:dashed}.offscreen:before{content:'↗ ';color:#ffe49a}@media(max-width:700px){#routeMap{top:80px;right:12px;width:155px}#mini{width:155px;height:100px}#task{width:calc(100% - 24px)}nav{flex-wrap:wrap;justify-content:end;max-width:170px}.brand small{display:none}#movement{bottom:275px}}

#movement{grid-template-columns:repeat(3,52px);gap:4px}#movement button{height:52px;min-height:52px}#movement button:first-child,#movement button:nth-child(2){grid-column:auto}#movement span{display:grid;place-items:center;color:#3d6154;background:#fff9e9b0;border-radius:50%;font-size:12px}.offscreen:before{content:"➜";display:inline-block;transform:rotate(var(--direction,0deg));margin-right:6px}.delivery-letter{border:2px dashed #bda271;background:#f8f0d9;border-radius:18px;padding:14px 20px;margin:14px 0}.delivery-letter b{display:block;font-size:28px;color:#577864}.delivery-letter small{display:block;margin-top:7px}
.pin.ready{background:#3c7759;border-color:#c8edb2;box-shadow:0 0 0 5px #ceecb944,0 4px 12px #223e3350}.pin.ready:after{border-top-color:#3c7759}.pin.ready:before{content:"✓ ";color:#e7ffc9}
#movement{display:flex;flex-direction:column;align-items:center;gap:8px}#movement #stick{width:140px;height:140px;border-radius:50%;background:#fff9e8aa;border:3px solid #e9dfc0;position:relative;touch-action:none;padding:0}#movement #stickKnob{position:absolute;left:42px;top:42px;width:50px;height:50px;background:#537d66;color:#fff;font-size:14px;box-shadow:0 4px 12px #25473544;pointer-events:none}#movement small{font-size:12px;background:#fff9e8dd;border-radius:12px;padding:5px 9px}#dialogBody>button{margin:5px}#routeMap{top:86px}@media(max-width:700px){#movement{bottom:285px}}

.story-art{display:flex;justify-content:center;align-items:end;gap:30px;height:190px;background:#e8eddb;border-radius:28px}.story-art img{width:170px;height:190px;object-fit:contain}
#task{background:#fff9e8e8;width:310px;padding:14px 18px;border-radius:8px 24px 24px}#task h1{font-size:19px}#eyebrow{font-size:11px}#hint{font-size:13px;line-height:1.6}#actions{margin-top:8px}.brand{padding:10px 17px}.brand b{font-size:18px}.brand small{letter-spacing:1px;font-size:10px}.pin{font-size:14px;padding:8px 14px;min-height:42px;background:#667b51;border-color:#eee4bf}.pin:after{border-top-color:#667b51}
@media(max-width:700px){#task{width:calc(100% - 24px)}.story-art{height:145px}.story-art img{height:145px;width:125px}}
.pin{display:flex;align-items:center;gap:9px;padding:8px 13px 8px 8px;min-height:52px;background:#fff9e9f5;color:#3e5d49;border:1px solid #c9d3b3;border-radius:28px;box-shadow:0 4px 0 #58735328,0 7px 20px #29473420;text-align:left}
.pin-seal{display:grid;place-items:center;flex:none;width:32px;height:32px;border-radius:50%;background:#e6edd6;color:#55744c;font-size:17px;border:1px solid #c5d3b2}
.pin-label{font-size:14px;line-height:1.35}.pin-label small{display:block;font-size:10px;font-weight:400;color:#687760;margin-top:2px}
.pin:after{bottom:-7px;border-top-color:#fff9e9;left:calc(50% - 6px);border-width:6px;border-bottom:0}
.pin.ready{background:#fff9e9;border-color:#8fa97d;box-shadow:0 0 0 3px #e7eed078,0 5px 12px #29473425}.pin.ready:after{border-top-color:#fff9e9}.pin.ready:before{content:none}.pin.ready .pin-seal{background:#58794e;color:#fff9e9;border-color:#58794e}
.pin.offscreen{border-style:solid}.pin.offscreen:before{font-size:15px;color:#6b8458;margin:0 0 0 3px}
@media(pointer:coarse){#hint{font-size:16px}#eyebrow{font-size:13px}.pin-label{font-size:16px}.pin-label small{font-size:12px}#routeMap summary{font-size:14px;min-height:48px}#movement small{font-size:14px}}

/* Storybook task slip: the sender stays recognisable while walking. */
.task-resident{float:right;width:58px;height:64px;object-fit:contain;margin:-5px -5px 0 9px}#task{border-top:5px solid #9db28a}#dialogBody>button{min-height:48px}#dialogBody p{word-break:keep-all;overflow-wrap:anywhere}@media(max-width:800px){#dialogBody>button{display:block;width:100%;margin:8px 0}}

#dialogBody .book-gift{float:left;width:64px;height:64px;object-fit:contain;margin:0 14px 6px 0}#dialogBody .row{display:flow-root}.delivery-letter img{width:80px;height:72px;object-fit:contain}dialog #close{position:sticky;top:0;z-index:2;background:#fff9ee}#task #eyebrow{display:block;line-height:1.5;letter-spacing:0}#task p{word-break:keep-all;overflow-wrap:anywhere}.pin-label small{word-break:keep-all}

button:active{box-shadow:0 1px 0 #566d4930}#dialogBody>button.primary{border-bottom:3px solid #254e38}.pin.ready .pin-seal{outline:2px solid #e9d693;outline-offset:3px}#routeMap summary:focus-visible{outline:3px solid #bb8331;outline-offset:-3px}#dialogBody .reply{border-left:4px solid #9baf82;background:repeating-linear-gradient(transparent 0 29px,#b9b29226 29px 30px),#f6f0dc;color:#3b513e}@media(prefers-reduced-motion:no-preference){.delivery-letter{animation:letter-unfold .28s ease-out}@keyframes letter-unfold{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}}

#journeyPhase{display:flex;gap:5px;list-style:none;padding:0;margin:9px 0;color:#737960;font-size:13px}#journeyPhase li{padding:3px 8px;border-radius:10px}#journeyPhase [aria-current]{background:#e2ebd0;color:#355d3f;font-weight:bold}#mapDestination{margin:0;padding:6px 10px 9px;font-size:13px;line-height:1.4;color:#3e5c48;border-top:1px dashed #c4cdb1}

#journeyPhase li+li:before{content:"›";margin-left:-6px;margin-right:6px;color:#9a9f82}#journeyPhase [aria-current]{box-shadow:inset 0 -2px #8da57c}#mapDestination{background:#f6f3df}button:focus-visible{outline:3px solid #9a682b;outline-offset:3px}

/* A neighbour's request reads as a parcel letter, with its reason kept apart. */
.story-art{height:auto;min-height:160px;flex-wrap:wrap;gap:8px 24px;padding:16px;background:radial-gradient(ellipse at center,#f9f4dd,#e5ebd6);border:1px solid #cad3b5;box-shadow:inset 0 0 0 6px #f7f6e5}.story-art img{height:140px;width:130px}.request-address{flex-basis:100%;padding:10px 14px;background:#fffaf0;border-left:5px solid #8ba58a;border-radius:5px;line-height:1.6}.request-address strong,.request-address span{display:block;font-size:16px}.request-address span{color:#67725c}.request-why{border-top:1px dashed #b7bc9c;padding-top:14px;color:#42624b}#dialogBody>.request-why:before{content:'함께 할 포장';display:block;font-size:13px;font-weight:700;color:#77825f;margin-bottom:4px}

#fieldPad{position:fixed;z-index:5;width:96px;height:96px;margin:-48px 0 0 -48px;border:2px solid #f8ecc8aa;border-radius:50%;background:#fdf8e528;pointer-events:none}#fieldPad span{position:absolute;left:31px;top:31px;width:30px;height:30px;background:#f6f3dfbb;border:2px solid #607e67;border-radius:50%;box-shadow:0 2px 4px #36554325}

/* Keep the left thumb on walking; task actions stay on the opposite side. */
#movement{left:max(24px,env(safe-area-inset-left));right:auto;bottom:max(65px,calc(env(safe-area-inset-bottom) + 48px))}
#task{left:auto;right:24px;width:min(310px,calc(100vw - 210px))}
@media(max-width:700px){#movement{left:max(12px,env(safe-area-inset-left));bottom:60px}#task{left:auto;right:12px;bottom:60px;width:calc(100vw - 184px);max-height:55vh;overflow:auto}#journeyPhase{flex-wrap:wrap}#task .task-resident{width:42px;height:48px}#actions button{width:100%;padding:10px}}

.delivery-letter .reply-from{display:block;font-size:16px;color:#416249;line-height:1.6;margin-bottom:8px;word-break:keep-all}.delivery-letter small{font-size:15px;line-height:1.6}#dialogBody .row b{line-height:1.5;word-break:keep-all}#dialogBody .row small{line-height:1.5}

/* Keep the reply and its next action separate from the inactive walking UI. */
body:has(dialog[open]) #task,body:has(dialog[open]) #markers,body:has(dialog[open]) #movement{visibility:hidden}
.delivery-letter{display:grid;grid-template-columns:104px 1fr;gap:8px 16px;background:repeating-linear-gradient(135deg,#8fa78b 0 8px,#fff8e6 8px 16px,#d2b189 16px 24px,#fff8e6 24px 32px) left/6px 100% no-repeat,#f8f1dc;border:1px solid #c8b990;border-radius:12px;padding:18px 20px}
.delivery-letter b{grid-column:1;grid-row:1/3;align-self:center}.delivery-letter img{display:block;width:104px;height:96px}.delivery-letter .reply-from,.delivery-letter small{grid-column:2;margin:0}.delivery-letter+p{padding:12px 0;border-bottom:1px dashed #b8b99b}

/* A quiet postmark and paper edge give the existing reply a postcard finish. */
.delivery-letter b{position:relative;padding:7px;border:1px dashed #b8ad87;border-radius:8px;background:#fffbed}
.delivery-letter b:after{content:'독도에서';display:block;text-align:center;font-size:12px;line-height:1.5;color:#6e795b;letter-spacing:1px}
.delivery-letter+p{background:repeating-linear-gradient(transparent 0 31px,#bdb69033 31px 32px);line-height:2;padding:12px 8px}
@media(pointer:coarse){footer span:last-child{display:none}footer{right:auto;background:#fff9e8dc}}

#dialogBody .row{border-bottom:1px dashed #c8bea0}#dialogBody .row small{color:#4e6555;line-height:1.6}#dialogBody .row .reply{font-size:17px;line-height:1.75}

#eyebrow>span{display:inline-block;white-space:nowrap}

#task h1{word-break:keep-all;overflow-wrap:anywhere}
/* Letter-paper HUD: one nearby action, quiet navigation. */
.brand{background:#fffbeeef;border:1px solid #d4c8a4;border-radius:22px 22px 22px 7px;padding:12px 18px;box-shadow:0 4px 0 #71826930}.brand small{display:none}.brand b{font-size:18px;letter-spacing:-.5px}
nav button{border:1px solid #d4c8a4;border-radius:18px;min-height:48px;background:#fffbeeef;box-shadow:0 3px 0 #71826930}
#routeMap{width:154px;border:1px solid #d4c8a4;border-radius:18px;background:#fffbeef2}#routeMap summary{min-height:48px;padding:12px 17px;font-size:16px;font-weight:700}#routeMap[open]{width:210px}
#task{background:#fffbedf5;border:1px solid #d2c4a0;border-radius:26px 26px 8px 26px;padding:17px 20px;box-shadow:0 5px 0 #71826930}#task h1{font-size:20px;line-height:1.4;margin:0 48px 6px 0}#task #hint{font-size:16px;line-height:1.5;margin:6px 0}#task #eyebrow,#journeyPhase{display:none}#task .task-resident{width:50px;height:58px}#actions button{min-height:50px;font-size:16px;border-radius:17px}#actions button.primary{background:#52745a;border-color:#45674c;box-shadow:0 3px 0 #35553c}
.pin{min-height:56px;padding:9px 17px 9px 10px;border-radius:20px 20px 20px 6px;background:#fffbee;border:1px solid #c4b68e}.pin-label{font-size:16px;font-weight:800}.pin-label small{font-size:13px;line-height:1.4;margin-top:3px;color:#56674c}.pin-seal{width:35px;height:35px;border-radius:12px;background:#e5edd7;font-size:22px}.pin.ready .pin-seal{outline:0;background:#e5edd7;color:#54734c;border-color:#b5c7a0}.pin.ready{box-shadow:0 4px 0 #58735333;border-color:#9aaf86}
#movement #stick{background:radial-gradient(circle,#dce7c55c 0 48%,#fff9e84d 49% 65%,#f7f3dca6 66%);border:2px solid #f5f0d3;box-shadow:inset 0 0 0 6px #667d4c25,0 4px 14px #314e3026}#movement #stick:before{content:'◆';position:absolute;top:7px;left:62px;font-size:10px;color:#6c8153}#movement #stickKnob{background:radial-gradient(circle at 35% 28%,#a6bf86,#628252);color:#f9f6d8;border:2px solid #f6edc9;font-size:25px;box-shadow:0 4px 0 #425f3a66,0 7px 13px #3c573344}#movement small{background:#fffbeedb;color:#4d654a;font-size:13px;padding:5px 11px}
#dialogBody>p{font-size:20px;line-height:1.6;word-break:keep-all}.request-address strong{font-size:16px}.request-address span{display:none}.request-why{font-size:16px}.request-why:before{display:none!important}.request-why summary{min-height:48px;padding:12px 0;cursor:pointer}.request-why p{font-size:16px}#dialogBody>button.primary{min-height:52px;padding-inline:24px}
@media(max-width:700px){.brand b{font-size:15px}.brand{padding:10px 12px}#task h1{font-size:18px}#task #hint{font-size:15px}.pin-label{font-size:15px}#routeMap{top:76px}}
/* Postal menu: actions grouped like pages of a small village notebook. */
dialog.post-menu{width:min(720px,94vw);padding:24px;background:#fffbed}
.post-menu h2{margin-bottom:6px;font-size:28px}.post-menu #dialogBody>p{font-size:16px;margin:0 48px 18px 0;color:#52664a}
.post-menu .menu-section{margin-top:16px}.post-menu h3{font-size:16px;margin:0 0 8px;color:#4b6546}
.post-menu .menu-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.post-menu .menu-grid button{margin:0;min-height:52px;line-height:1.4;word-break:keep-all}
.post-menu .menu-help{margin-top:16px}.post-menu summary{cursor:pointer;min-height:48px;padding:12px 0;font-weight:700}
.post-menu .menu-help p{font-size:16px}
/* Pass 2: restart is a visible invitation, not another camera control. */
.post-menu .menu-records{padding:18px;background:#f7e9bc;border:1px solid #d8bb73;border-radius:20px;box-shadow:inset 0 0 0 4px #fff7de}
.post-menu .menu-records h3{color:#624b25;font-size:18px}.post-menu .menu-records p{font-size:16px;line-height:1.5;margin:4px 0 12px;color:#624b25}
.post-menu .menu-records button:first-child{background:#e6b94f;border:1px solid #99712b;border-bottom:4px solid #99712b;color:#3c321e;font-size:20px;font-weight:800}
.post-menu .menu-records button:first-child:before{content:'↻';margin-right:10px;font-size:24px}
.post-menu .menu-records button:last-child{background:#fff9e8;color:#604e2f;border-color:#c9b27b}
/* Pass 3: secondary controls unfold only when needed. */
.post-menu details.menu-section,.post-menu .menu-help{border-top:1px solid #d8ddc8;margin-top:10px}
.post-menu details summary{font-size:17px;color:#3b5942;padding:13px 4px;line-height:1.4}
.post-menu details[open] .menu-grid{padding:2px 0 12px}
.post-menu .menu-help ul{margin:0 0 12px;padding-left:24px;font-size:16px;line-height:1.7;color:#425b43}
.post-menu .menu-help li+li{margin-top:6px}
/* Pass 4: keep restart readable at phone and tablet widths. */
dialog.post-menu{max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#9caf8c #fffbed}
.post-menu .menu-grid button{min-width:0}.post-menu summary{min-height:52px}
@media(max-width:480px){dialog.post-menu{padding:18px;width:calc(100vw - 24px)}.post-menu h2{font-size:25px}.post-menu .menu-records{padding:14px}.post-menu .menu-records .menu-grid{grid-template-columns:1fr}.post-menu .menu-records button:first-child{min-height:58px;font-size:20px}.post-menu .menu-records button:last-child{min-height:48px}.post-menu .menu-grid{gap:8px}.post-menu .menu-grid button{padding:10px 8px;font-size:16px}.post-menu #dialogBody>p{margin-right:0}.post-menu .menu-section{margin-top:12px}}
/* Pass 5: paper, leaf green and a single warm restart accent. */
dialog.post-menu{border:1px solid #c4b996;border-radius:28px;box-shadow:0 12px 0 #294b2d18,0 24px 70px #173c384d}
.post-menu h2:before{content:'✉';display:inline-grid;place-items:center;width:36px;height:36px;margin-right:10px;border:1px dashed #99ad83;border-radius:11px;background:#e9efdb;font-size:22px;vertical-align:middle;color:#4a6c49}
.post-menu .menu-grid button{transition:background-color .12s,border-color .12s}
.post-menu .menu-grid button:hover{border-color:#71895c;background:#eef1df}.post-menu .menu-grid button.primary:hover{background:#355d47}
.post-menu .menu-records button:first-child:hover{background:#f0c866;border-color:#805b20}
.post-menu summary:hover{color:#274d34;background:#eef1df;border-radius:10px}
.post-menu summary:focus-visible,.post-menu button:focus-visible{outline:3px solid #805b20;outline-offset:3px}
.post-menu details[open]>summary{color:#294e37}.post-menu details[open]{padding-bottom:4px}
@media(prefers-reduced-motion:reduce){.post-menu .menu-grid button{transition:none}}

.graphics-recovery{position:fixed;z-index:2000;inset:40% 10% auto;padding:24px;background:#fff9e9;color:#345e4c;border-radius:24px;text-align:center;font-weight:700;pointer-events:none}.graphics-recovery[hidden]{display:none}
