/* Shared control sizing only. No application state, handlers or image assets. */
:root{--ui-touch:52px;--ui-gap:12px;--button-height:52px;--button-primary-height:58px;--button-font:18px}
html body :is(button:not(.gate-diagram),[role="button"],input[type="submit"],input[type="button"],.button,.action,.primary,.secondary,.gold,.text-link,.book-link,.home-link,.saju-guide-link,.saju-room-enter,.home-saju-primary,.member-primary,.nasabu-counsel-link,.reader-back-toc){
 min-height:var(--button-height)!important;min-width:44px!important;max-width:100%!important;box-sizing:border-box!important;
 font-size:var(--button-font)!important;line-height:1.45!important;white-space:normal!important;word-break:keep-all!important;overflow-wrap:anywhere!important;
 touch-action:manipulation;
}
html body :is(button:not(.gate-diagram):not(:has(img)),input[type="submit"],input[type="button"],a.button,a.action,a.primary,a.secondary,a.gold,a.text-link,a.book-link,a.home-link,a.saju-guide-link,a.saju-room-enter,a.home-saju-primary,a.member-primary,a.nasabu-counsel-link,a.reader-back-toc){padding:12px 16px!important}
html body :is(a.button,a.action,a.primary,a.secondary,a.gold,a.text-link,a.book-link,a.home-link,a.saju-guide-link,a.saju-room-enter,a.home-saju-primary,a.member-primary,a.nasabu-counsel-link,a.reader-back-toc){display:inline-flex;align-items:center;justify-content:center;text-align:center;text-decoration:none}
html body :is(.primary,.gold,.member-primary,.home-saju-primary,.saju-room-enter,.participation-submit,[data-claim-submit],button[type="submit"]){min-height:var(--button-primary-height)!important;font-size:19px!important;font-weight:800!important}
html body.premium-dark :is(.primary,.gold,.member-primary,.home-saju-primary,.saju-room-enter,.participation-submit,[data-claim-submit]):not(:disabled):not([aria-disabled="true"]){background:#DCC18A!important;color:#102B3A!important;-webkit-text-fill-color:currentColor!important;border:2px solid #F0DCAA!important}
html body :is(button,.button,.action,.primary,.secondary,.reader-back-toc,summary):focus-visible{outline:3px solid #A96810;outline-offset:3px}
html body.premium-dark :is(button,.button,.action,.primary,.secondary,.reader-back-toc,summary):focus-visible{outline-color:#F0DCAA}
html body summary{min-height:52px!important;box-sizing:border-box!important;font-size:18px!important;line-height:1.45!important;padding-block:12px!important;white-space:normal!important;overflow-wrap:anywhere!important}
html body :is(nav:not(.gate-links),.experience-actions,.participation-actions,.saju-room-front-actions,.nasabu-introduction-actions,.saju-guide-actions,.saju-app-actions,.home-saju-actions,.product-actions,.pair-actions,.pair-buttons,.face-options,.home-face-options,.face-tabs,.story-tabs,.shelf-chips,.example-picker,.reader-controls,.reader-toc-books,.ency-types,.ency-topics,.launch-links,.episode-nav,.comic-controls,.actions){gap:12px!important;min-width:0}
html body :is(nav:not(.gate-links),.experience-actions,.participation-actions,.saju-room-front-actions,.nasabu-introduction-actions,.saju-guide-actions,.saju-app-actions,.home-saju-actions,.product-actions,.pair-actions,.actions){flex-wrap:wrap}
html body :is(header,footer,nav:not(.gate-links),.episode-one-index,.product-actions,.pair-actions,.home-saju-actions,.saju-room-front-actions,.saju-guide-actions,.saju-app-actions,.experience-actions,.launch-links,.room-exits) > a:not(:has(img)):not(.skip):not(.brand):not(.brand-home):not(.neowana-brand):not(.room-home-link){min-height:52px!important;min-width:44px!important;max-width:100%;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;padding:12px 14px!important;font-size:18px!important;line-height:1.45!important;white-space:normal!important;overflow-wrap:anywhere!important;text-align:center}
html body :is(button,.button,.action,.primary,.secondary,summary)[hidden]{display:none!important}
/* Older page-specific ID rules must also inherit the shared dimensions. */
html body :is(#match,#relation-experiences,#quick-start,#saju-application,#simple-participation,#ency-reading) :is(button:not(:has(img)),.button,.primary,.secondary){min-height:var(--button-height)!important;min-width:44px!important;font-size:var(--button-font)!important;line-height:1.45!important;white-space:normal!important;overflow-wrap:anywhere!important;padding:12px 16px!important}
html body :is(#match,#relation-experiences,#quick-start,#saju-application,#simple-participation) :is(.primary,.gold,button[type="submit"]){min-height:var(--button-primary-height)!important;font-size:19px!important}
html body #match :is(.pair-buttons,.pair-actions),html body #relation-experiences .experience-actions{gap:12px!important}
html body main .comic-reader .reader-controls{gap:12px!important}
html body main .comic-reader .reader-controls button,html body main .comic-reader .reader-back-toc{min-height:56px!important;padding:12px 16px!important;font-size:18px!important;line-height:1.45!important}
html body main .comic-reader .reader-picker select{min-height:52px!important;font-size:18px!important}
html body .ency-types,html body .ency-topics{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important}
html body .ency-types button,html body .ency-topics button{padding:12px 8px!important;font-size:18px!important}
html body .ency-types button:last-child{grid-column:auto}
html body :is(.brand-header,.info-header,.ency-header,.neowana-header,.comic-site>header){flex-wrap:wrap;gap:12px!important}
html body .face-trigger{padding:0!important;min-height:52px!important;min-width:52px!important}
/* Change only the lettering area of the baked red button. Its frame, icon,
   arrow and destinations remain intact. Both entrance frames share one height. */
html body .gate-palace .gate-palace-copy{position:absolute;left:30%;right:7.5%;top:12px;bottom:12px;width:auto;height:auto;margin:0;padding:0;clip-path:none;overflow:visible;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;background:linear-gradient(100deg,#570300,#750500 65%,#4e0500);color:#fff1d2;white-space:normal;text-align:center;font-family:serif;text-shadow:0 1px 2px #210000}
html body .gate-palace-copy strong{font-size:clamp(17px,3.6vw,26px);letter-spacing:-.6px;line-height:1.2;font-weight:800;white-space:nowrap}
html body .gate-palace-copy small{font-size:clamp(10px,2.75vw,17px)!important;line-height:1.3!important;white-space:nowrap;color:#ffdfa0!important}
html body .gate-palace-copy em{font-size:clamp(10px,2.45vw,15px);font-style:normal;font-weight:700;line-height:1.2;color:#fff8e8}
@media(min-width:761px){:root{--button-height:56px;--button-primary-height:60px;--button-font:19px}html body summary{min-height:56px!important;font-size:19px!important}}
@media(max-width:480px){
 html body :is(.experience-actions,.product-actions,.saju-app-actions,.saju-guide-actions,.home-saju-actions){display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
 html body :is(.experience-actions,.product-actions,.saju-app-actions,.saju-guide-actions,.home-saju-actions)>:is(a,button){width:100%!important;min-width:0!important}
 html body :is(.ency-types,.ency-topics){grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html body #match .pair-buttons{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html body main .comic-reader .reader-controls{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

html body .gate-enter{min-height:52px}

/* Enlarge the two original gold frames using the original image's entrance
   strip (y=808..949). No bitmap replacement or font reduction. */
html body.official-gateway .gate-links{--gate-button-height:clamp(74px,15.333333vw,92px)}
html body.official-gateway .gate-links::before{content:"";position:absolute;left:0;right:0;top:calc(57.2% - var(--gate-button-height)/2);height:var(--gate-button-height);background-image:url('/assets/hyemyeong-official-gate.png');background-repeat:no-repeat;background-size:100% 1086.956522%;background-position:center 57.938%;pointer-events:none}
html body.official-gateway .gate-enter{top:calc(57.2% - var(--gate-button-height)/2);height:var(--gate-button-height);min-height:74px}
html body.official-gateway .gate-palace-copy>strong,html body.official-gateway .gate-palace-copy>small{flex:none;display:block;margin:0;padding:0}
html body .saju-entry-link{display:inline-flex;align-items:center;justify-content:center;min-height:52px;min-width:44px;box-sizing:border-box;max-width:100%;padding:12px 16px;font-size:18px;line-height:1.45;white-space:normal;overflow-wrap:anywhere;text-align:center}

html body.seowon-site .seowon-saju-entry{margin-top:12px;width:min(100%,260px)}
