/* Riftfall Arena – V34 overlap and overflow guard | 2026-11-10
   Layer-only patch: combat logic, 3D models, audio and save handling are untouched.
   Loaded after site CSS, while later dynamically inserted CSS is out-ranked by
   the narrow body.rf-ui-layout-v34 selectors below.
*/
:root { --rf-ui-safe-top: env(safe-area-inset-top, 0px); --rf-ui-safe-right: env(safe-area-inset-right, 0px); --rf-ui-safe-bottom: env(safe-area-inset-bottom, 0px); --rf-ui-safe-left: env(safe-area-inset-left, 0px); --rf-ui-controls-space: 225px; --rf-ui-panel-max: 290px; }
html, body { max-width:100%; overflow-x:hidden; }
body.rf-ui-layout-v34 { max-width:100%; }
body.rf-ui-layout-v34 * { box-sizing:border-box; }
body.rf-ui-layout-v34 [hidden] { display:none!important; }
/* Wide menus and scrollable screens must be allowed to shrink instead of overflowing. */
body.rf-ui-layout-v34 .screen.on { box-sizing:border-box; max-width:100%; min-width:0; overflow-x:clip; overflow-y:auto; overscroll-behavior-y:contain; -webkit-overflow-scrolling:touch; scroll-padding-block:18px; }
body.rf-ui-layout-v34 .screen .inner { min-width:0; max-width:100%; }
body.rf-ui-layout-v34 .screen .inner > *, body.rf-ui-layout-v34 .topbar > *, body.rf-ui-layout-v34 .portal-wrap > *, body.rf-ui-layout-v34 .portal-services > *, body.rf-ui-layout-v34 .portal-modes > *, body.rf-ui-layout-v34 .mode-tile > * { min-width:0; }
body.rf-ui-layout-v34 .screen :is(p, small, label, em, .crumb, .foot),
body.rf-ui-layout-v34 #world-panel, body.rf-ui-layout-v34 #world-req { overflow-wrap:anywhere; }
body.rf-ui-layout-v34 .screen :is(input,select,textarea) { min-width:0; max-width:100%; }
body.rf-ui-layout-v34 .topbar { flex-wrap:wrap; row-gap:8px; }
body.rf-ui-layout-v34 .topbar .crumb { flex:1 1 140px; text-align:end; min-width:0; }
body.rf-ui-layout-v34 .topbar .back { flex:0 0 auto; max-width:100%; }
body.rf-ui-layout-v34 :is(#scr-title .portal-wrap,#scr-title .portal-header,#scr-title .portal-world,#scr-title .portal-overview,#scr-title .portal-play) { min-width:0; max-width:100%; }
body.rf-ui-layout-v34 #scr-title :is(.portal-modes,.portal-services) { min-width:0; max-width:100%; }
body.rf-ui-layout-v34 #scr-title :is(.portal-services,.portal-modes) > button { max-width:100%; min-width:0; overflow-wrap:anywhere; }
body.rf-ui-layout-v34 #scr-title :is(.portal-modes,.portal-services) small { white-space:normal; overflow-wrap:anywhere; }
/* Party, character/stage select and forge. */
body.rf-ui-layout-v34 #scr-select .inner { width:min(1260px,100%); }
body.rf-ui-layout-v34 #select-grid { width:100%; min-width:0; max-width:100%; grid-template-columns:repeat(auto-fill,minmax(min(164px,100%),1fr)); }
body.rf-ui-layout-v34 #select-grid > .card { min-width:0; max-width:100%; overflow:hidden; }
body.rf-ui-layout-v34 #select-grid .card :is(b,em,small) { overflow-wrap:anywhere; min-width:0; }
body.rf-ui-layout-v34 #party-bar, body.rf-ui-layout-v34 #party-slots, body.rf-ui-layout-v34 #party-quick-picker, body.rf-ui-layout-v34 #party-picker-results, body.rf-ui-layout-v34 .select-tools { min-width:0; width:100%; max-width:100%; }
body.rf-ui-layout-v34 #party-slots { grid-template-columns:repeat(4,minmax(0,1fr)); }
body.rf-ui-layout-v34 .party-picker-choice { min-width:0; max-width:100%; }
body.rf-ui-layout-v34 .party-picker-choice :is(span,strong,small) { min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; }
body.rf-ui-layout-v34 #select-layout, body.rf-ui-layout-v34 #scr-select[data-kind="stage"] #select-layout { min-width:0; max-width:100%; }
body.rf-ui-layout-v34 #stage-detail { min-width:0; max-width:100%; }
body.rf-ui-layout-v34 #scr-forge .forge { width:100%; min-width:0; grid-template-columns:minmax(140px, .8fr) minmax(0, 2fr); }
body.rf-ui-layout-v34 #scr-forge :is(.fpanel,.frow,#forge-list,#forge-rows,.ftabs) { min-width:0; max-width:100%; }
body.rf-ui-layout-v34 #scr-forge .frow { grid-template-columns:minmax(0,1fr) auto; }
body.rf-ui-layout-v34 #scr-forge .frow :is(span,small) { min-width:0; overflow-wrap:anywhere; }
body.rf-ui-layout-v34 .screen :is(.menu,.settings-grid,.portal-panels) { max-width:100%; min-width:0; }
/* Combat HUD: preserve a center lane for pause and flux, not a third overlapping column. */
body.rf-ui-layout-v34 #hud-left, body.rf-ui-layout-v34 #hud-right { width:min(260px,calc(50vw - 68px)); max-width:calc(50vw - 68px); min-width:0; top:6px; max-height:min(35dvh,270px); overflow:hidden; }
body.rf-ui-layout-v34 #hud .hud-side .plate { max-width:100%; min-width:0; }
body.rf-ui-layout-v34 #hud .hud-side .plate b { min-width:0; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:clamp(10px,1.4vmin,13px); }
body.rf-ui-layout-v34 #hud #btn-pause { left:50%; right:auto; transform:translateX(-50%); top:6px; max-width:108px; white-space:nowrap; }
body.rf-ui-layout-v34 #hud #gauges { left:50%; transform:translateX(-50%); right:auto; top:40px; width:min(106px,26vw); min-width:84px; max-width:120px; display:flex; flex-direction:column; gap:3px; }
body.rf-ui-layout-v34 #hud #gauges :is(#flux,#over,#awk) { min-width:0; }
body.rf-ui-layout-v34 #skillname { max-width:min(86vw,680px); min-width:0; width:max-content; padding-inline:12px; top:clamp(108px,20vh,154px); }
body.rf-ui-layout-v34 #skillname :is(.sn-name,.sn-who,.sn-kind) { overflow-wrap:anywhere; white-space:normal; max-width:100%; }
body.rf-ui-layout-v34 #banner { padding-inline:clamp(12px,4vw,30px); }
body.rf-ui-layout-v34 #banner b { display:block; max-width:100%; overflow-wrap:anywhere; font-size:clamp(18px,5vmin,46px); }
body.rf-ui-layout-v34 #cutin .ci-band { padding-left:8%; padding-right:7%; gap:clamp(8px,3vw,32px); }
body.rf-ui-layout-v34 #cutin .ci-text { min-width:0; max-width:65vw; }
body.rf-ui-layout-v34 #cutin .ci-title { white-space:normal; overflow-wrap:anywhere; line-height:1.18; font-size:clamp(18px,5vmin,52px); }
/* Field HUD: world map and prompt should never cover the region name. */
body.rf-ui-layout-v34 #field-info { width:auto; max-width:calc(100vw - min(148px,26vw) - 32px); top:6px; left:max(8px,var(--rf-ui-safe-left)); padding-right:9px; }
body.rf-ui-layout-v34 #field-map { top:6px; right:max(8px,var(--rf-ui-safe-right)); max-width:min(138px,28vw); }
body.rf-ui-layout-v34 #field-prompt { max-width:calc(100vw - 30px); text-align:center; white-space:normal; overflow-wrap:anywhere; }
body.rf-ui-layout-v34 #world-panel { width:min(450px,calc(100vw - 24px)); max-height:calc(100dvh - 72px); max-width:100%; overflow:auto; overscroll-behavior:contain; }
body.rf-ui-layout-v34 #world-req { width:min(460px,calc(100vw - 20px)); max-height:calc(100dvh - 82px); overflow:auto; }
body.rf-ui-layout-v34 #pause { padding:clamp(12px,3vw,24px); gap:8px; overflow-y:auto; overscroll-behavior:contain; }
body.rf-ui-layout-v34 #pause > * { max-width:100%; overflow-wrap:anywhere; }
/* Chat: independently scroll its messages, never its whole input off the viewport. */
body.rf-ui-layout-v34 #chat-panel:not([hidden]) { box-sizing:border-box; width:min(430px,calc(100vw - 20px)); max-width:calc(100vw - 20px); height:min(560px,calc(100dvh - 56px - var(--rf-ui-safe-top) - var(--rf-ui-safe-bottom))); max-height:calc(100dvh - 56px - var(--rf-ui-safe-top) - var(--rf-ui-safe-bottom)); top:calc(30px + var(--rf-ui-safe-top)); right:max(8px,var(--rf-ui-safe-right)); left:auto; overflow:hidden; display:flex; flex-direction:column; }
body.rf-ui-layout-v34 #chat-panel :is(.cp-head,.cp-tabs,form,.cp-log,.cp-guild,.cp-mem,.cp-b,.cp-note) { min-width:0; max-width:100%; }
body.rf-ui-layout-v34 #chat-panel .cp-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; flex:0 0 auto; }
body.rf-ui-layout-v34 #chat-panel .cp-tabs button { min-width:0; white-space:normal; overflow-wrap:anywhere; padding:6px 3px; line-height:1.2; }
body.rf-ui-layout-v34 #chat-panel .cp-log, body.rf-ui-layout-v34 #chat-panel .cp-guild { min-height:0; overflow-y:auto; overscroll-behavior:contain; }
body.rf-ui-layout-v34 #chat-panel .cp-head, body.rf-ui-layout-v34 #chat-panel form { flex:0 0 auto; flex-wrap:wrap; }
body.rf-ui-layout-v34 #chat-panel form input { flex:1 1 120px; min-width:0; }
body.rf-ui-layout-v34 #chat-panel .cp-log :is(p,span), body.rf-ui-layout-v34 #chat-panel .cp-mem { overflow-wrap:anywhere; }
/* Chief character editor: keep the Close button reachable and all numeric fields visible. */
body.rf-ui-layout-v34 #rf-chief-character-editor { width:100%; max-width:100%; height:100dvh; max-height:100dvh; overflow-x:hidden; overflow-y:auto; padding:var(--rf-ui-safe-top) var(--rf-ui-safe-right) var(--rf-ui-safe-bottom) var(--rf-ui-safe-left); }
body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-shell { box-sizing:border-box; width:min(1180px,calc(100% - 16px)); max-width:100%; min-width:0; margin:8px auto; padding:clamp(10px,2.2vw,22px); }
body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-header { position:sticky; top:0; z-index:4; padding:10px 3px 12px; background:rgba(21,36,52,.98); border-radius:5px; flex-wrap:wrap; }
body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-header > * { min-width:0; }
body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-content { min-width:0; max-width:100%; grid-template-columns:minmax(180px,250px) minmax(0,1fr); }
body.rf-ui-layout-v34 #rf-chief-character-editor :is(.rf-ce-form,.rf-ce-list,.rf-ce-bulk,.rf-ce-generator,.rf-ce-fields,.rf-ce-actions,.rf-ce-bulk-grid) { min-width:0; max-width:100%; }
body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-field { min-width:0; }
body.rf-ui-layout-v34 #rf-chief-character-editor :is(input,select,textarea) { min-width:0; max-width:100%; }
body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-grid { grid-template-columns:repeat(auto-fit,minmax(min(210px,100%),1fr)); }
body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-actions { flex-wrap:wrap; }
body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-actions button { min-width:0; }
body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-preview { min-width:0; max-width:100%; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table { max-width:none; }
body.rf-ui-layout-v34 .rf-ce-confirm-overlay { box-sizing:border-box; max-height:100dvh; overflow-y:auto; align-items:safe center; }
body.rf-ui-layout-v34 .rf-ce-confirm-card { max-height:calc(100dvh - 34px - var(--rf-ui-safe-top) - var(--rf-ui-safe-bottom)); max-width:100%; overflow-y:auto; }
/* Game dialogs created outside the editor. */
body.rf-ui-layout-v34 :is(.ui-dialog,#mailbox-dialog,#world-req) { max-width:calc(100vw - 22px); max-height:calc(100dvh - 52px); overflow-y:auto; overscroll-behavior:contain; }
body.rf-ui-layout-v34 .ui-dialog :is(input,textarea,select,button), body.rf-ui-layout-v34 #mailbox-dialog :is(input,textarea,select) { max-width:100%; min-width:0; }
/* Adventure rest area. A fixed panel should never cover the entire phone. */
body.rf-ui-layout-v34 #gaizorg-adventure-ui:not([hidden]) { max-width:calc(100vw - 18px); max-height:min(48dvh,415px); overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; }
body.rf-ui-layout-v34 #gaizorg-adventure-ui .ga-actions { flex-wrap:wrap; }
body.rf-ui-layout-v34 #gaizorg-adventure-ui .ga-actions button { flex:1 1 110px; min-width:0; white-space:normal; overflow-wrap:anywhere; }
/* The manual skill picker and exclusive fighter panels must respect touch controls. */
body.rf-ui-layout-v34 #rf-ce-battle-slots:not([hidden]) { box-sizing:border-box; width:min(290px,46vw); max-width:calc(100vw - 20px); max-height:min(48dvh,460px); overflow:hidden; display:flex; flex-direction:column; bottom:calc(20px + var(--rf-ui-safe-bottom)); right:max(8px,var(--rf-ui-safe-right)); }
body.rf-ui-layout-v34 #rf-ce-battle-slots .rf-ce-battle-slots-header { min-width:0; flex:0 0 auto; }
body.rf-ui-layout-v34 #rf-ce-battle-slots .rf-ce-battle-slots-header > span { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.rf-ui-layout-v34 #rf-ce-battle-slots .rf-ce-battle-slots-list { flex:1 1 auto; min-height:0; max-height:none; overflow:auto; overscroll-behavior:contain; }
body.rf-ui-layout-v34 #rf-ce-battle-slots .rf-ce-battle-slots-list button { min-width:0; white-space:normal; overflow-wrap:anywhere; }
body.rf-ui-layout-v34.rf-ui-touch-active #rf-ce-battle-slots:not([hidden]),
body.rf-ui-layout-v34.rf-ui-touch-active #rf-nep-seven:not([hidden]),
body.rf-ui-layout-v34.rf-ui-touch-active #rf-gaiz-six:not([hidden]) { position:fixed; top:auto!important; bottom:var(--rf-ui-controls-space)!important; max-height:max(68px,min(34dvh,calc(100dvh - var(--rf-ui-controls-space) - 135px)))!important; right:max(7px,var(--rf-ui-safe-right))!important; left:auto!important; width:min(270px,49vw)!important; max-width:calc(100vw - 16px)!important; overflow:auto; }
body.rf-ui-layout-v34.rf-ui-touch-active.rf-ui-two-skill-panels #rf-ce-battle-slots:not([hidden]) { left:max(7px,var(--rf-ui-safe-left))!important; right:auto!important; width:min(255px,46vw)!important; }
body.rf-ui-layout-v34.rf-ui-touch-active.rf-ui-two-skill-panels :is(#rf-nep-seven,#rf-gaiz-six):not([hidden]) { right:max(7px,var(--rf-ui-safe-right))!important; left:auto!important; width:min(255px,46vw)!important; }
body.rf-ui-layout-v34.rf-ui-chat-open :is(#rf-ce-battle-slots,#rf-nep-seven,#rf-gaiz-six) { display:none!important; }
body.rf-ui-layout-v34.rf-character-editor-open :is(#rf-ce-battle-slots,#rf-nep-seven,#rf-gaiz-six,#gaizorg-adventure-ui) { display:none!important; }
body.rf-ui-layout-v34 .rf-ce-battle-slots-toggle { min-height:38px; }
body.rf-ui-layout-v34 #rf-nep-seven .rf-grid, body.rf-ui-layout-v34 #rf-gaiz-six .rf-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
/* Large-screen and medium tablet proportions. */
@media (max-width:880px) {
 body.rf-ui-layout-v34 #scr-title .portal-header { flex-wrap:wrap; }
 body.rf-ui-layout-v34 #scr-title .portal-services, body.rf-ui-layout-v34 #scr-title .portal-modes { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.rf-ui-layout-v34 #scr-select[data-kind="stage"] #select-layout { grid-template-columns:minmax(0,1fr); }
 body.rf-ui-layout-v34 #scr-forge .forge { grid-template-columns:minmax(130px,.8fr) minmax(0,1.5fr); }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-content { grid-template-columns:minmax(0,1fr); }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-list-items { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); max-height:145px; }
}
/* Phones: alternate layout for previews and portrait battle controls. */
@media (max-width:620px) {
 body.rf-ui-layout-v34 .screen.on { padding-left:max(9px,var(--rf-ui-safe-left)); padding-right:max(9px,var(--rf-ui-safe-right)); }
 body.rf-ui-layout-v34 #select-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
 body.rf-ui-layout-v34 #party-slots { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.rf-ui-layout-v34 .party-picker-results { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.rf-ui-layout-v34 #scr-forge .forge { grid-template-columns:minmax(0,1fr); }
 body.rf-ui-layout-v34 #scr-forge #forge-list { display:flex; flex-direction:row; flex-wrap:wrap; max-height:170px; }
 body.rf-ui-layout-v34 #scr-title :is(.portal-services,.portal-modes) { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.rf-ui-layout-v34 #hud-left,body.rf-ui-layout-v34 #hud-right { width:calc((100vw - 112px)/2); max-width:calc((100vw - 112px)/2); max-height:26dvh; }
 body.rf-ui-layout-v34 #hud #gauges { max-width:92px; min-width:80px; width:90px; font-size:10px; }
 body.rf-ui-layout-v34 #hud #btn-pause { max-width:86px; font-size:11px; padding:4px 5px; }
 body.rf-ui-layout-v34 #skillname { top:clamp(105px,19vh,152px); max-width:88vw; }
 body.rf-ui-layout-v34 #field-info { max-width:calc(100vw - min(136px,33vw) - 26px); }
 body.rf-ui-layout-v34 #field-map { max-width:min(125px,30vw); }
 body.rf-ui-layout-v34 #world-panel { left:50%; top:50%; width:calc(100vw - 20px); }
 body.rf-ui-layout-v34 #chat-panel:not([hidden]) { width:calc(100vw - 12px); max-width:calc(100vw - 12px); left:6px; right:6px; height:min(72dvh,calc(100dvh - 66px)); max-height:calc(100dvh - 66px); }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-shell { width:calc(100% - 10px); margin:5px auto; padding:10px; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-list-items { grid-template-columns:repeat(2,minmax(0,1fr)); max-height:140px; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table { display:block; min-width:0!important; width:100%; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table thead { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table tbody { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(270px,100%),1fr)); gap:9px; width:100%; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table tbody tr { display:block; min-width:0; border:1px solid #516983; border-radius:8px; background:rgba(21,43,65,.87); padding:7px 10px; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table tbody td { display:flex; align-items:start; justify-content:space-between; gap:12px; width:100%; min-width:0; padding:5px 0; white-space:normal; overflow-wrap:anywhere; text-align:right; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table tbody td::before { content:attr(data-rf-label); flex:0 0 44%; text-align:left; color:#d8e7f7; font-weight:600; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table tbody td:first-child { font-weight:700; color:#ffdf9c; border-bottom:1px solid #516983; text-align:left; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table tbody td:first-child::before { flex-basis:35%; }
 body.rf-ui-layout-v34 #gaizorg-adventure-ui:not([hidden]) { max-height:min(39dvh,320px); top:max(30px,var(--rf-ui-safe-top)); padding:9px; }
 body.rf-ui-layout-v34 #gaizorg-adventure-ui .ga-touch button { min-height:40px; min-width:45px; }
 body.rf-ui-layout-v34 :is(input:not([type=checkbox]),textarea,select) { font-size:16px; }
}
@media (max-width:390px) {
 body.rf-ui-layout-v34 #scr-title :is(.portal-services,.portal-modes) { grid-template-columns:minmax(0,1fr); }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-grid { grid-template-columns:minmax(0,1fr); }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-fields { grid-template-columns:minmax(0,1fr); }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-list-items { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.rf-ui-layout-v34 #chat-panel .cp-tabs button { font-size:11px; }
}
@media (max-height:560px) and (orientation:landscape) {
 body.rf-ui-layout-v34 #hud-left, body.rf-ui-layout-v34 #hud-right { max-height:28dvh; }
 body.rf-ui-layout-v34 #hud #gauges { top:34px; }
 body.rf-ui-layout-v34 #skillname { top:clamp(76px,24vh,112px); }
 body.rf-ui-layout-v34 #gaizorg-adventure-ui:not([hidden]) { max-height:calc(100dvh - 70px); width:min(260px,42vw); }
 body.rf-ui-layout-v34.rf-ui-touch-active #rf-ce-battle-slots:not([hidden]),
 body.rf-ui-layout-v34.rf-ui-touch-active :is(#rf-nep-seven,#rf-gaiz-six):not([hidden]) { max-height:max(60px,calc(100dvh - var(--rf-ui-controls-space) - 100px))!important; }
}
@media (prefers-reduced-motion:reduce) {
 body.rf-ui-layout-v34 .screen.on .inner,body.rf-ui-layout-v34 :is(#cutin .ci-band,.portal-hero-moon) { animation-duration:.01ms!important; transition-duration:.01ms!important; }
}
/* Small tablets / landscape phones: replace the wide 7-column bulk table with cards too. */
@media (min-width:621px) and (max-width:880px) {
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table { display:block; min-width:0!important; width:100%; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table thead { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table tbody { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(270px,100%),1fr)); gap:10px; width:100%; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table tbody tr { display:block; min-width:0; border:1px solid #516983; border-radius:8px; background:rgba(21,43,65,.87); padding:7px 10px; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table tbody td { display:flex; justify-content:space-between; gap:12px; width:100%; min-width:0; padding:5px 0; white-space:normal; overflow-wrap:anywhere; text-align:right; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table tbody td::before { content:attr(data-rf-label); flex:0 0 43%; text-align:left; color:#d8e7f7; font-weight:600; }
 body.rf-ui-layout-v34 #rf-chief-character-editor .rf-ce-bulk-table tbody td:first-child { font-weight:700; color:#ffdf9c; border-bottom:1px solid #516983; text-align:left; }
}
/* Desktop: split a character's standard skill list and special spell panel. */
body.rf-ui-layout-v34.rf-ui-two-skill-panels:not(.rf-ui-touch-active) #rf-ce-battle-slots:not([hidden]) {
 left:max(12px,var(--rf-ui-safe-left)); right:auto; bottom:20px; max-width:min(290px,39vw);
}
