/* Let content determine the height; reserve large frames for actual artwork. */
.main:not(.chat-mode){max-width:1760px}
.empty{min-height:0;padding:28px 24px;gap:12px}
.table-empty{padding:24px 18px!important}
.platform-table:has(.table-empty){min-width:0}
.platform-table:has(.table-empty) th{white-space:normal}
.form-error:empty{display:none}
.panel .form-error:empty{margin:0}
.panel>p:last-child,.panel>div:last-child>p:last-child{margin-bottom:0}
.creation-module{min-height:0}
.creator-grid{align-items:start}
.creator-profile{min-height:0}
.book-card p,.character-body .desc{min-height:0}
.detail-columns{align-items:start}
.profile-layout{max-width:none}
.profile-layout .profile-bio{text-wrap:balance}
.guide-layout{grid-template-columns:220px minmax(0,1fr);gap:30px}
.guide-document{max-width:none}
.settings-panel{max-width:none}
#p-creator-profile{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px}
#p-creator-profile>.field:nth-child(3),#p-creator-profile>.form-error{grid-column:1/-1}
#p-creator-profile>.button{justify-self:start}
.page-heading>div:first-child{min-width:0;flex:1}
.page-heading p{max-width:76ch}
.panel p,.about-section p,.guide-document p,.profile-bio,.world-events p{overflow-wrap:break-word;text-wrap:pretty}
.main:not(.chat-mode) p,.main:not(.chat-mode) small{ text-wrap:balance }
.message-body p,.auth-layout p{text-wrap:balance}
.page-heading p,.intro,.field small,.notice,.cdkey-policy p,.fee-formula p,.deposit-preview p,.creation-module p,.creator-profile p,.about-columns p,.about-steps p{ text-wrap:balance }
h1,h2,h3,.field label{ text-wrap:balance }
.script-editor-layout textarea,.profile-editor textarea{min-height:100px;max-height:480px;field-sizing:content;line-height:1.9;text-wrap:balance}
#main:not(.chat-mode) textarea:not([readonly]),.modal-body textarea:not(.mono){text-wrap:balance}
.code-result textarea{white-space:pre;overflow-x:auto}
.billing-panel textarea{white-space:pre;text-wrap:nowrap!important;overflow-x:auto}
.panel textarea,.modal-body textarea{max-width:100%}
.platform-table td,.platform-table small{overflow-wrap:break-word}
.platform-table td:has(>.actions){min-width:130px}
.cdkey-policy>.actions{margin-top:16px}.cdkey-policy .button{margin:0}
@media(max-width:1100px){.guide-layout{grid-template-columns:180px minmax(0,1fr);gap:24px}}
@media(max-width:760px){
  .main:not(.chat-mode){padding-bottom:32px}
  .page-heading{flex-direction:column;align-items:stretch;gap:15px;margin-bottom:23px}
  .page-heading>div:first-child,.page-heading>.actions{width:100%}
  .page-heading>.button{align-self:flex-start}
  .page-heading [data-action=p-new-script]{width:auto;min-height:42px;padding:10px 18px}
  .page-heading p{max-width:none;font-size:13px}
  .guide-layout{grid-template-columns:1fr}
  #p-creator-profile{grid-template-columns:1fr;gap:0}
  .creation-module{min-height:0;padding:24px}
  .module-art{width:100px;height:150px;right:14px;bottom:14px;transform:none}
  .library-controls .filter-tabs{flex-wrap:wrap;white-space:normal;overflow:visible}
  .panel .field-row{grid-template-columns:minmax(0,1fr)}
  .empty{padding:24px 18px}
  .platform-table:has(.table-empty) thead{display:none}
  .pagination{flex-wrap:wrap;gap:12px}
  .pagination>div{margin-left:auto}
  .cdkey-policy p,.panel p{font-size:13px}
}
@media(max-width:420px){.library-grid{grid-template-columns:minmax(0,1fr)}.character-body .desc{font-size:12px}.character-body .title{min-height:0}.character-body .actions{display:flex;flex-wrap:wrap}.character-cover{height:210px}}
@media(max-width:680px){
  .table-wrap:has(>.responsive-records){border:0;background:transparent;overflow:visible}
  .responsive-records,.revenue-rules .responsive-records,.revenue-progress .responsive-records{display:block;min-width:0;width:100%}
  .responsive-records thead{display:none}
  .responsive-records tbody{display:grid;gap:12px}
  .responsive-records tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid #3e4837;border-radius:9px;overflow:hidden;background:#21271f}
  .responsive-records td,.revenue-rules .responsive-records td,.revenue-progress .responsive-records td{display:block;min-width:0;width:auto;white-space:normal;padding:12px 14px;border:0;font-size:12px}
  .responsive-records td:first-child,.responsive-records td:has(.actions),.responsive-records .table-empty{grid-column:1/-1}
  .responsive-records td[data-label]:before{content:attr(data-label);display:block;color:#91a080;font-size:11px;line-height:1.6;margin-bottom:6px;text-wrap:balance}
  .responsive-records td:first-child:not(.table-empty){border-bottom:1px solid #37422f;background:#293124}
  .responsive-records small{max-width:none;text-wrap:balance;overflow-wrap:anywhere}
  .responsive-records .table-script{min-width:0}
}
