/* Stage 2: header scope only. Body tokens and page layouts stay in their existing files. */
html:has(body > #petw-header){container-type:inline-size}
body:has(> #petw-header){margin-block-start:0}
@font-face{font-family:SUIT;src:url('/assets/fonts/SUIT-Variable.woff2') format('woff2');font-weight:100 900;font-display:swap}
#petw-header,#petw-league-row,#site-menu{--paper:#f8f4e9;--header-red:#bc3d38;--header-ink:#183449;--header-muted:#596872;--header-line:#dfc9ba;font-family:SUIT,sans-serif;font-synthesis:none;color:var(--header-ink);font-size:14px;line-height:1.5;letter-spacing:normal}
#petw-header,#petw-header *,#petw-league-row,#petw-league-row *{box-sizing:border-box}
#petw-header{display:block;flex:0 0 auto;position:relative;inset:auto;z-index:30;width:100cqw;max-width:none;margin:0 calc((100% - 100cqw)/2);padding:0;border:0;border-bottom:1px solid var(--header-line);border-radius:0;background:var(--paper);box-shadow:none;transform:none}
#petw-header .petw-header-inner{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:1280px;margin:0 auto;padding:16px}
#petw-header .petw-logo{display:block;position:static;flex:0 0 126px;width:126px;height:94px;padding:0;margin:0;overflow:visible;border:0;background:transparent;line-height:0;transform:none;color:var(--header-ink)}
#petw-header .petw-logo img{display:block;position:static;width:126px;height:94px;min-width:0;max-width:none;padding:0;margin:0;object-fit:contain;object-position:left center;transform:none;filter:none}
#petw-header .petw-controls{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-end;gap:8px;padding:0;margin:0;flex:0 0 auto;width:auto;border:0;background:transparent;font:inherit}
#petw-header :is(select,button){position:static;display:inline-flex;align-items:center;justify-content:center;flex:none;height:44px;min-height:44px;max-height:44px;padding:0 12px;margin:0;border:1px solid var(--header-line);border-radius:12px;background:var(--paper);color:var(--header-ink);font:600 14px/1.5 SUIT,sans-serif;letter-spacing:normal;box-shadow:none;text-decoration:none;cursor:pointer;transform:none}
#petw-header #site-language{display:block;width:102px;min-width:102px;max-width:102px;padding:0 24px 0 10px;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23183449' stroke-width='1.8'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 4px center}
#petw-header .account-chip{display:flex!important;width:132px;min-width:132px;max-width:132px;border-radius:999px;gap:6px;overflow:hidden}
#petw-header .account-chip>*{display:none!important}
#petw-header .account-chip>.account-entry-label{display:block!important;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:inherit;color:inherit;letter-spacing:normal}
#petw-header .account-chip::before{content:'';display:block;flex:0 0 22px;width:22px;height:22px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23183449' stroke-width='1.8'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21v-2a8 8 0 0 1 16 0v2'/%3E%3C/svg%3E") center/22px no-repeat}
#petw-header .account-chip:disabled{opacity:1;color:var(--header-muted);cursor:wait}
#petw-header .petw-menu{width:44px;min-width:44px;padding:0;background:var(--header-red);border-color:var(--header-red);color:var(--paper)}
#petw-header svg{width:22px;height:22px;min-width:22px;margin:0;padding:0}
#petw-header :is(a,button,select):focus-visible,#petw-league-row a:focus-visible{outline:2px solid var(--header-red);outline-offset:3px}
#petw-league-row{display:block;flex:0 0 auto;position:sticky;top:0;z-index:29;width:100cqw;max-width:none;height:60px;padding:0;margin:0 calc((100% - 100cqw)/2);background:var(--paper);border:0;border-bottom:1px solid var(--header-line);box-shadow:none}
#petw-league-row .petw-league-inner{display:flex;align-items:center;justify-content:space-between;gap:8px;max-width:1280px;height:60px;margin:0 auto;padding:8px 16px}
#petw-league-row .league-entry{display:flex;align-items:center;justify-content:center;flex:none;width:150px;height:44px;min-height:44px;margin:0;padding:0 12px;border:1px solid var(--header-red);border-radius:12px;background:var(--paper)!important;color:var(--header-red)!important;font:600 14px/1.5 SUIT,sans-serif;letter-spacing:normal;text-decoration:none;white-space:nowrap;box-shadow:none}
#petw-league-row [data-header-balance]{min-width:0;overflow:hidden}
#petw-league-row .point-balance-wrap{position:static;margin:0;padding:0;max-width:100%}
#petw-league-row .point-balance-link{display:block;max-width:100%;height:44px;padding:11px 0;margin:0;border:0;border-radius:0;color:var(--header-ink)!important;background:none;font:600 14px/22px SUIT,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#petw-league-row [hidden]{display:none!important}
#site-menu{box-sizing:border-box;width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:24px;border:1px solid var(--header-line);border-radius:12px;background:var(--paper);overflow:auto}
#site-menu .simple-dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
#site-menu h2{margin:0;font:600 20px/1.5 SUIT,sans-serif;color:var(--header-ink)}
#site-menu :is(a,button,summary){font:500 14px/1.5 SUIT,sans-serif;color:var(--header-ink)}
#site-menu [data-close-dialog]{width:44px;height:44px;border:1px solid var(--header-line);border-radius:12px;background:var(--paper);font-size:24px}
#site-menu :is(.simple-menu-links,.menu-secondary){display:grid;grid-template-columns:1fr;gap:8px;padding:0;margin:8px 0}
#site-menu :is(.simple-menu-links,.menu-secondary)>:is(a,button){display:block;padding:10px 12px;min-height:44px;margin:0;border:1px solid var(--header-line);border-radius:12px;background:var(--paper);text-decoration:none;text-align:left}
#site-menu [hidden]{display:none!important}
html[lang=ko] #site-menu .en,html:not([lang=ko]) #site-menu .ko{display:none}
@media(max-width:700px){#petw-header .petw-header-inner{display:grid;grid-template-columns:1fr;gap:12px;padding:16px}#petw-header .petw-logo{width:100px;height:74px;flex-basis:100px}#petw-header .petw-logo img{width:100px;height:74px}#petw-header .petw-controls{justify-self:end}}
@media(max-width:340px){#petw-header .account-chip{width:126px;min-width:126px;max-width:126px}}


/* Shared signature row replaces the former league-only row at the same height. */
#petw-league-row .petw-signature-inner{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-width:1280px;height:60px;margin:auto;padding:8px 16px}
#petw-league-row [data-signature]{display:flex;align-items:center;justify-content:center;width:auto;min-width:0;height:44px;margin:0;padding:0 6px;border:1px solid var(--header-red);border-radius:12px;background:var(--paper)!important;color:var(--header-red)!important;font:600 14px/1.2 SUIT,sans-serif;text-decoration:none;white-space:nowrap}
#petw-league-row [data-signature][aria-current=page]{background:var(--header-red)!important;color:var(--paper)!important}
#petw-header [data-header-balance]:empty,#petw-header [data-header-balance]:has(>.point-balance-wrap[hidden]){display:none}
#petw-header .point-balance-wrap{margin:0;padding:0}
#petw-header .point-balance-link{height:44px;min-height:44px;max-width:110px;margin:0;padding:10px 8px;line-height:22px}
@media(max-width:700px){#petw-header .petw-controls{gap:6px;max-width:100%}#petw-header #site-language{width:76px;min-width:76px;max-width:76px;font-size:12px;padding-left:6px}#petw-header .account-chip{width:110px;min-width:0;max-width:110px;padding:0 8px}#petw-header .point-balance-link{max-width:80px;padding:10px 5px;font-size:12px}#petw-league-row [data-signature]{font-size:12px;padding:0 2px}#petw-league-row .petw-signature-inner{gap:6px}}
@media(max-width:360px){#petw-header #site-language{width:66px;min-width:66px;max-width:66px}#petw-header .account-chip{width:86px;max-width:86px}#petw-header .point-balance-link{max-width:70px;font-size:11px}#petw-header .petw-controls{gap:4px}#petw-league-row [data-signature]{font-size:10px}}

/* Shared mobile destinations; reserve safe area so the last action stays reachable. */
#petw-bottom-nav{display:none}
@media(min-width:701px){#petw-league-row .petw-signature-inner{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:700px){
 #petw-league-row [data-signature=market]{display:none}
 #petw-league-row [data-signature]{white-space:normal;overflow-wrap:anywhere;text-align:center}
 body.petw-has-bottom-nav{padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))!important}
 html:has(.petw-has-bottom-nav){scroll-padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))}
 #petw-bottom-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;z-index:80;inset:auto 0 0;width:100%;box-sizing:border-box;padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px));border-top:1px solid #dfc9ba;background:#fffdf8;box-shadow:0 -4px 18px #1834490a;font:600 12px/1.4 SUIT,sans-serif}
 #petw-bottom-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:52px;margin:0;padding:2px;border:0;background:none;color:#183449;text-decoration:none}
 #petw-bottom-nav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
 #petw-bottom-nav a[aria-current=page]{color:#bc3d38}
 #petw-bottom-nav a:focus-visible{outline:2px solid #bc3d38;outline-offset:-2px;border-radius:8px}
}

@media(max-width:700px){
 /* The league owns a fixed filter dock; stack it above the shared destinations. */
 body.league-page.petw-has-bottom-nav{padding-bottom:calc(176px + env(safe-area-inset-bottom,0px))!important}
 body.petw-has-bottom-nav .league-dock{bottom:calc(65px + env(safe-area-inset-bottom,0px));padding-bottom:8px}
 body.petw-has-bottom-nav>.entrance{padding-top:12px;padding-bottom:12px}
 body.petw-has-bottom-nav .entrance .intro{padding-top:8px;padding-bottom:10px}
 body.petw-has-bottom-nav .entrance .door{min-height:112px}
}
@media(max-width:700px){
 /* Shared destinations and the header menu replace the duplicated interior link row. */
 body.petw-has-bottom-nav>.petw-common-nav{display:none}
}
