/* Stock surface shares Copen trading tokens and leaves the perpetual account untouched. */
#phone.is-stock-trading #screen{padding:12px 15px 10px;overflow:hidden;min-height:0}
#phone .stk-shell{display:flex;flex-direction:column;height:100%;min-height:0;color:var(--cp-text);gap:8px}
#phone .stk-header{display:flex;align-items:center;gap:7px;flex:none;min-height:47px}
#phone .stk-back,#phone .stk-settings{display:grid;place-items:center;width:32px;min-width:32px;padding:0;color:var(--cp-muted)}
#phone .stk-asset{display:grid;gap:3px;text-align:left;flex:1;min-width:0;padding:0 3px}#phone .stk-asset strong{font-size:20px;font-weight:750;letter-spacing:-.5px}#phone .stk-asset small{font-size:10px;color:var(--cp-muted);white-space:nowrap}
#phone .stk-ai{flex:none;color:#956B85;background:#956B8512;border-radius:10px;padding:0 9px;min-height:36px;font-size:11px;font-weight:600}
#phone .stk-quote{display:flex;align-items:center;gap:8px;flex:none;min-height:28px}#phone .stk-quote>strong{font-size:22px;margin-right:auto}#phone .stk-quote>strong small{font-size:10px;font-weight:400;color:var(--cp-muted)}
#phone .stk-small{font-size:10px;min-height:32px;padding:0 5px;color:var(--cp-muted)}
#phone .stk-stage{position:relative;display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;border:1px solid var(--cp-border);border-radius:17px;background:var(--cp-card)}
#phone .stk-market{display:flex;flex:1;min-height:135px;flex-direction:column;padding:7px 8px 5px;overflow:hidden;position:relative}
#phone .stk-market-toolbar{display:flex;align-items:center;justify-content:space-between;flex:none;gap:4px}#phone .stk-market-toolbar>div{display:flex;align-items:center;gap:2px}#phone .stk-market-toolbar button{min-height:29px;padding:0 7px;border-radius:7px;font-size:10px;color:var(--cp-muted)}
#phone .stk-market-toolbar button.active,#phone .stk-periods button.active,#phone .stk-period-picker button.active,#phone .stk-indicators button.active{background:var(--cp-tint);color:var(--cp-accent);font-weight:650}
#phone .stk-plot{flex:1;min-height:36px;position:relative;overflow:hidden;margin:4px 0}
#phone .stk-chart-svg{display:block;width:100%;height:100%;min-height:36px}#phone .stk-svg-label{fill:var(--cp-muted);font-size:7px}
#phone .stk-chart-note{flex:none;font-size:8px;color:var(--cp-muted);line-height:1.4;margin:0 3px 3px}
#phone .stk-periods{display:flex;flex:none;align-items:center;justify-content:space-between;gap:2px}#phone .stk-periods button{flex:1;min-height:28px;padding:0 3px;font-size:10px;border-radius:7px;white-space:nowrap}
#phone .stk-period-picker{position:absolute;left:8px;right:8px;bottom:66px;z-index:5;background:var(--cp-card);border:1px solid var(--cp-border);border-radius:13px;padding:7px;display:grid;grid-template-columns:repeat(5,1fr);box-shadow:0 8px 22px #00000017;animation:stk-pop .18s ease-out}
#phone .stk-period-picker button{min-height:32px;border-radius:8px;font-size:11px}
#phone .stk-indicators{display:flex;gap:3px;flex:none;overflow-x:auto;border-top:1px solid var(--cp-border);padding-top:4px;margin-top:3px;scrollbar-width:none}#phone .stk-indicators button{font-size:9px;border-radius:6px;min-height:26px;flex:1;min-width:38px;padding:0 3px}
#phone .stk-book{height:100%;overflow:auto;font-variant-numeric:tabular-nums}#phone .stk-book>div{display:flex;justify-content:space-between;padding:4px 5px;font-size:10px}#phone .stk-book>div:first-child{position:sticky;top:0;background:var(--cp-card);color:var(--cp-muted)}#phone .stk-book>div:not(:first-child)>span:first-child{color:var(--cp-up)}#phone .stk-book>div:not(:first-child)>span:last-child{color:var(--cp-down)}#phone .stk-book p{color:var(--cp-muted);font-size:10px;text-align:center;margin:8px 0}
#phone .stk-information{flex:none;height:146px;border-top:1px solid var(--cp-border);overflow:auto;padding:5px 10px}#phone .stk-shell[data-layout="positions"] .stk-information{height:43%;min-height:140px}
#phone .stk-info-tabs{display:flex;gap:8px;border-bottom:1px solid var(--cp-border)}#phone .stk-info-tabs button{font-size:11px;min-height:35px;color:var(--cp-muted);padding:0 5px}#phone .stk-info-tabs button.active{color:var(--cp-accent);border-bottom:2px solid var(--cp-accent)}
#phone .stk-account-empty{display:grid;gap:6px;padding:19px 8px;text-align:center}#phone .stk-account-empty strong{font-size:12px;font-weight:550}#phone .stk-account-empty span{font-size:10px;line-height:1.6;color:var(--cp-muted)}
#phone .stk-trade-buttons{display:flex;gap:10px;flex:none;padding-top:2px}#phone .stk-trade-buttons button{flex:1;height:47px;border-radius:12px;font-size:15px;font-weight:650;color:white}#phone .stk-trade-buttons .buy{background:var(--cp-up)}#phone .stk-trade-buttons .sell{background:var(--cp-down)}
#phone .stk-order{display:flex;flex-direction:column;flex:0 1 auto;max-height:100%;min-height:160px;border-top:1px solid var(--cp-border);border-radius:17px 17px 0 0;background:var(--cp-bg);box-shadow:0 -7px 18px #00000008;overflow:hidden;animation:stk-order-in .22s ease-out}
#phone .stk-shell[data-full="true"] .stk-market{display:none}#phone .stk-shell[data-full="true"] .stk-order{flex:1;height:100%!important;border-top:0}
#phone .stk-grip{height:24px;min-height:24px;display:grid;place-items:center;touch-action:none;cursor:ns-resize;user-select:none;flex:none}#phone .stk-grip span{width:35px;height:4px;border-radius:99px;background:var(--cp-muted);opacity:.4}
#phone .stk-order>header{display:flex;align-items:center;gap:5px;min-height:33px;padding:0 12px;flex:none}#phone .stk-order>header h2{font-size:14px;margin-right:auto}#phone .stk-close{width:32px;min-height:32px;font-size:22px;color:var(--cp-muted)}
#phone .stk-order-scroll{padding:0 13px 12px;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
#phone .stk-sides{display:flex;background:var(--cp-soft);border-radius:10px;padding:3px;margin:7px 0}#phone .stk-sides button{flex:1;min-height:33px;font-size:12px;border-radius:8px;color:var(--cp-muted)}#phone .stk-sides .selected.buy{background:color-mix(in srgb,var(--cp-up) 14%,transparent);color:var(--cp-up);font-weight:700}#phone .stk-sides .selected.sell{background:color-mix(in srgb,var(--cp-down) 14%,transparent);color:var(--cp-down);font-weight:700}
#phone .stk-control{display:flex;justify-content:space-between;align-items:center;width:100%;min-height:44px;border-bottom:1px solid var(--cp-border);font-size:11px;text-align:left;padding:0}#phone .stk-control>span{color:var(--cp-muted)}#phone .stk-control>strong{color:var(--cp-accent);font-weight:600}
#phone .stk-field{display:block;font-size:11px;color:var(--cp-muted);margin:12px 0 7px}#phone .stk-field>span{display:flex;align-items:center;background:var(--cp-soft);border:1px solid var(--cp-border);border-radius:10px;padding:0 9px;margin-top:5px;min-height:43px}#phone .stk-field input{width:100%;min-width:0;flex:1;border:0;background:none;color:var(--cp-text);font-size:16px;min-height:41px;outline-offset:0}#phone .stk-field em{font-style:normal;font-size:11px;padding-left:7px}
#phone .stk-allocation{margin-top:10px}#phone .stk-allocation label{font-size:10px;display:flex;justify-content:space-between;gap:6px;color:var(--cp-muted)}#phone .stk-allocation strong{font-weight:500;color:var(--cp-accent)}#phone .stk-allocation input{display:block;width:100%;height:27px;accent-color:var(--cp-accent);margin:0}#phone .stk-ratio-presets{display:flex;justify-content:space-between}#phone .stk-ratio-presets button{min-height:27px;font-size:10px;color:var(--cp-muted);padding:0 6px}#phone .stk-allocation small{display:block;font-size:9px;color:var(--cp-muted);margin-top:3px}
#phone .stk-kv{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:9px 0;border-bottom:1px solid var(--cp-border);font-size:10px;line-height:1.6}#phone .stk-kv>span{color:var(--cp-muted);flex:none;max-width:45%}#phone .stk-kv strong{text-align:right;font-weight:550;overflow-wrap:anywhere}
#phone .stk-note{font-size:10px;line-height:1.7;color:var(--cp-muted);margin:9px 0}#phone .stk-error{font-size:11px;line-height:1.6;color:var(--cp-down);margin-top:7px}#phone .stk-error:empty{display:none}
#phone .stk-order-footer{display:flex;flex:none;gap:7px;padding:9px 12px;border-top:1px solid var(--cp-border);background:var(--cp-bg)}#phone .stk-primary,#phone .stk-secondary{flex:1;min-height:42px;border-radius:10px;font-size:12px;font-weight:600;padding:0 12px}#phone .stk-primary{background:var(--cp-cta);color:var(--cp-cta-ink)}#phone .stk-secondary{background:var(--cp-soft);color:var(--cp-accent);border:1px solid var(--cp-border)}#phone .stk-primary:disabled{opacity:.4;cursor:not-allowed}#phone .sheet>.stk-primary{width:100%;margin-top:10px}
#phone .stk-choice{display:grid;width:100%;text-align:left;padding:12px;gap:4px;border-bottom:1px solid var(--cp-border);font-size:14px}#phone .stk-choice small{font-size:12px;color:var(--cp-muted)}
#phone .stk-protect-top{display:flex;justify-content:space-between;align-items:center;gap:10px}#phone .stk-protect-top p{font-size:12px;color:var(--cp-muted)}#phone .stk-protect-top button{color:var(--cp-accent);font-size:12px}
#phone .stk-return{font-size:12px;color:var(--cp-accent);text-align:left;margin-bottom:8px}
#phone[data-theme="dark"] .stk-trade-buttons button{color:#000}
@keyframes stk-order-in{from{opacity:.7;transform:translateY(16px)}to{opacity:1;transform:none}}@keyframes stk-pop{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media(max-width:360px){#phone.is-stock-trading #screen{padding:8px 9px}#phone .stk-header{gap:3px}#phone .stk-asset strong{font-size:18px}#phone .stk-ai{font-size:10px;padding:0 5px}#phone .stk-quote{gap:3px}#phone .stk-quote .stk-small{font-size:9px}#phone .stk-information{height:118px}}
@media(prefers-reduced-motion:reduce){#phone .stk-order,#phone .stk-period-picker{animation:none!important;scroll-behavior:auto}}

#phone .stk-funding-link{font-size:11px;color:var(--cp-accent);text-align:left;padding:0;min-height:36px}
#phone .stk-protection-overlay .sheet{max-height:100%;overflow:auto;padding-bottom:14px}
#phone .stk-protection-overlay .handle{min-height:22px;height:22px;cursor:ns-resize;touch-action:none;position:sticky;top:-4px;z-index:3;background:var(--cp-bg);border-radius:0;display:flex;justify-content:center;align-items:center}
#phone .stk-protection-overlay .handle:after{content:"";display:block;width:35px;height:4px;border-radius:99px;background:var(--cp-muted);opacity:.45}
#phone .stk-protection-overlay .stk-primary{position:sticky;bottom:0;width:100%;min-height:44px}
#phone .stk-protection-overlay .v9-shortcuts button:disabled{opacity:.35;cursor:not-allowed}
#phone[data-theme="dark"] .stk-protection-overlay .v9-shortcuts button{color:var(--cp-up)}
#phone[data-theme="dark"] .stk-protection-overlay .v9-protect-block.loss .v9-shortcuts button{color:var(--cp-down)}

/* V18: Stock and perpetuals use the same chart card and draggable order hierarchy. */
#phone #stock-order-inline{position:absolute;inset-inline:0;bottom:0;z-index:55;width:100%;height:var(--stk-order-height,49%);margin:0;min-width:0;grid-column:auto;overflow:hidden;background:var(--cp-card);border-radius:27px 27px 0 0;box-shadow:0 -12px 32px #172E2B25}
#phone #stock-order-inline:empty{display:none}
#phone #stock-order-inline .cp-inline-modal{height:100%;max-height:100%;min-height:0;overflow:hidden;display:flex;flex-direction:column;border:0;border-radius:27px 27px 0 0;box-shadow:none;color-scheme:inherit}
#phone #stock-order-inline .cp-modal-head{flex:none;position:static;padding:8px 16px 8px;gap:7px;min-height:57px;margin:0;border-bottom:0}
#phone #stock-order-inline .cp-modal-head>div:first-child{min-width:0;flex:1}
#phone #stock-order-inline .cp-eyebrow{display:none}
#phone #stock-order-inline .cp-modal-head h2{margin:0;font-size:16px}
#phone #stock-order-inline .cp-close{order:-1;width:42px;min-width:42px;height:42px;min-height:42px;margin-right:3px}
#phone #stock-order-inline .cp-modal-body{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;padding:8px 18px calc(30px + env(safe-area-inset-bottom));scrollbar-width:none}
#phone #stock-order-inline .v8-grip{display:grid;place-items:center;flex:none;width:100%;height:28px;touch-action:none;cursor:ns-resize;outline-offset:-2px}
#phone #stock-order-inline .v8-grip span{display:block;height:5px;width:40px;border-radius:999px;background:var(--cp-border)}
#phone #stock-order-inline .v8-view-toggle{display:flex;gap:4px;flex:none}
#phone #stock-order-inline .v8-view-toggle button{display:grid;place-items:center;gap:0;min-width:40px;min-height:44px;border-radius:13px;background:var(--cp-soft);color:var(--cp-muted);font-size:20px;line-height:1}
#phone #stock-order-inline .v8-view-toggle button span{font-size:9px;line-height:1.1}
#phone #stock-order-inline .v8-view-toggle button.active{background:var(--cp-tint);color:var(--cp-accent)}
#phone[data-stock-order-open="true"] #screen{overflow:hidden;scrollbar-width:none}
#phone[data-stock-order-open="true"] .cp-onboarding,#phone[data-stock-order-open="true"] .cp-guide,#phone[data-stock-order-open="true"] .cp-information,#phone[data-stock-order-open="true"] .cp-extra-tools,#phone[data-stock-order-open="true"] .cp-bottom-links,#phone[data-stock-order-open="true"] .v4-contract-tools,#phone[data-stock-order-open="true"] .cp-trade-dock{display:none}
#phone[data-stock-order-open="true"] .cp-dashboard .cp-topbar{margin:0 0 6px}
#phone[data-stock-order-open="true"] .cp-dashboard .cp-terminal-grid{display:block}
#phone[data-stock-order-open="true"] .cp-dashboard .cp-chart-module{height:auto;min-height:0;max-height:calc(100dvh - var(--stk-order-height,49vh) - 67px);overflow:hidden;padding:7px 10px;margin:0;background:var(--cp-bg);border:0;border-radius:0;box-shadow:none}
#phone[data-stock-order-open="true"] .cp-dashboard .cp-chart{height:clamp(75px,calc(100dvh - var(--stk-order-height,49vh) - 185px),360px);min-height:0;max-height:360px;object-fit:contain}
#phone[data-stock-order-open="true"] .cp-dashboard .cp-chart-foot,#phone[data-stock-order-open="true"] .cp-dashboard .cp-stats{display:none}
#phone[data-stock-order-open="true"] .cp-dashboard .cp-quote>div>strong{font-size:22px}
#phone[data-stock-order-open="true"] .cp-dashboard .v7-indicator-select{margin-top:2px;padding-top:5px}
#phone[data-stock-order-full="true"] .cp-chart-module,#phone[data-stock-order-full="true"] #stock-order-book{display:none!important}
#phone[data-stock-order-full="true"] #stock-order-inline{border-radius:0}
#phone[data-stock-order-full="true"] #stock-order-inline .cp-inline-modal{border-radius:0}
#phone[data-stock-order-view="book"][data-stock-order-open="true"] .cp-chart-module{display:none}
#phone.is-stock-trading #screen{padding:12px 15px 10px;overflow:auto;min-height:0}
#phone.is-stock-trading .stk-shell{display:block;height:auto;min-height:0;gap:0;padding-bottom:0}
#phone.is-stock-trading .stk-shell .cp-terminal-grid{display:grid;grid-template-columns:1fr;gap:0}
#phone.is-stock-trading .stk-shell .cp-chart-module{display:block;position:relative}
#phone.is-stock-trading .stk-shell .stk-chart-svg{width:100%;height:auto;min-height:160px;max-height:none;object-fit:contain}
#phone.is-stock-trading .stk-shell .cp-chart-periods button{flex:none;min-height:44px}
#phone.is-stock-trading .stk-shell .cp-chart-periods .v7-more-period{margin-left:auto;white-space:nowrap}
#phone.is-stock-trading .stk-shell .cp-chart-tools{max-width:142px}
#phone.is-stock-trading .stk-quote-status{font-size:10px;color:var(--cp-muted)}
#phone.is-stock-trading .stk-identity{background:var(--cp-soft);color:var(--cp-muted);min-width:103px;height:44px;padding:0 8px;border:1px solid var(--cp-border);border-radius:24px;font-size:10px}
#phone.is-stock-trading .stk-shell .cp-information{display:block}
#phone.is-stock-trading .stk-shell .cp-trade-dock{display:grid}
#phone[data-stock-order-open="true"] #screen{overflow:hidden;scrollbar-width:none}
#phone[data-stock-order-open="true"] .stk-shell .cp-information,#phone[data-stock-order-open="true"] .stk-shell .cp-trade-dock,#phone[data-stock-order-open="true"] .stk-shell .v4-contract-tools{display:none}
#phone[data-stock-order-open="true"] .stk-shell .cp-topbar{margin:0 0 6px}
#phone[data-stock-order-open="true"] .stk-shell .cp-terminal-grid{display:block}
#phone[data-stock-order-open="true"] .stk-shell .cp-chart-module{max-height:calc(100dvh - var(--stk-order-height,49vh) - 67px);padding:7px 10px;margin:0;background:var(--cp-bg);border:0;border-radius:0;box-shadow:none;overflow:hidden}
#phone[data-stock-order-open="true"] .stk-shell .stk-chart-svg{height:clamp(75px,calc(100dvh - var(--stk-order-height,49vh) - 185px),360px);min-height:0;max-height:360px}
#phone[data-stock-order-open="true"] .stk-shell .cp-chart-foot{display:none}
#phone[data-stock-order-open="true"] .stk-shell .cp-quote>div>strong{font-size:22px}
#phone[data-stock-order-open="true"] .stk-shell .v7-indicator-select{margin-top:2px;padding-top:5px}
#phone[data-stock-order-view="book"][data-stock-order-open="true"] .stk-shell .cp-chart-module{display:none}
#phone[data-stock-order-view="chart"] #stock-order-book{display:none}
#phone #stock-order-book{max-height:calc(100dvh - var(--stk-order-height,49vh) - 100px);overflow:auto;padding:8px 12px;background:var(--cp-bg);scrollbar-width:none}
#phone[data-stock-order-full="true"] .stk-shell .cp-chart-module,#phone[data-stock-order-full="true"] #stock-order-book{display:none!important}
#phone #stock-order-inline .stk-order{height:100%;max-height:100%;min-height:0;display:flex;flex-direction:column;background:var(--cp-card);animation:stk-order-in .22s ease-out}
#phone #stock-order-inline .cp-modal-body{display:flex;flex-direction:column;overflow:hidden;padding:0}
#phone #stock-order-inline .stk-order-scroll{flex:1;min-height:0;overflow:auto;padding:7px 18px 16px}
#phone #stock-order-inline .stk-order-footer{padding:9px 18px calc(12px + env(safe-area-inset-bottom));background:var(--cp-card)}
#phone:has(#overlay .stk-protection-overlay) #stock-order-inline{visibility:hidden}
#phone[data-stock-order-open="true"]:has(#overlay .stk-protection-overlay) .cp-chart-module{display:block}
#phone[data-stock-order-open="true"]:has(#overlay .stk-protection-overlay) .stk-chart-svg{height:clamp(75px,calc(100dvh - 58vh - 185px),360px)}
@media(max-width:360px){#phone.is-stock-trading #screen{padding:12px 12px 0}#phone[data-stock-order-open="true"] .stk-shell .stk-chart-svg{height:clamp(64px,calc(100dvh - var(--stk-order-height,49vh) - 165px),300px)}}
