/* Explicit screen layouts: chat owns a permanent lane; trading comes first on phones. */
.onchain-forest{--chat-room:300px;--chat-height:136px}
.onchain-forest #chat{display:flex!important;visibility:visible!important;position:fixed!important;z-index:45;left:auto!important;right:0!important;top:0!important;bottom:0!important;width:var(--chat-room)!important;height:100dvh!important;max-height:none!important;min-height:0;border-radius:0!important;background:var(--panel-solid);border-width:0 0 0 1px;overflow:hidden}
.onchain-forest #chat header{flex:none;min-height:44px;padding:10px 14px}.onchain-forest #chat .hbtns{display:none}.onchain-forest #chat .body{flex:1;min-height:0;padding:10px 14px;gap:10px;overflow:auto}.onchain-forest #chat .msg{font:400 15px var(--body);display:flex;flex-direction:column;gap:3px;overflow-wrap:anywhere}.onchain-forest #chat .msg b{font-size:12px;color:var(--leaf);font-weight:600}.onchain-forest .chat-empty{color:var(--muted);font:400 18px var(--hand);padding:8px 0}
.onchain-forest #chat .chatform{flex:none;display:flex!important;gap:8px;padding:10px;border-top:1px solid var(--line)}.onchain-forest #chatIn{display:block!important;flex:1;min-width:0;min-height:36px;font:400 15px var(--body);padding:8px 10px}.onchain-forest #chatForm button{font:400 14px var(--body);min-height:36px;padding:0 12px}.onchain-forest #chatStatus{font:400 11px var(--body);padding:0 10px;flex:none}.onchain-forest #chatStatus:empty{display:none}
.onchain-forest.chatopen .modal{right:var(--chat-room);bottom:0;padding:12px}.onchain-forest.chatopen .top{right:calc(var(--chat-room) + 16px)}.onchain-forest #treePage .sheet{width:min(1080px,calc(100% - 8px));height:min(760px,calc(100dvh - 32px));max-height:calc(100dvh - 32px)}
.onchain-forest .forest-market{grid-template-columns:minmax(0,1fr) 270px;gap:26px}.onchain-forest .market-order{padding:16px;gap:14px}.onchain-forest .tree-market-header{min-height:112px;padding-top:18px;padding-bottom:14px;padding-left:94px}.onchain-forest #treePage .tp-art{top:18px;width:76px;height:76px}.onchain-forest .tp-info h1{font-size:27px}.onchain-forest #treePage .tp-info{padding-left:26px;padding-right:26px}.onchain-forest #treePage .tp-art{left:26px}.onchain-forest .tp-tabs button{font-size:20px;padding-top:8px;padding-bottom:9px}.onchain-forest .tree-market-content{padding-top:18px}
.onchain-forest .username-field{display:flex;gap:6px;align-items:center;border:1px solid var(--line);padding:10px 12px;border-radius:12px;background:var(--card);margin:8px 0 14px}.onchain-forest .username-field input{border:0;outline:0;background:transparent;min-width:0;width:100%;color:var(--ink);font:400 19px var(--body)}.onchain-forest #usernameSave{width:100%;margin-top:12px}.onchain-forest #usernameError{font-size:14px}
@media(min-width:1600px){.onchain-forest{--chat-room:330px}.onchain-forest #treePage .sheet{width:min(1240px,calc(100% - 32px))}.onchain-forest .forest-market{grid-template-columns:minmax(0,1fr) 300px;gap:36px}}
@media(min-width:1000px) and (max-width:1199px){.onchain-forest{--chat-room:250px}.onchain-forest .forest-market{grid-template-columns:minmax(0,1fr) 232px;gap:16px}.onchain-forest .market-value{font-size:24px}.onchain-forest #treePage .tp-info{padding-left:18px;padding-right:18px}.onchain-forest #treePage .tp-art{left:18px}.onchain-forest .chart-controls{gap:3px}.onchain-forest .chart-segment button{padding:3px 6px}.onchain-forest .market-order{padding:12px}.onchain-forest .market-chart{min-height:230px}}
@media(max-width:999px){.onchain-forest #chat{top:auto!important;bottom:0!important;left:0!important;right:0!important;width:100%!important;height:calc(var(--chat-height) + env(safe-area-inset-bottom))!important;padding-bottom:env(safe-area-inset-bottom);border-width:1px 0 0!important}.onchain-forest #chat header{min-height:26px;padding:3px 12px}.onchain-forest #chat header .h{font-size:14px}.onchain-forest #chat .body{padding:3px 12px;gap:5px}.onchain-forest #chat .msg{flex-direction:row;align-items:baseline;gap:8px;font-size:13px}.onchain-forest #chat .msg b{white-space:nowrap;font-size:12px}.onchain-forest #chat .chatform{padding:5px 10px}.onchain-forest #chatIn,.onchain-forest #chatForm button{min-height:30px;height:30px;padding-top:4px;padding-bottom:4px;font-size:14px}.onchain-forest.chatopen .top{right:10px!important}.onchain-forest.chatopen .modal{right:0;bottom:calc(var(--chat-height) + 48px + env(safe-area-inset-bottom));padding:8px}.onchain-forest #treePage .sheet{width:100%;height:100%;max-height:100%;border-radius:22px 8px 22px 8px}.onchain-forest.chatopen nav.tabbar{display:grid;bottom:calc(var(--chat-height) + env(safe-area-inset-bottom))!important;height:48px!important;padding:0;z-index:44;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;left:0;right:0}.onchain-forest nav.tabbar button{font-size:10px;padding:3px}.onchain-forest nav.tabbar svg{height:17px;width:17px}.onchain-forest .dock{display:none}.onchain-forest.chatopen #card{bottom:calc(var(--chat-height) + 60px + env(safe-area-inset-bottom))!important;left:10px!important;right:10px!important;width:auto!important;transform:none!important}.onchain-forest.chatopen #mine,.onchain-forest.chatopen #race.open{bottom:calc(var(--chat-height) + 56px + env(safe-area-inset-bottom))!important;top:80px!important;max-height:none!important;right:10px!important}.onchain-forest #minimap{bottom:calc(var(--chat-height) + 60px)!important}.onchain-forest .toasts{bottom:calc(var(--chat-height) + 60px)!important;z-index:46}.onchain-forest .forest-market{grid-template-columns:minmax(0,1fr) 250px;gap:20px}}
@media(min-width:600px) and (max-width:999px){.onchain-forest{--chat-height:150px}.onchain-forest #treePage .tp-info{padding:0 22px 22px}.onchain-forest .market-chart{min-height:250px}.onchain-forest .market-value{font-size:25px}.onchain-forest .chart-controls{gap:5px}.onchain-forest .market-order{padding:14px}.onchain-forest #treePage .tp-art{left:22px}}
@media(max-width:599px){.onchain-forest{--chat-height:128px}.onchain-forest #treePage .tp-info{padding:0 14px 14px}.onchain-forest #treePage .tp-art{left:14px;top:14px;width:44px;height:48px}.onchain-forest .tree-market-header{min-height:78px;padding:12px 0 10px 56px;gap:6px}.onchain-forest .tree-market-header .market-eyebrow{font-size:13px}.onchain-forest .tp-info h1{font-size:21px;margin:3px 0 4px}.onchain-forest .tree-header-meta{font-size:10px;gap:8px}.onchain-forest .tree-header-meta .tier{font-size:10px}.onchain-forest .tree-market-close{width:28px;height:28px}.onchain-forest .tp-tabs{gap:20px}.onchain-forest .tp-tabs button{font-size:16px;padding:6px 0 8px}.onchain-forest .tree-market-content{padding-top:10px}.onchain-forest .forest-market{display:flex;flex-direction:column;gap:18px}.onchain-forest #tradeBox{order:-1;width:100%;padding:10px 12px;gap:8px;border-radius:16px 5px 16px 5px}.onchain-forest .order-tabs{padding-bottom:4px}.onchain-forest .order-tabs button{min-height:26px;font-size:18px}.onchain-forest .order-input{padding:8px 10px}.onchain-forest .order-label{font-size:12px}.onchain-forest .order-label span{font-size:11px}.onchain-forest .order-amount{margin:6px 0}.onchain-forest .order-amount input#amt{font-size:27px}.onchain-forest .market-order .chips button{min-height:24px;font-size:12px}.onchain-forest .order-total{min-height:28px;flex-direction:row;align-items:baseline;justify-content:space-between;gap:8px}.onchain-forest .order-total>span{font-size:15px}.onchain-forest .order-total strong{font-size:20px}.onchain-forest .market-order #tradeGo{min-height:36px;font-size:17px}.onchain-forest .market-order>a{font-size:10px}.onchain-forest .market-overview{width:100%}.onchain-forest .market-price{gap:5px}.onchain-forest .market-value{font-size:25px;margin-bottom:8px}.onchain-forest .market-chart{min-height:220px}.onchain-forest .chart-controls{gap:4px;margin-bottom:0}.onchain-forest .chart-segment button{font-size:12px}.onchain-forest .market-metrics{padding:12px 0}.onchain-forest .market-metrics span{font-size:16px}.onchain-forest .market-metrics b{font-size:15px}.onchain-forest .owner-management{margin-top:8px}.onchain-forest #gate .sheet{padding:18px;width:100%;max-height:100%}.onchain-forest #gate h2{font-size:23px}.onchain-forest #gate p{font-size:15px}.onchain-forest #minimap{display:none}}
/* Override the legacy drawer's minimum size on compact screens. */
.onchain-forest #chat{min-height:0!important}
@media(max-width:599px){.onchain-forest .tree-header-meta{display:none}.onchain-forest .tree-market-header{min-height:70px;padding-top:10px;padding-bottom:8px}.onchain-forest #treePage .tp-art{top:12px}.onchain-forest .market-order{gap:6px}.onchain-forest .order-tabs{padding-bottom:2px}}
