/* Readable community typography and themed, independent content scrolling. */
:root{--muted:#adb5c2;--scroll-thumb:#596475;--scroll-hover:#7a879a;--scroll-track:#20252d}
body.light{--text:#202936;--muted:#596577;--scroll-thumb:#a6b1bf;--scroll-hover:#7b899b;--scroll-track:#edf0f4}
body{font-family:"Malgun Gothic","맑은 고딕",Arial,sans-serif;font-size:14px;line-height:1.6;letter-spacing:0;-webkit-font-smoothing:antialiased}
input,textarea,select{color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}
nav a{font-size:14px}.header-actions .primary{font-size:12px}.ticker{font-size:12px}.ticker small{font-size:11px}
h2,.panel-heading h2,.board-head h3,.community-title h2{font-size:15px}.panel-heading p,.panel-heading .muted{font-size:12px}
.chat-tabs button{font-size:13px}.message{font-size:13px;line-height:1.85}.chat-name,.message-text{font-size:13px}.chat-name{font-weight:700}.chat-note{font-size:11px;line-height:1.65}.chat-bottom small,#identity,#identity button{font-size:11px}#chat-input{font-size:13px}.hu-chat-tools button,#hu-challenge{font-size:12px}
.account-user strong{font-size:15px}.account-user .account-tier{font-size:13px}.account-stats span,.account-links,.account-links a,.account-links button,.account-points{font-size:12px}.account-links>span{font-size:11px}.login-fields input{font-size:13px}.account-panel form>.primary{font-size:13px}
.platforms button,.market .platforms button{font-size:13px}.market .chart-toolbar .muted{font-size:12px}.market .intervals button{font-size:12px}.market .ohlc{font-size:11px;line-height:1.5;height:auto;min-height:17px}.market .chart-footer,.market .chart-footer a{font-size:11px}.evidence h3{font-size:13px}.evidence-title span,.market .source small,.source small,.source label{font-size:11px}.market .source p,.source p{font-size:12px;line-height:1.8}.evidence>p{font-size:11px}
.post-row{font-size:13px;padding:12px 14px}.post-row time{font-size:11px}.board-head button,.community-title span,.community-title button{font-size:12px}.board-list-row{font-size:14px}.board-list-row>small,.post-meta{font-size:12px}.post-body{font-size:15px;line-height:1.9}.board-list-head,.board-nav{font-size:13px}
.right-sidebar .scam-row strong,.scam-row strong{font-size:13px;line-height:1.7}.right-sidebar .scam-row p,.scam-row p,.scam-row small{font-size:11px;line-height:1.7}.scam-pagination,.scam-pagination button,#scam-search input{font-size:12px}.scam-panel .panel-heading{padding:14px 12px}
.pf-heading h2{font-size:14px}.pf-scenario label,.pf-subtitle,.pf-subtitle span,.pf-label,.pf-explainer{font-size:11px}.pf-scenario select,.pf-positions button,.pf-stacks button{font-size:12px}.pf-summary span{font-size:12px}.pf-summary small{font-size:11px}.pf-hand{font-size:10px}
.live-now,.live-list button,.live-footnote,.live-panel .live-footnote{font-size:11px}.live-empty p{font-size:13px}footer,footer small{font-size:11px}
:where(.content,#messages,#evidence-list,.left-column,.right-sidebar,.wallet-history,dialog,textarea){scrollbar-width:thin;scrollbar-color:var(--scroll-thumb) var(--scroll-track);overscroll-behavior-y:contain}
::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--scroll-track);border-radius:8px}::-webkit-scrollbar-thumb{background:var(--scroll-thumb);border:2px solid var(--scroll-track);border-radius:8px}::-webkit-scrollbar-thumb:hover{background:var(--scroll-hover)}::-webkit-scrollbar-corner{background:transparent}
@media(min-width:1101px){
 .content{display:flex;flex-direction:column;align-items:stretch;max-height:calc(100dvh - 126px);overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;padding-right:8px;align-content:start;min-height:0}
 .content>*{min-width:0;flex-shrink:0;width:100%}.content>.ad-main{order:0}.content>.market{order:1}.content>.live-panel{order:2}.content>.community-title{order:3}.content>#board-grid{order:4}.content>footer{order:5}.board-screen #board-page{order:1}
 .left-column{max-height:calc(100dvh - 126px)}.left-column>.account-panel,.left-column>.ad-wing{flex-shrink:0}.left-column .chat{height:640px;flex:1 1 640px;min-height:300px}
}
@media(max-width:1100px){.content{max-height:none;overflow:visible;padding-right:0}.market .source p{font-size:12px}}
@media(max-width:760px){body{font-size:14px}.post-row time{font-size:11px}.market .ohlc{font-size:10px}.account-panel form>.primary{font-size:13px}.hu-chat-tools button{font-size:12px}}

/* The expanded solver overlays the content without resizing its sidebar slot. */
html{scrollbar-gutter:stable}
.pf-slot{position:relative;min-width:0;width:100%}
.pf-slot>.pf-panel{width:100%;box-sizing:border-box}
.pf-slot>.pf-panel.pf-expanded{position:absolute;top:0;right:0;width:min(590px,calc(100vw - 32px));max-height:var(--pf-available-height,calc(100dvh - 32px));overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;justify-self:auto;box-shadow:0 8px 28px #0003;z-index:75}
.pf-slot .pf-expanded .pf-grid{flex-shrink:0}
@media(max-width:760px){.pf-slot>.pf-panel.pf-expanded{position:fixed;top:12px;right:12px;width:calc(100% - 24px);max-height:calc(100dvh - 24px);z-index:90}}

/* Shared lower edge for the three desktop columns; footer follows the entire grid. */
.site-footer{width:calc(100% - 32px);max-width:1728px;margin:0 auto;padding:20px 0 24px;border-top:1px solid var(--line);display:flex;align-items:center;gap:20px;flex-wrap:wrap;min-height:72px;font-size:12px}
.site-footer .brand{font-size:16px;gap:0}.site-footer small{margin-left:auto;font-size:11px}.site-footer>a:not(.brand){color:var(--muted)}
@media(min-width:1101px){
 main{height:max(1000px,calc(100dvh - 176px));padding:16px;align-items:stretch;grid-template-rows:minmax(0,1fr)}
 main>.left-column,main>.content,main>.right-sidebar{height:100%;max-height:none;min-height:0;align-self:stretch}
 .left-column .chat{height:auto;min-height:0;flex:1 1 0}.left-column .chat>#messages{min-height:0;flex:1}.left-column .chat>:not(#messages){flex-shrink:0}
 .content{max-height:none;min-height:0}
 .right-sidebar{position:relative;top:auto;display:flex;flex-direction:column;gap:12px}
 .right-sidebar>.pf-slot,.right-sidebar>.ad-sidebar{flex-shrink:0}
 .right-sidebar>.scam-panel{flex:1 1 0;min-height:0;display:flex;flex-direction:column}
 .scam-panel>.panel-heading,.scam-panel>form,.scam-panel>.scam-pagination{flex-shrink:0}
 .scam-panel>#scam-list{flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--scroll-thumb) var(--scroll-track)}
 .right-sidebar>.ad-sidebar{margin-top:auto}
}
@media(max-width:760px){.site-footer{width:calc(100% - 24px);gap:12px;padding:18px 0}.site-footer>span{display:none}.site-footer small{flex-basis:100%;margin-left:0}.left-column .chat{height:650px}}

/* One document scroll: let all page content determine its natural height. */
@media(min-width:1101px){
 main{height:auto;min-height:0;grid-template-rows:auto;align-items:stretch}
 main>.left-column,main>.content,main>.right-sidebar{height:auto;max-height:none;min-height:0}
 .content{overflow:visible;max-height:none;padding-right:0;scrollbar-gutter:auto;overscroll-behavior-y:auto}
 .left-column .chat{height:auto;min-height:650px;flex:1 1 auto}
 .right-sidebar>.scam-panel{flex:1 1 auto;min-height:0}
 .scam-panel>#scam-list{flex:0 0 auto;overflow:visible;max-height:none}
 .right-sidebar>.ad-sidebar{margin-top:auto}
}

/* Keep chat compact rather than stretching to the full article column. */
@media(min-width:1101px){
 main>.left-column{align-self:start}
 .left-column .chat{height:600px;min-height:0;flex:0 0 auto}
 .left-column .chat>#messages{min-height:0;overflow-y:auto}
}
@media(max-width:1100px){.left-column .chat{height:560px;min-height:0;flex:0 0 auto}}

@media(min-width:1101px){.left-column .chat{height:700px}}
@media(min-width:761px) and (max-width:1100px){.left-column .chat{height:660px}}
.mobile-tabs,.mobile-more{display:none}
@media(max-width:760px){
 body[data-mobile-view]{padding-bottom:calc(68px + env(safe-area-inset-bottom,0px))}
 .mobile-tabs{position:fixed;bottom:0;left:0;right:0;z-index:80;height:calc(64px + env(safe-area-inset-bottom,0px));padding:5px 6px calc(5px + env(safe-area-inset-bottom,0px));display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;border-top:1px solid var(--line);background:var(--panel);box-shadow:0 -4px 15px #0001}
 .mobile-tabs button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:3px 0;border-radius:5px;color:var(--muted);font-size:11px;line-height:1.2;min-width:0}
 .mobile-tabs button svg{width:22px;height:22px}.mobile-tabs button.active{color:var(--blue);background:var(--soft)}
 body[data-mobile-view] main{min-height:calc(100dvh - 180px)}
 body[data-mobile-view] .left-column,body[data-mobile-view] .right-sidebar{display:contents}
 body[data-mobile-view] .account-panel,body[data-mobile-view] .chat,body[data-mobile-view] .ad-wing,body[data-mobile-view] .content,body[data-mobile-view] .pf-slot,body[data-mobile-view] .scam-panel,body[data-mobile-view] .ad-sidebar,body[data-mobile-view] .site-footer{display:none!important}
 body[data-mobile-view="home"] .account-panel{display:block!important}
 body[data-mobile-view="home"] .content,body[data-mobile-view="boards"] .content,body[data-mobile-view="market"] .content{display:flex!important;flex-direction:column;width:100%;gap:14px}
 body[data-mobile-view] .content>*{display:none!important}
 body[data-mobile-view="home"] .content>.ad-main,body[data-mobile-view="home"] .content>.live-panel{display:grid!important}
 body[data-mobile-view="home"] .content>.ad-main{display:flex!important;order:0}body[data-mobile-view="home"] .content>.live-panel{order:1}
 body[data-mobile-view="chat"] .chat{display:flex!important;width:100%;height:max(540px,calc(100dvh - 175px));min-height:0;flex:none;order:0}
 body[data-mobile-view="boards"]:not(.board-screen) .content>.community-title{display:flex!important}
 body[data-mobile-view="boards"]:not(.board-screen) .content>#board-grid{display:grid!important}
 body[data-mobile-view="boards"].board-screen .content>#board-page{display:block!important}
 body[data-mobile-view="market"] .content>.market{display:block!important}
 body[data-mobile-view="solver"] .pf-slot{display:block!important;width:100%;height:auto!important;order:0}
 body[data-mobile-view="solver"] .pf-slot>.pf-panel.pf-expanded{position:relative;top:auto;right:auto;width:100%;max-height:none;overflow:visible;box-shadow:none}
 body[data-mobile-view="more"] .mobile-more,body[data-mobile-view="more"] .scam-panel{display:block!important;width:100%}
 body[data-mobile-view="more"] .site-footer{display:flex!important}
 .mobile-more{padding:18px;order:-1}.mobile-more h2{margin:0 0 10px}.mobile-more button{display:block;width:100%;text-align:left;padding:13px 4px;border-bottom:1px solid var(--line);font-size:14px}
 #toast{bottom:calc(78px + env(safe-area-inset-bottom,0px))}
}

/* Single-column navigation: each tab owns its content. */
@media(max-width:760px){
 .mobile-tabs{grid-template-columns:repeat(7,minmax(0,1fr))}
 .mobile-tabs button{font-size:10px}.mobile-tabs button span{max-width:100%;word-break:keep-all;text-align:center}
 body[data-mobile-view] #live.live-panel{display:none!important}
 body[data-mobile-view="home"]:not(.board-screen) #live.live-panel,body[data-mobile-view="live"]:not(.board-screen) #live.live-panel{display:block!important}
 body[data-mobile-view="live"] .content{display:flex!important;flex-direction:column;width:100%;min-width:0}
 body[data-mobile-view] main,body[data-mobile-view] .content,body[data-mobile-view] .content>*{min-width:0;max-width:100%;box-sizing:border-box}
 body[data-mobile-view="boards"] #board-grid{grid-template-columns:minmax(0,1fr);width:100%}
 body[data-mobile-view="boards"] #board-page{width:100%;min-width:0;overflow-wrap:anywhere}
 .board-nav{flex-wrap:wrap;gap:10px}.board-list-row>span,.board-list-row>small{min-width:0;max-width:100%;overflow-wrap:anywhere}
 .board-title{flex-wrap:wrap;gap:10px}.board-title h1{min-width:0;overflow-wrap:anywhere}
 .post-body img,.post-images img{max-width:100%;height:auto}
}

@media(max-width:760px){
 body[data-mobile-view="market"] .content{align-items:stretch}
 body[data-mobile-view="market"] .content>#market{width:100%!important;max-width:100%;min-width:0;align-self:stretch;flex:0 0 auto}
 body[data-mobile-view="market"] #market .chart-layout,body[data-mobile-view="market"] #market .chart-main,body[data-mobile-view="market"] #market .evidence{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
 body[data-mobile-view="market"] #market .chart-layout{display:block}
 body[data-mobile-view="market"] #market #chart{width:100%;min-width:0;max-width:100%}
 body[data-mobile-view="market"] #market .platforms{display:flex;gap:0;justify-content:space-between;flex-wrap:wrap}
 body[data-mobile-view="market"] #market .chart-toolbar{flex-wrap:wrap;gap:10px}
}
