/* Averon 037 – viewport-based chat layout (PC + mobile) */
html.averon-chat-screen,body.averon-chat-screen{height:100%;overflow:hidden}
body.averon-chat-screen{display:flex;flex-direction:column}
body.averon-chat-screen>header{flex:0 0 auto;position:relative;top:auto}
body.averon-chat-screen>.shell{flex:1 1 auto;min-height:0;height:0;overflow:hidden}
body.averon-chat-screen .shell>.main{height:100%;min-height:0;overflow:hidden;display:flex;flex-direction:column;max-width:none;padding:12px 18px;min-width:0}
body.averon-chat-screen .shell>.left,body.averon-chat-screen .shell>.right{overflow-y:auto;min-height:0}
body.averon-chat-screen .rp-journal{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;margin:0;overflow:hidden;padding:12px}
body.averon-chat-screen .averon-chat-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 7px}
body.averon-chat-screen .rp-journal-heading{flex:0 0 auto;margin-bottom:5px}
body.averon-chat-screen .rp-journal .composer{flex:0 0 auto;margin-top:7px;padding:8px;display:flex;gap:7px;align-items:flex-end}
body.averon-chat-screen .rp-journal .composer #replyInfo:empty{display:none}
body.averon-chat-screen .rp-journal .composer #replyInfo:not(:empty){align-self:center;max-width:180px}
body.averon-chat-screen .rp-journal .composer textarea{min-height:0!important;height:auto;min-width:0;flex:1;resize:none;max-height:calc(5 * 1.55em + 24px);overflow-y:auto;line-height:1.55;padding:9px}
body.averon-chat-screen .rp-journal .composer-bottom{margin:0;flex:0 0 auto;align-items:center;gap:4px}
body.averon-chat-screen .rp-journal .averon-character-count{font-size:10px}
body.averon-chat-screen .location-hero{flex:0 0 auto;margin:0 0 5px!important;min-height:0!important;padding:10px 14px!important;background-size:cover}
body.averon-chat-screen .location-hero h1{font-size:clamp(18px,2vw,25px);margin:0 0 5px}
body.averon-chat-screen .location-hero p,body.averon-chat-screen .location-district{display:none}
body.averon-chat-screen .location-hero .btn{padding:5px 9px;margin:2px;font-size:11px}
body.averon-chat-screen .main>.tabs{flex:0 0 auto;margin:4px 0;gap:5px;flex-wrap:nowrap;overflow-x:auto}
body.averon-chat-screen .main>.tabs .tab{white-space:nowrap;padding:7px 9px}
/* House and guild chats retain their separate room settings while the chat itself fills the available space. */
body.averon-chat-screen .house-chat-surface,body.averon-chat-screen .guild-room-full{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow:hidden;margin:0}
body.averon-chat-screen .house-chat-surface>.averon-unified-chat,body.averon-chat-screen .guild-room-full>.averon-unified-chat{flex:1 1 auto;min-height:0;max-height:none!important;height:auto!important;overflow-y:auto!important;overscroll-behavior:contain}
body.averon-chat-screen .house-chat-surface>.house-composer,body.averon-chat-screen .guild-room-full>.guild-composer{flex:0 0 auto;margin-top:6px;padding:8px}
body.averon-chat-screen .house-chat-surface textarea.house-compose,body.averon-chat-screen .guild-room-full textarea#guildHallMessage{min-height:0!important;height:auto;max-height:calc(5 * 1.55em + 24px);resize:none;overflow-y:auto}
body.averon-chat-screen .guild-room-full>.guild-room-settings{max-height:70px;overflow:auto}
@media(max-width:700px){
 body.averon-chat-screen .shell>.main{padding:5px 7px}
 body.averon-chat-screen .rp-journal{padding:7px}
 body.averon-chat-screen .rp-journal-heading h2{font-size:17px}
 body.averon-chat-screen .rp-journal .composer{padding:6px}
 body.averon-chat-screen .rp-journal .composer-bottom .btn{padding:9px;font-size:12px}
 body.averon-chat-screen .rp-journal .averon-character-count{display:none}
 body.averon-chat-screen .location-hero{padding:7px 9px!important}
 body.averon-chat-screen .location-hero h1{font-size:18px}
}
/* 037 mobile header: menu / admin / logo / logout / online; character / reputation; weather / gold */
@media(max-width:700px){
 body:not(.guest-mode):not(.onboarding-mode) header{display:grid!important;grid-template-columns:40px 40px minmax(0,1fr) 40px 40px!important;grid-template-rows:56px 45px 40px!important;height:auto!important;min-height:141px!important;gap:3px 5px!important;padding:4px 8px!important;align-content:start}
 header #leftPanelToggle{grid-column:1;grid-row:1}
 header #averon-admin-nav{grid-column:2!important;grid-row:1!important}
 header .brand{grid-column:2 / 5!important;grid-row:1!important;justify-self:center;min-width:0}
 header:has(#averon-admin-nav:not([hidden])) .brand{grid-column:3!important}
 header #headerLogout{grid-column:4!important;grid-row:1!important}
 header #rightPanelToggle{grid-column:5!important;grid-row:1!important}
 header #headerCharacter{grid-column:1 / 4!important;grid-row:2!important;max-width:none!important;width:100%!important;min-width:0!important;align-self:stretch}
 header #headerReputation{grid-column:4 / 6!important;grid-row:2!important;width:100%!important;max-width:none!important;min-width:0!important;flex-basis:auto!important;overflow:hidden;white-space:nowrap;justify-content:center;align-self:stretch}
 header #headerReputation .rep-label{overflow:hidden;text-overflow:ellipsis}
 header #worldStatus{grid-column:1 / 5!important;grid-row:3!important;position:static!important;min-width:0!important;display:flex!important;justify-content:space-around!important;gap:2px!important;padding:0!important;border:0!important}
 header #headerGold{grid-column:5!important;grid-row:3!important;position:static!important;white-space:nowrap;justify-self:end;align-self:center;font-size:11px!important}
 header #headerGold svg{width:15px;height:15px}
 header #headerGold span{font-size:0}header #headerGold span::first-letter{font-size:11px}
 header .header-spacer,header .character-caption,header #pwaInstall{display:none!important}
 body:not(.guest-mode):not(.onboarding-mode) .shell>.left,body:not(.guest-mode):not(.onboarding-mode) .shell>.right{top:141px!important}
 body:not(.guest-mode):not(.onboarding-mode) .panel-backdrop:not([hidden]){inset:141px 0 0!important;height:calc(100dvh - 141px)!important}
}
@media(max-width:700px){
 header #headerGold{max-width:42px;overflow:hidden;display:flex!important;gap:3px;align-items:center}
 header #headerGold span{font-size:11px!important;display:inline-block;max-width:26px;overflow:hidden;white-space:nowrap}
 header #headerGold span::first-letter{font-size:11px}
 header #headerReputation .rep-label{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis}
}
/* 037.02 compact location navigation and responsive viewport */
.location-toolbar{flex:none;min-width:0;margin:0 0 6px;padding:7px 10px;background:#10151ae8;border:1px solid var(--line);border-radius:3px}
.location-toolbar h1{font-size:21px;margin:0 0 5px;line-height:1.2}
.location-actions.tabs,.location-actions{display:flex;flex-wrap:wrap;gap:4px;margin:0;align-items:center}
.location-actions :is(.btn,.tab){display:inline-flex;align-items:center;gap:5px;justify-content:center;padding:6px 9px;margin:0;font-size:12px;line-height:1.2;white-space:normal}
body.averon-location-screen::before{background-image:linear-gradient(#0c101455,#0c101488),var(--averon-location-background,url('../icons/backgrounds/belvar_background.webp'));background-size:cover;background-position:center}
body.averon-chat-screen{height:var(--averon-viewport,100dvh);min-height:0}
body.averon-chat-screen>.shell{min-height:0!important}
body.averon-chat-screen .rp-journal{background:#10151ab8}
body.averon-chat-screen .rp-journal .averon-live-messages{max-height:none!important;height:auto!important;min-height:0;flex:1 1 auto;overflow-y:auto}
body.averon-chat-screen .rp-journal-heading{padding-bottom:4px;gap:5px}
body.averon-chat-screen .rp-journal-heading h2{font-size:16px}
body.averon-chat-screen .rp-journal .composer{flex-wrap:wrap}
body.averon-chat-screen .rp-journal .composer #averonLiveTyping{flex:0 0 100%;margin:0;min-height:0}
body.averon-chat-screen .rp-journal .composer #averonLiveTyping:empty{display:none}
body.averon-chat-screen :is(.house-chat-surface,.guild-room-full)>.averon-unified-chat{min-height:0!important}
body.averon-chat-screen .guild-room-full{min-height:0!important;padding:10px}
body.averon-chat-screen .guild-room-full :is(h2,h3,p),body.averon-chat-screen .house-chat-surface>h2{margin:3px 0}
body.averon-chat-screen .guild-room-full>p{max-height:48px;overflow:auto}
body.averon-chat-screen :is(.guild-composer,.house-composer){display:flex;flex-wrap:wrap;align-items:flex-end;gap:5px}
body.averon-chat-screen :is(.guild-composer,.house-composer) textarea{flex:1;min-width:0;width:auto;line-height:1.55}
body.averon-chat-screen :is(.guild-composer,.house-composer)>.row{margin:0;flex:none}
body.averon-chat-screen .main:has(.location-toolbar) .rp-journal-heading h2[data-duplicate-title]{display:none}
@media(min-width:701px){
 body:not(.guest-mode):not(.onboarding-mode)>header{gap:clamp(5px,1vw,14px);padding:0 12px;flex-wrap:nowrap}
 header .brand{order:0;flex:none}header .header-spacer{order:1;min-width:0}header #headerCharacter{order:2;min-width:0;max-width:170px}header #headerReputation{order:3;flex:0 1 155px;min-width:85px}header #worldStatus{order:4;gap:8px;flex:none}header #headerGold{order:5;white-space:nowrap;flex:none}header #pwaInstall{order:6}header #averon-admin-nav{order:7}header #headerLogout{order:8}header .character-caption{display:none}
}
@media(min-width:701px) and (max-width:1050px){header #worldStatus small{display:none}header #worldStatus{gap:5px;font-size:11px}header #headerCharacter{max-width:120px}header .brand small{display:none}header .brand-crest{width:25px}header #headerGold{font-size:11px}}
@media(max-width:700px){
 body:not(.guest-mode):not(.onboarding-mode)>header{grid-template-columns:32px 32px minmax(0,1fr) 32px 32px!important;grid-template-rows:40px 34px auto!important;min-height:0!important;gap:3px 4px!important;padding:4px 6px!important}
 header :is(#leftPanelToggle,#rightPanelToggle,#averon-admin-nav,#headerLogout:not([hidden])){width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;max-width:32px!important;padding:0!important}
 header .brand{grid-column:3!important;font-size:clamp(12px,4vw,18px);gap:4px}header .brand-crest{width:22px;height:28px}header .brand small{font-size:7px;letter-spacing:.6px}
 header #headerCharacter{padding:4px 7px!important;height:34px!important;font-size:12px}header #headerReputation{padding:4px!important;height:34px!important;font-size:11px}
 header #worldStatus{grid-column:1 / 4!important;gap:3px!important;justify-content:space-between!important;font-size:10px;white-space:nowrap}header #worldStatus small{display:none!important}header #worldStatus span{padding:0!important}
 header #headerGold{grid-column:4 / 6!important;max-width:none!important;overflow:visible!important;justify-self:stretch;justify-content:flex-end;min-width:0;gap:2px;font-size:10px!important}header #headerGold span{max-width:none!important;overflow:visible!important;font-size:10px!important;white-space:normal;overflow-wrap:anywhere;text-align:right}header #headerGold svg{flex:none;width:12px;height:12px}
 body:not(.guest-mode):not(.onboarding-mode) .shell>.left,body:not(.guest-mode):not(.onboarding-mode) .shell>.right{top:var(--averon-header-height,106px)!important}
 body:not(.guest-mode):not(.onboarding-mode) .panel-backdrop:not([hidden]){inset:var(--averon-header-height,106px) 0 0!important;height:auto!important}
 .location-toolbar{padding:5px 7px;margin-bottom:4px}.location-toolbar h1{font-size:17px;margin-bottom:4px}.location-actions :is(.btn,.tab){font-size:11px;padding:5px 7px;flex:1 1 42%}
 body.averon-chat-screen .rp-journal-heading{margin:0}body.averon-chat-screen .rp-journal .composer textarea{font-size:16px}
}
@media(min-width:701px){header #leftPanelToggle{order:-2}header #averon-admin-nav{order:-1!important}header #rightPanelToggle{order:9!important}}
@media(max-width:700px){header #headerCharacter{grid-column:1 / 6!important;width:60%!important;justify-self:start}header #headerReputation{grid-column:1 / 6!important;width:calc(40% - 4px)!important;justify-self:end}header #headerReputation .rep-label{max-width:none!important}}
/* 037.06 compact private chats */
.house-compact{flex:0 0 auto;display:grid;gap:5px;padding:6px 0}.house-compact h2{margin:0;font-size:16px}.house-compact-actions{display:flex;gap:6px;align-items:center;min-width:0}.house-compact-actions>.btn{flex:1;min-width:0;padding:6px;font-size:12px}.house-compact-actions select{flex:1;min-width:0}.house-compact-presence{position:relative;flex:0 0 auto}.house-compact-presence summary{cursor:pointer;padding:6px}.house-compact-presence>div{position:absolute;right:0;top:100%;z-index:20;background:#172330;border:1px solid #64748b;border-radius:6px;padding:8px;min-width:150px;max-height:35vh;overflow:auto}.house-compact-presence p{margin:4px}.collection-picker{width:min(620px,94vw)!important;max-height:85dvh;overflow:auto}.collection-picker-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:8px 0}.collection-picker-grid .collection-slot{min-width:0;white-space:normal;overflow-wrap:anywhere;display:flex;flex-direction:column;align-items:center;gap:4px}.collection-picker-pages{justify-content:center;align-items:center}.collection-picker-grid img{width:44px;height:44px;object-fit:contain}
