/* Readable content first. Only the painted location canvas is scaled, with all its hotspots. */
html.m-frame{min-width:0!important;width:100%!important;overflow-x:hidden!important;background:#e8ebe2!important;-webkit-text-size-adjust:100%}
.m-frame body{margin:0!important;padding:8px!important;min-width:0!important;width:auto!important;height:auto!important;background:#e8ebe2!important;font:14px/1.45 Arial,sans-serif!important;color:#273126;overflow-wrap:break-word}
.m-frame *{box-sizing:border-box}.m-frame [hidden]{display:none!important}.m-frame input,.m-frame select,.m-frame textarea{max-width:100%;font-size:16px!important}.m-frame input:not([type=radio]):not([type=checkbox]):not([type=hidden]),.m-frame select{min-height:38px;padding:7px;border:1px solid #a6b097;border-radius:5px}.m-frame input[type=button],.m-frame input[type=submit],.m-frame button{min-height:40px;padding:8px 12px!important;font:14px Arial!important;white-space:normal!important;touch-action:manipulation;cursor:pointer}.m-frame a{touch-action:manipulation}.m-frame textarea{width:100%}.m-frame table{max-width:100%}.m-frame td{min-width:0}.m-frame fieldset{min-width:0!important;max-width:100%;overflow:auto}.m-frame h3{font-size:18px}
.m-screen-tools{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:-8px -8px 10px;padding:8px;background:#dce3d2;border-bottom:1px solid #bdc8b0;color:#35472d}.m-screen-tools strong{flex:1;font-size:14px}.m-screen-tools button{min-height:34px!important;font-size:12px!important;padding:7px 9px!important;border:1px solid #b0bea1;border-radius:6px;background:#f5f7ee;color:#35472d}
/* Flatten only ancestors of a location; item paper dolls keep their own coordinates. */
.m-frame .m-location-table,.m-frame .m-location-table>tbody{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important}
.m-frame .m-location-row{display:flex!important;flex-direction:column!important;width:100%!important;min-width:0!important}.m-frame .m-location-cell{display:block!important;order:-1;width:100%!important;max-width:100%!important;min-width:0!important;height:auto!important;padding:0!important}.m-frame .m-location-cell>div[align=right]{width:100%!important;text-align:left!important}
.m-frame .m-location-side{display:none!important}.m-frame.m-show-character .m-location-side{display:block!important;max-width:100%!important;width:100%!important;height:auto!important;overflow:auto!important;margin:8px 0}.m-frame .m-location-side:empty{display:none!important}
.m-map-viewport{position:relative;width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;background:#cbd4bd;border-radius:8px;margin:4px 0 10px;isolation:isolate}.m-map-viewport:after{content:'';display:block;width:var(--scene-width,100%);height:1px;pointer-events:none}.m-map-stage{transform-origin:0 0}.m-frame .m-map-original{max-width:none!important;min-width:0!important;margin:0!important;position:relative!important}.m-frame .m-map-original img{max-width:none!important}.m-frame .m-map-original table{max-width:none!important}.m-frame .m-map-original *{box-sizing:content-box}.m-frame .m-map-original .thunder,.m-frame .m-map-original .snow{pointer-events:none}
.m-destinations{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.m-destinations button{flex:1 1 135px;border:1px solid #b1bea1;border-radius:6px;color:#33472b;background:#f4f7eb;min-height:42px}
.m-frame .m-location-cell span:has(>a.menutop){white-space:normal!important;display:inline-block;height:auto!important;padding:4px!important}.m-frame .m-location-cell a.menutop{display:inline-block;padding:6px 4px;font-size:13px!important}.m-frame #moveto{max-width:100%}
/* Inventory: character on the left, full-width item cards on the right. */
.m-frame .m-inventory-layout,.m-frame .m-inventory-layout>tbody{display:block!important;width:100%!important}
.m-frame .m-inventory-row{display:grid!important;grid-template-columns:minmax(90px,30%) minmax(0,1fr);align-items:start;gap:8px;width:100%!important}
.m-frame .m-inventory-character{display:block!important;grid-column:1!important;grid-row:1!important;order:0!important;width:100%!important;min-width:0!important;max-width:100%!important;overflow:hidden!important;margin:0!important;padding:0!important;border:0!important}
.m-frame .m-inventory-items{display:block!important;grid-column:2!important;grid-row:1!important;order:0!important;width:100%!important;min-width:0!important;max-width:100%!important;padding:0!important}
.m-character-viewport{position:relative;overflow:hidden}.m-character-stage{transform-origin:top left;width:248px;max-width:none!important}.m-character-stage *{box-sizing:content-box}.m-frame .m-character-stage table{max-width:none!important}
.m-frame #ShowInventory{display:block!important;width:100%!important;min-width:0!important}.m-frame #ShowInventory>table{width:100%!important;table-layout:auto!important}
.m-frame .tbl_inv,.m-frame .tbl_inv>tbody{display:block!important;width:100%!important}.m-frame .tbl_inv tr{display:flex!important;flex-wrap:wrap;gap:4px}.m-frame .tbl_inv td{display:block!important;width:auto!important;flex:1 1 80px;border-radius:5px;padding:0!important;background:#d3ddc8}.m-frame .tbl_inv a{display:block;padding:9px 5px;font-size:12px!important;color:#33462b;word-break:normal!important;overflow-wrap:normal!important}
.m-frame .m-inventory-list{height:auto!important;max-height:none!important;overflow:visible!important;background:transparent!important;border:0!important}.m-frame .m-filter-row{display:flex!important;flex-direction:column!important}.m-frame .m-filter-row>td{display:block;width:100%!important;height:auto!important;text-align:left!important;padding:4px!important}.m-frame #line_filter{display:flex!important;flex-wrap:wrap;gap:5px;align-items:center}.m-frame #line_filter>div{max-width:100%!important;flex:1 1 140px}.m-frame #inpFilterName{width:100%!important;min-width:0!important}
.m-frame #itmAllSee>table,.m-frame #itmAllSee>table>tbody{display:block!important;background:transparent!important;width:100%!important}
.m-frame .m-item-card{display:block!important;margin:7px 0;padding:8px;border:1px solid #bdc9b0;border-radius:7px;background:#f7f8f0!important;width:100%!important;min-width:0!important}
.m-frame .m-item-card>td{display:block!important;width:100%!important;min-width:0!important;background:transparent!important;padding:0!important}
.m-frame .m-item-card table{width:100%!important;min-width:0!important;table-layout:auto!important}.m-frame .m-item-card td{word-break:normal!important;overflow-wrap:break-word!important}
.m-frame .m-item-inner,.m-frame .m-item-inner>tbody,.m-frame .m-item-inner>tbody>tr{display:block!important;width:100%!important;min-width:0!important}
.m-frame .m-item-inner>tbody>tr>td{display:block!important;width:100%!important;min-width:0!important;padding:0!important;border:0!important;text-align:left!important}
.m-frame .m-item-heading{width:100%;margin-bottom:6px}.m-frame .m-item-heading .inv_name{display:block!important;width:100%!important;font-size:14px!important;font-weight:bold;line-height:1.35;white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important;padding:0!important}
.m-frame .m-item-actions{display:flex!important;flex-wrap:wrap;gap:5px;align-items:center;margin-bottom:5px}.m-frame .m-item-actions br{display:none}.m-frame .m-item-actions img{max-width:60px;height:auto}.m-frame .m-item-card a{display:inline-block;font-size:13px!important;padding:5px 3px;word-break:normal!important;overflow-wrap:break-word!important}.m-frame .m-item-actions a[title="Надеть"],.m-frame .m-item-actions a[title="Использовать"]{padding:9px 12px!important;border-radius:5px;background:#526a41;color:#fff;min-height:36px;text-decoration:none}
.m-frame .m-item-details{width:100%;font-size:12px;line-height:1.4}.m-frame .m-item-details summary{padding:8px 0;cursor:pointer;color:#526645}.m-frame .m-item-details>div{max-width:100%}.m-frame .pgdas,.m-frame [class^=pgdas]{display:inline-block;padding:7px!important;margin:2px}
/* Combat: controls before portraits; never shrink the entire page. */
.m-frame .m-battle-layout,.m-frame .m-battle-layout>tbody{display:block!important;width:100%!important}.m-frame .m-battle-row{display:flex!important;flex-wrap:wrap;width:100%!important;gap:8px}.m-frame .m-battle-controls{order:-1;display:block!important;width:100%!important;max-width:100%;padding:8px!important;min-width:0!important;border:1px solid #bdc9b0;border-radius:8px;background:#f5f7ef}.m-frame .m-battle-character{display:none!important;width:100%!important;height:auto!important;overflow:auto}.m-frame.m-show-character .m-battle-character{display:block!important}.m-frame #priems{width:100%!important;max-width:100%;display:flex;flex-wrap:wrap;gap:4px}.m-frame #priems img{touch-action:manipulation;min-width:28px;min-height:28px}.m-frame #mainpanel{width:100%!important;table-layout:fixed}.m-frame #mainpanel td{padding:2px!important;overflow-wrap:anywhere}.m-frame #mainpanel a{display:flex;align-items:center;justify-content:center;min-width:30px;min-height:36px;border-radius:4px;background:#e1e7d8}.m-frame #mainpanel .crop{width:auto!important;height:auto!important;min-height:36px}.m-frame #mainpanel [id^=txtb]{font-size:11px!important}.m-frame #go_btn{min-height:46px!important;width:100%;background:#526a41!important;color:#fff!important;border:1px solid #394e2a!important;border-radius:6px!important;font-weight:bold!important}.m-frame #ref_menu_down table{width:100%!important}.m-frame #battle_logg{font-size:13px!important;overflow-wrap:anywhere}.m-frame #allTeams0{overflow-wrap:anywhere}.m-frame .ahint,.m-frame #hint4{max-width:calc(100vw - 20px)!important;overflow:auto}
@media(min-width:720px){.m-frame .m-battle-character{width:calc(50% - 4px)!important}.m-frame.m-show-character .m-battle-character{display:block!important}}
.m-frame [data-m-destination=true]{display:none!important}
.m-frame .m-dungeon-content{display:block!important;order:1!important;width:100%!important;max-width:100%!important;padding:8px!important;background:#f2f5e9;border-radius:7px;margin-top:8px}.m-frame .m-dungeon-content #users,.m-frame .m-dungeon-content #items{max-width:100%;overflow-wrap:anywhere}
.m-frame .m-map-original #img_ione{border:0!important}

/* Never let a fixed-width legacy container determine the mobile map scale. */
.m-frame .m-location-container{width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important;margin-right:0!important;float:none!important}
.m-frame .m-map-viewport{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
.m-frame .m-item-inner>tbody>tr>td.m-item-actions{display:flex!important}
/* Battle controls do not depend on the missing legacy radio.gif sprite. */
.m-frame.m-battle-modern #mainpanel,.m-frame.m-battle-modern #mainpanel222{display:none!important}
.m-frame #m-combat-controls{width:100%;min-width:0;margin:8px 0;color:#293b25;text-align:left}
.m-combat-summary{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px;align-items:center;padding:14px;background:#e0e8d4;border-radius:8px;font-size:clamp(14px,2.8vw,28px);overflow-wrap:break-word}.m-combat-summary strong:last-child{text-align:right}.m-combat-summary>span{font-size:.75em;opacity:.65}
.m-combat-group{margin-top:14px}.m-frame .m-combat-group h3{font:700 clamp(15px,2.7vw,27px)/1.3 Arial!important;margin:0 0 8px}
.m-combat-choices{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}
.m-frame .m-combat-choices button{width:100%;min-width:0;min-height:clamp(46px,10vw,100px)!important;padding:8px 5px!important;white-space:normal!important;border:2px solid #b5c4a5;border-radius:8px;background:#f7f9f0;color:#34462b;font:600 clamp(12px,2.8vw,28px)/1.25 Arial!important;word-break:normal;overflow-wrap:normal}
.m-frame .m-combat-choices button[aria-pressed=true]{background:#526f40;color:#fff;border-color:#304c22;box-shadow:inset 0 0 0 2px #c9dcaf}
.m-frame .m-combat-defence .m-combat-choices button[aria-pressed=true]{background:#425c77;border-color:#263e59}
.m-frame.m-battle-modern #go_btn{min-height:clamp(46px,10vw,100px)!important;font-size:clamp(16px,3.2vw,32px)!important;margin:12px 0!important;max-width:100%;width:100%!important}
.m-frame.m-battle-modern #priems img{width:clamp(32px,6vw,64px);height:clamp(32px,6vw,64px);min-width:0;min-height:0;object-fit:contain}
.m-frame.m-battle-modern .m-combat-host{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;float:none!important}
