.automation-panel{position:absolute;z-index:90;right:max(18px,env(safe-area-inset-right));top:70px;width:min(420px,calc(100% - 36px));max-height:calc(100% - 90px);overflow:auto;background:#22333d;color:#eee6cc;border:1px solid #bfa976;box-shadow:0 12px 40px #0008;padding:18px;overscroll-behavior:contain;touch-action:pan-y}
.automation-panel[hidden],.automation-status[hidden],.world-shell[hidden],.world-agenda[hidden]{display:none!important}
.automation-panel header,.automation-panel footer{display:flex;gap:12px;align-items:center;justify-content:space-between}.automation-panel label{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:14px 0}.automation-panel button,.automation-panel select{min-height:44px;min-width:44px;color:inherit;border:1px solid #afab85;background:#2c424a;padding:8px 12px;font:inherit}.automation-panel input{width:24px;height:24px}.automation-panel p,.automation-panel small{font-size:14px;line-height:1.6}.automation-panel [data-auto-start]{background:#d9c797;color:#253132}
.automation-status{position:absolute;top:78px;right:20px;margin:0;padding:6px 12px;max-width:48%;background:#21323de8;border-left:2px solid #c5d8bb;color:#dceacb;font-size:13px;pointer-events:none}
.world-shell{position:absolute;z-index:32;left:20px;top:calc(var(--shortcut-top,130px) + 62px);max-width:310px;display:flex;flex-wrap:wrap;gap:6px}.world-shell button{min-height:44px;background:#21333deb;color:#eee6cc;border:1px solid #9b9971;padding:8px 12px;font:inherit;font-size:13px}.world-shell small{flex-basis:100%;color:#e8e5cd;background:#24343dc9;padding:4px 8px;font-size:12px}.world-shell .world-invites{display:flex;gap:6px;flex-wrap:wrap}
.world-agenda{position:absolute;z-index:35;left:50%;top:76px;transform:translateX(-50%);max-width:min(410px,45%);background:#22353ce8;color:#eee6cc;border-left:2px solid #d5bd80;padding:10px 14px}.world-agenda strong{display:block;font-size:16px}.world-agenda p{font-size:13px;margin:6px 0;line-height:1.5}.world-agenda button{min-height:44px;font:inherit;border:1px solid #bca675;background:#d7c696;color:#22323c;padding:7px 12px}
[data-auto-combat],[data-personal-auto]{min-width:44px;min-height:44px}
#social-town .world-agenda button,#social-town .automation-panel button,#social-town .automation-panel select{min-height:44px;min-width:44px}
#social-town .world-agenda button,#social-town .automation-panel [data-auto-start]{background:#d7c696;color:#22323c;border-color:#bca675}
.world-menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.world-menu-grid button{text-align:left}.world-menu h3{font-size:14px;color:#d5c798;margin:18px 0 10px}.world-menu footer{margin-top:16px;flex-wrap:wrap}.world-chat input{min-width:0;max-width:75%;font:inherit;color:inherit;background:#172a33;border:1px solid #a69e76;padding:8px}
#social-town .social-header nav>button:not([data-world-menu]):not([data-social-party]):not([data-social-list]):not([data-social-chat]):not([data-online-sound]):not([data-online-screen]){display:none!important}
#social-town .social-header nav{flex-wrap:wrap;justify-content:flex-end;max-width:65%}#social-town .social-header nav>button{min-height:44px;min-width:44px}#social-town .social-header [data-online-sound]{width:44px;overflow:hidden;padding:4px}#social-town .social-header [data-online-sound]::first-letter{font-size:12px}
#social-town .social-pane{z-index:40;background:#172b35}#social-town .social-pane-heading [data-social-close]{width:44px;min-width:44px;height:44px;min-height:44px;flex:0 0 44px}
@media(max-height:420px){.automation-panel{top:58px;max-height:calc(100% - 70px);padding:12px}.automation-status{top:62px;right:12px;font-size:12px;max-width:45%}.world-agenda{top:68px;max-width:39%;padding:7px 10px}.world-agenda p{display:none}.world-agenda strong{font-size:14px}.world-shell{top:calc(var(--shortcut-top,96px) + 52px);left:12px;max-width:220px}.world-shell button{padding:5px 8px}}
@media(orientation:portrait){.world-agenda{top:84px;max-width:calc(100% - 32px);width:calc(100% - 32px)}.world-shell{top:auto;bottom:210px;left:12px;max-width:210px}.automation-status{top:130px;max-width:calc(100% - 24px);right:12px}.automation-panel{top:80px;max-height:calc(100% - 96px)}}

.coop-story-note{position:absolute;left:50%;bottom:calc(150px + env(safe-area-inset-bottom));transform:translateX(-50%);max-width:min(38vw,480px);padding:10px 14px;margin:0;background:#21323eee;border:1px solid #d6bd7966;color:#e9dfc5;font-size:13px;line-height:1.65;pointer-events:none}.coop-story-note[hidden]{display:none}@media(max-width:700px){.coop-story-note{font-size:11px;bottom:145px;max-width:38vw;padding:7px 9px}}@media(orientation:portrait){.coop-story-note{bottom:235px;max-width:70vw}}

.battle-automation-panel{box-sizing:border-box;display:flex;flex-direction:column;gap:8px;overflow:hidden}.battle-automation-panel header,.battle-automation-panel footer{flex:0 0 auto}.battle-automation-panel .automation-options{min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}.battle-automation-panel>p{margin:0}.battle-automation-panel footer{padding-top:8px;border-top:1px solid #bfaa7655}

/* Menus scroll independently of their fixed heading and close control. */
.automation-panel{box-sizing:border-box}
.world-menu{display:flex;flex-direction:column;overflow:hidden;max-width:520px;width:calc(100% - 32px);padding:0!important;top:12px;max-height:calc(100% - 24px)}
.world-menu>header{flex:none;padding:8px 12px;position:static!important;border-bottom:1px solid #bfa97655}
.world-menu-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:0 12px 14px;scrollbar-gutter:stable}
.world-menu-body button,.social-pane-body button,.automation-options button{touch-action:pan-y}
.world-menu [data-world-character]{margin:8px 0;color:#d6d4bc}.world-menu [data-world-growth]:empty{display:none}
.world-menu-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.world-menu-grid button{display:flex;gap:6px;align-items:center;padding:8px;min-height:46px;white-space:nowrap}.world-menu-grid svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5;flex:none}
.world-menu footer{margin-top:12px;padding-top:10px;border-top:1px solid #bfa97655}.world-menu footer button{flex:1;padding:6px}
.world-agenda p{display:none}.world-agenda button{display:flex;align-items:center;gap:8px;background:transparent!important;color:inherit!important;border:0!important;padding:0!important;text-align:left}.world-agenda button span{color:#dec78b;font-size:12px;white-space:nowrap}
.world-agenda strong{font-size:13px;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
