/* Desktop home: independent price chart and smart-money chart, shared symbol. */
@media(min-width:1000px){
 :root{--side:310px;--dock:330px}
 body:not(.mobile-app) .appbar{height:48px;padding:0 16px;gap:28px}
 body:not(.mobile-app) .appbar .brand{min-width:155px}
 body:not(.mobile-app) .appbar nav{gap:4px}
 body:not(.mobile-app) .appbar nav button{min-width:88px;padding:5px 14px}
 body:not(.mobile-app) .appbar [data-view=opportunities]{display:none}
 body:not(.mobile-app) .toolbar{height:42px;padding:0 14px;gap:6px}
 body:not(.mobile-app) .toolbar button,body:not(.mobile-app) .toolbar .button{font-size:11px;padding:5px 9px}
 body:not(.mobile-app) .toolbar #periods{min-width:0;overflow-x:auto;scrollbar-width:none;gap:3px;flex-shrink:1}
 body:not(.mobile-app) .toolbar #periods button{flex-shrink:0}
 body:not(.mobile-app) .toolbar #market-name,body:not(.mobile-app) .toolbar>.divider{display:none}
 body:not(.mobile-app) .toolbar .symbol-picker{min-width:120px}
 body:not(.mobile-app) .chart-tool-group{flex-shrink:0}
 body:not(.mobile-app) .chart-tool-actions{margin-left:auto;flex-shrink:0}
 body:not(.mobile-app) .terminal{padding:0;grid-template-columns:minmax(0,1fr) 5px var(--side)}
 body:not(.mobile-app) .terminal-center{grid-template-rows:minmax(280px,1fr) 5px minmax(240px,var(--dock));overflow:auto}
 body:not(.mobile-app) .chart-panel{border-left:0;border-right:0}
 body:not(.mobile-app) .chart-title{min-height:32px;padding:8px 16px 4px;gap:12px}
 body:not(.mobile-app) .chart-title strong{font-size:12px}
 body:not(.mobile-app) .top-ratios{margin:0 16px;padding:7px 0;gap:16px}
 body:not(.mobile-app) .chart-legend{padding:6px 16px;gap:20px;min-height:28px;flex-wrap:wrap}
 body:not(.mobile-app) .chart-controls{padding:4px 12px;min-height:32px;gap:5px}
 body:not(.mobile-app) .chart-controls button,body:not(.mobile-app) .chart-controls .custom-select-trigger{font-size:10px;padding:3px 8px;min-height:25px}
 body:not(.mobile-app) .chart-footer{height:24px;padding:0 16px;font-size:10px}
 body:not(.mobile-app) .chart-footer>span:first-child,body:not(.mobile-app) #related-news{display:none}
 body:not(.mobile-app) .dock:has(#smart-distribution){border:0;border-top:1px solid var(--line);overflow:auto}
 body:not(.mobile-app) .dock:has(#smart-distribution)>.panel-header,body:not(.mobile-app) .dock:has(#smart-distribution)>#dock-body{display:none}
 body:not(.mobile-app) #smart-distribution{display:grid;grid-template-columns:minmax(0,1fr) 250px;column-gap:22px;padding:0 16px 10px;margin:0;border:0;flex:1;min-height:0}
 body:not(.mobile-app) #smart-distribution .smart-summary{grid-column:1/-1}
 body:not(.mobile-app) #smart-distribution .smart-summary>header{min-height:39px;margin:0;padding:5px 0;border-bottom:1px solid var(--line)}
 body:not(.mobile-app) #smart-distribution h2{font-size:14px;font-weight:500}
 body:not(.mobile-app) #smart-distribution .smart-summary nav button{min-height:28px;padding:3px 0;font-size:12px}
 body:not(.mobile-app) #smart-distribution .smart-history{--smart-plot-height:180px;display:grid;grid-template-columns:1fr auto;border:0;margin:0;align-content:start;min-width:0}
 body:not(.mobile-app) #smart-distribution .smart-history-controls{grid-column:1;min-width:0}
 body:not(.mobile-app) #smart-distribution .smart-history-controls nav{gap:18px;border:0}
 body:not(.mobile-app) #smart-distribution .smart-history-controls button{min-height:34px;font-size:11px}
 body:not(.mobile-app) #smart-distribution .smart-history-meta{grid-column:2;min-height:34px;gap:12px}
 body:not(.mobile-app) #smart-distribution .smart-history-meta nav{gap:14px}
 body:not(.mobile-app) #smart-distribution .smart-history-meta button{min-height:34px;font-size:11px}
 body:not(.mobile-app) #smart-distribution .smart-history-meta time{font-size:10px}
 body:not(.mobile-app) #smart-distribution .smart-history-readout{grid-column:1/-1;padding:5px 0 7px}
 body:not(.mobile-app) #smart-distribution .smart-history-readout>div{display:flex;align-items:baseline;gap:10px}
 body:not(.mobile-app) #smart-distribution .smart-history-readout>div:last-child{justify-content:flex-end}
 body:not(.mobile-app) #smart-distribution .smart-history-readout strong{font-size:19px}
 body:not(.mobile-app) #smart-distribution .smart-history canvas,body:not(.mobile-app) #smart-distribution .smart-history-status{grid-column:1/-1}
 body:not(.mobile-app) #smart-distribution .smart-details{border-left:1px solid var(--line);padding:16px 0 0 18px;align-self:stretch}
 body:not(.mobile-app) #smart-distribution .smart-direction{font-size:11px;flex-wrap:wrap;row-gap:8px}
 body:not(.mobile-app) #smart-distribution .smart-direction>span:nth-child(2){order:-1;width:100%;font-size:11px}
 body:not(.mobile-app) #smart-distribution .smart-data-row{grid-template-columns:1fr 1fr;padding:13px 0;border-bottom:1px solid var(--faint);row-gap:8px;font-size:12px}
 body:not(.mobile-app) #smart-distribution .smart-data-row>span{grid-column:1/-1;font-size:11px}
 body:not(.mobile-app) #smart-distribution .smart-data-row strong:nth-child(2){text-align:left}
 body:not(.mobile-app) .inspector .panel-header{height:38px;min-height:38px;padding:4px 12px}
 body:not(.mobile-app) .inspector .segments button{padding:4px 9px;font-size:11px}
 body:not(.mobile-app) .watch-heading,body:not(.mobile-app) .watch-row{grid-template-columns:minmax(0,1fr) 85px 68px;padding-left:16px;padding-right:16px}
 body:not(.mobile-app) .watch-row{min-height:35px;font-size:11px}
 body:not(.mobile-app) .watchlist{max-height:42%;min-height:120px}
 body:not(.mobile-app) .instrument{padding:16px;min-height:200px}
 body:not(.mobile-app) .instrument .quote{font-size:28px;margin-top:12px}
 body:not(.mobile-app) .instrument .data-pairs{gap:12px 8px;margin:0;font-size:11px}
 body:not(.mobile-app) .statusbar{height:23px;border-top:1px solid var(--line)}
}
@media(min-width:1000px) and (max-width:1250px){
 body:not(.mobile-app) #smart-distribution{grid-template-columns:minmax(0,1fr) 190px;gap:14px}
 body:not(.mobile-app) #smart-distribution .smart-history{grid-template-columns:1fr}
 body:not(.mobile-app) #smart-distribution .smart-history-meta{grid-column:1}
 body:not(.mobile-app) #smart-distribution .smart-history-controls nav{gap:16px}
 body:not(.mobile-app) .toolbar #crosshair{display:none}
}
@media(min-width:1000px){
 /* Keep the existing indicator panes intact; short windows scroll the workspace. */
 body:not(.mobile-app) .terminal-center{grid-template-rows:minmax(500px,1fr) 5px minmax(310px,var(--dock))}
}
@media(min-width:1000px){
 :root[data-theme=day] body:not(.mobile-app) .chart-empty{background:var(--bg);color:var(--muted)}
 :root[data-theme=day] body:not(.mobile-app) #smart-distribution nav button{background:transparent!important;border-color:transparent!important}
 :root[data-theme=day] body:not(.mobile-app) #smart-distribution nav button[aria-pressed=true]{border-bottom-color:var(--text)!important}
}

/* Each content area owns one vertical scroll; charts never scroll inside charts. */
@media(min-width:1000px){
 body:not(.mobile-app) .terminal-center{grid-template-rows:minmax(calc(110px + var(--chart-min-height,340px)),1fr) 5px max(320px,var(--dock));overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}
 body:not(.mobile-app) .chart-panel{min-height:calc(110px + var(--chart-min-height,340px))}
 body:not(.mobile-app) .canvas-wrap{overflow:visible;min-height:var(--chart-min-height,340px)}
 body:not(.mobile-app) .dock:has(#smart-distribution){overflow:visible;min-height:max(320px,var(--dock))}
 body:not(.mobile-app) #smart-distribution{align-content:start}
 body:not(.mobile-app) #news-view{overflow-y:auto;overflow-x:hidden;display:block}
 body:not(.mobile-app) #news-view .inbox-tabs{position:sticky;top:0;background:var(--bg);z-index:3}
 body:not(.mobile-app) #news-view .smart-message-list{width:100%;max-width:none;margin:0}
 body:not(.mobile-app) #news-view .inbox-heading,body:not(.mobile-app) #news-view .inbox-message{display:grid;grid-template-columns:180px 230px minmax(220px,1fr) 150px;align-items:center;gap:24px;padding:16px}
 body:not(.mobile-app) #news-view .inbox-heading{color:var(--muted);font-size:11px;padding-block:10px;border-bottom:1px solid var(--line)}
 body:not(.mobile-app) #news-view .inbox-message{min-height:66px}
 body:not(.mobile-app) #news-view .inbox-message:hover{background:var(--panel)}
 body:not(.mobile-app) #news-view .inbox-message header{display:contents}
 body:not(.mobile-app) #news-view .inbox-message header button{grid-column:1;grid-row:1;text-align:left;font-size:14px}
 body:not(.mobile-app) #news-view .inbox-message time{grid-column:4;grid-row:1;text-align:right}
 body:not(.mobile-app) #news-view .inbox-heading span:last-child{text-align:right}
 body:not(.mobile-app) #news-view .inbox-kind{grid-column:2;grid-row:1;margin:0;font-size:12px}
 body:not(.mobile-app) #news-view .inbox-message p{grid-column:3;grid-row:1;margin:0;font-size:13px}
 body:not(.mobile-app) #list-view #list-note,body:not(.mobile-app) #screen-coverage,body:not(.mobile-app) #rankings-view .list-footer{display:none}
 body:not(.mobile-app) .table-screens th:last-child,body:not(.mobile-app) .table-screens td:last-child,body:not(.mobile-app) .table-screens col:last-child{display:none}
 body:not(.mobile-app) .table-screens td{padding-block:12px}
 body:not(.mobile-app) .table-screens thead{position:sticky;top:0;z-index:2;background:var(--panel)}
 body:not(.mobile-app) .table-screens th{position:static}
 body:not(.mobile-app) .terminal.focused .terminal-center{grid-template-rows:1fr}
}

/* Screening previews do not expose a second trading-chart toolbar. */
.chart-panel > .chart-controls,.chart-panel > .chart-footer{display:none!important}

/* Home is a viewport workspace, never a vertically scrolling document. */
@media(min-width:1000px){
 body:not(.mobile-app) .terminal-center{overflow:hidden;grid-template-rows:minmax(0,3fr) 5px minmax(0,2fr)}
 body:not(.mobile-app) .terminal-center>.horizontal{cursor:default;pointer-events:none}
 body:not(.mobile-app) .chart-panel{min-height:0;overflow:hidden}
 body:not(.mobile-app) .canvas-wrap{min-height:0;overflow:hidden}
 body:not(.mobile-app) #chart{min-height:0!important;height:100%}
 body:not(.mobile-app) .dock:has(#smart-distribution){min-height:0;overflow:hidden}
 body:not(.mobile-app) #smart-distribution{height:100%;min-height:0;grid-template-rows:39px minmax(0,1fr);align-content:stretch}
 body:not(.mobile-app) #smart-distribution .smart-history{height:100%;min-height:0;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:34px 34px minmax(0,1fr);align-content:stretch}
 body:not(.mobile-app) #smart-distribution .smart-history-controls{grid-column:1;grid-row:1}
 body:not(.mobile-app) #smart-distribution .smart-history-meta{grid-column:2;grid-row:1}
 body:not(.mobile-app) #smart-distribution .smart-history-readout{grid-row:2}
 body:not(.mobile-app) #smart-distribution .smart-history canvas{grid-row:3;height:100%!important;min-height:0;align-self:stretch}
 body:not(.mobile-app) #smart-distribution .smart-details{padding-top:10px;min-height:0}
 body:not(.mobile-app) #smart-distribution .smart-data-row{padding:8px 0;row-gap:4px}
 body:not(.mobile-app) #smart-distribution .smart-history-controls nav{gap:12px}
}

@media(min-width:1000px){
 body:not(.mobile-app) #list-view{padding:0 16px 8px;gap:0}
 body:not(.mobile-app) #category-tabs{min-height:40px;height:40px;gap:18px;overflow-x:auto;scrollbar-width:none;border-bottom:1px solid var(--line)}
 body:not(.mobile-app) #category-tabs button{font-size:13px;padding:8px 0;white-space:nowrap;flex-shrink:0}
 body:not(.mobile-app) #category-tabs button small{font-size:11px;margin-left:5px;color:var(--muted)}
 body:not(.mobile-app) #list-view .filterbar{min-height:52px;height:52px;padding:8px 0;margin:0;gap:16px;align-items:center;border:0}
 body:not(.mobile-app) #list-view .filterbar>label{gap:7px;white-space:nowrap;font-size:12px}
 body:not(.mobile-app) #list-view .filterbar .search-field{order:-1;width:220px;min-width:180px}
 body:not(.mobile-app) #list-view .filterbar select,body:not(.mobile-app) #list-view .filterbar .custom-select-trigger{height:32px;min-height:32px;font-size:12px;border-radius:5px}
 body:not(.mobile-app) #list-view .filterbar .search-field{height:32px}
 body:not(.mobile-app) #screen-controls{display:none!important}
 body:not(.mobile-app) #reset-filters{margin-left:auto}
}

/* Rankings use one compact toolbar instead of three sparse rows. */
body:not(.mobile-app) #rankings-view{padding:0 16px 8px;gap:0}
body:not(.mobile-app) .rank-toolbar{display:flex;align-items:center;gap:16px;min-height:52px;flex-shrink:0;border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none}
body:not(.mobile-app) .rank-toolbar .rank-scope{flex-shrink:0;border:0;gap:16px;min-height:36px}
body:not(.mobile-app) .rank-toolbar .rank-scope button{min-height:36px;font-size:13px;white-space:nowrap}
body:not(.mobile-app) .rank-toolbar #rank-periods{width:auto;display:flex;flex-shrink:0;gap:14px;border:0;border-left:1px solid var(--line);padding:0 0 0 16px;margin:0;min-height:36px}
body:not(.mobile-app) .rank-toolbar #rank-periods button{min-height:36px;padding:0;font-size:13px;white-space:nowrap}
body:not(.mobile-app) .rank-toolbar .rank-direction{display:flex;gap:4px;flex-shrink:0;border-left:1px solid var(--line);padding-left:16px}
body:not(.mobile-app) .rank-toolbar .rank-direction button{height:30px;min-height:30px;padding:0 10px;font-size:13px;border:1px solid var(--line);border-radius:5px}
body:not(.mobile-app) .rank-toolbar .filterbar{margin-left:auto;flex-shrink:0;min-height:0;padding:0;border:0;gap:0}
body:not(.mobile-app) .rank-toolbar .search-field{width:180px;min-width:180px;height:30px}
body:not(.mobile-app) .rank-toolbar .search-field input{width:100%;min-width:0;font-size:13px}
body:not(.mobile-app) .rank-toolbar #rank-status{display:none}
