/* Chart card shares the existing viewport. Never grow the document. */
/* Bound the research list; the chart receives the remaining desktop width. */
.market-workspace{display:grid;grid-template-columns:clamp(490px,36%,540px) minmax(0,1fr);gap:var(--gap);min-width:0;min-height:0;overflow:hidden}
#chart-slot{display:flex;min-width:0;min-height:0;overflow:hidden}
.native-chart{height:100%;width:100%;min-width:0;min-height:0}
.native-chart .card-head{min-height:33px;padding:5px 9px}
.chart-actions{display:flex;gap:5px;align-items:center}
.chart-stats{display:flex;align-items:center;flex-wrap:wrap;gap:8px 13px;padding:5px 10px;flex-shrink:0;white-space:nowrap}
.chart-stats>strong{font-size:19px;font-variant-numeric:tabular-nums;color:var(--text)}
.chart-stats>span{font-size:9px;color:var(--muted)}
.chart-stats b{font-size:10px;font-variant-numeric:tabular-nums}
.chart-tools{display:flex;align-items:center;gap:6px;min-height:35px;padding:4px 8px;flex-shrink:0;overflow-x:auto;scrollbar-width:thin;border-bottom:1px solid var(--line);white-space:nowrap}
.chart-tools>div{display:flex;gap:2px}
.chart-tools button,.chart-tools select{font-size:10px;min-height:24px;padding:3px 6px}
.chart-tools button[aria-pressed=true]{border-color:#477469;color:var(--teal);background:#1a322d}
.chart-tools label{font-size:9px;display:flex;align-items:center;gap:2px;white-space:nowrap}
.chart-tools input{margin:0}
.chart-rsi-value{color:var(--violet);font:10px ui-monospace,monospace;font-variant-numeric:tabular-nums;min-width:6ch;text-align:right;flex-shrink:0}
.chart-plan-row{display:flex;gap:8px;align-items:center;margin-left:auto;min-width:0;max-width:100%;min-height:29px;padding:0}
.chart-plan-row select{max-width:190px;min-width:100px;padding:3px 5px;font-size:9px}
.chart-plan-row span{font-size:9px;color:var(--dim);max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chart-surface{position:relative;flex:1;min-height:0;overflow:hidden}
#chart-canvas{position:absolute;inset:0;min-width:0;min-height:0}
/* Dashboard data-table cells must not size the library's pane/separator table. */
#chart-canvas :is(td,th){padding:0;border:0;height:auto;position:static}
#chart-canvas tbody tr:hover{background:transparent}
.chart-empty{position:absolute;inset:25% 16% 20%;display:flex;align-items:center;justify-content:center;text-align:center;pointer-events:none;color:var(--muted);font-size:11px}
#chart-legend{position:absolute;top:6px;left:9px;font:10px ui-monospace,monospace;color:var(--text);pointer-events:none;max-width:calc(100% - 80px);overflow:hidden;white-space:nowrap;background:#111923b0}
.chart-credit{font-size:8px;min-height:20px;padding:2px 9px;overflow:hidden;white-space:nowrap}
.chart-credit a{color:var(--dim);text-decoration:none}
.market-workspace .candidate-card:not(.expanded) .card-head{min-height:32px;padding:4px 8px}
.market-workspace .candidate-card:not(.expanded) :is(th,td){padding:4px}
.market-workspace .candidate-card:not(.expanded) th{font-size:9px;letter-spacing:0}
.market-workspace .candidate-card:not(.expanded) td{height:36px;font-size:10.5px;line-height:1.35}
.market-workspace .candidate-card:not(.expanded) td small{font-size:8.5px;line-height:1.35}
.market-workspace .candidate-card:not(.expanded) .token b{font-size:10.5px}
.market-workspace .candidate-card:not(.expanded) .timing-label{font-size:9px}
.market-workspace .candidate-card:not(.expanded) .badge{padding:1px 4px;font-size:8px;letter-spacing:0}
.market-workspace .candidate-card:not(.expanded) .toolbar{gap:4px;padding:4px 6px}
.market-workspace .candidate-card:not(.expanded) .toolbar small,.market-workspace .candidate-card:not(.expanded) .toolbar .spacer{display:none}
.market-workspace .candidate-card:not(.expanded) .toolbar :is(input,select,button){min-height:26px;padding:3px 6px;font-size:10px}
.market-workspace .candidate-card:not(.expanded) .toolbar input{max-width:none;min-width:60px}
.market-workspace .candidate-card:not(.expanded) .toolbar select{max-width:92px}
.market-workspace .candidate-card:not(.expanded) .card-foot{padding:3px 8px;font-size:8.5px}
.market-workspace .candidate-card:not(.expanded) .card-foot span:last-child{display:none}
@media(max-width:1100px),(max-height:580px){
 .candidate-layout{grid-template-rows:29px minmax(0,1fr);gap:6px}
 .candidate-layout .focus-tabs{display:flex;gap:5px;overflow:auto}
 .focus-tabs button{padding:3px 10px;font-size:10px}
 .focus-tabs button.active{color:var(--teal);border-color:#3b6c5f}
 .market-workspace{grid-row:2;grid-template-columns:minmax(0,1fr)}
 .candidate-layout .bottom-cards{display:contents}
 .candidate-layout .bottom-cards>.card{display:none}
 .candidate-layout[data-focus=candidates] .market-workspace>.candidate-card{display:flex}
 .candidate-layout[data-focus=candidates] #chart-slot{display:none}
 .candidate-layout[data-focus=chart] .market-workspace>.candidate-card{display:none}
 .candidate-layout[data-focus=chart] #chart-slot{display:flex}
 .candidate-layout:not([data-focus=candidates]):not([data-focus=chart]) .market-workspace{display:none}
 .candidate-layout[data-focus=evidence] .bottom-cards>.evidence-card,.candidate-layout[data-focus=providers] .bottom-cards>.providers-card,.candidate-layout[data-focus=queue] .bottom-cards>.queue-card{display:flex;grid-row:2}
 .chart-stats{gap:9px}
 .native-chart .card-head{min-height:30px}
}
@media(min-width:1101px) and (min-height:581px){.candidate-layout .focus-tabs{display:none}}
@media(max-width:500px){.chart-credit{font-size:7px;gap:4px}.chart-stats>strong{font-size:16px}.chart-stats{gap:8px}.chart-plan-row span{font-size:8px}.chart-stats>span{font-size:8px}}
@media(max-width:500px) and (min-height:581px){
 .chart-tools{flex-wrap:wrap;overflow-x:hidden;white-space:normal;gap:5px;padding:5px 8px}
 .chart-tools>div{flex:1 0 100%}
 .chart-tools>div button{flex:1}
 .chart-tools select{flex:1 1 calc(50% - 3px);min-width:0;max-width:none}
 .chart-tools label{min-height:24px}
 .chart-surface{min-height:220px}
}
@media(max-height:440px){
 .native-chart .card-head{min-height:26px;padding:2px 8px}
 .chart-stats{padding:2px 8px;line-height:1.2}
 .chart-stats>strong{font-size:15px}
 .chart-tools{min-height:27px;padding:1px 6px}
 .chart-tools button,.chart-tools select{min-height:22px;padding:1px 4px}
 .chart-plan-row{min-height:23px;padding:0}
 .chart-credit{min-height:16px;padding:1px 8px}
}

.native-chart.expanded{width:auto;height:auto}
/* Seven compact columns; expanded-only columns remain in the same table. */
.market-table{min-width:480px;table-layout:fixed}
.market-table :is(th,td){white-space:nowrap}
.candidate-card:not(.expanded) .market-table th:nth-child(1){width:20.5%}
.candidate-card:not(.expanded) .market-table th:nth-child(2){width:13.5%}
.candidate-card:not(.expanded) .market-table th:nth-child(3){width:11.5%}
.candidate-card:not(.expanded) .market-table th:nth-child(4){width:12%}
.candidate-card:not(.expanded) .market-table th:nth-child(5){width:13.5%}
.candidate-card:not(.expanded) .market-table th:nth-child(6){width:15%}
.candidate-card:not(.expanded) .market-table th:nth-child(7){width:14%}
.market-table .token{gap:4px;min-width:0}
.market-table .token>div{min-width:0}
.market-table .token b{display:block;max-width:100px;overflow:hidden;text-overflow:ellipsis}
.market-table .token small{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.market-table .checks-cell{white-space:normal;overflow-wrap:anywhere;vertical-align:middle}
.market-table .checks-cell .badge{max-width:100%}
.market-table .checks-count{white-space:nowrap}
/* Hide detail columns only in the compact card, never remove their values. */
.candidate-card:not(.expanded) :is(.expanded-column,.expanded-detail){display:none}
.candidate-card.expanded .market-table{min-width:1080px;table-layout:auto}
.candidate-card.expanded .market-table .token b{max-width:240px}
.watch-star{padding:1px 3px!important;min-height:22px!important;min-width:22px;flex-shrink:0;border:0;background:transparent;color:var(--muted);font-size:16px!important}
.watch-star.saved{color:var(--teal)}.research-score>small{display:block}.research-score .score-unit{display:inline;font-size:8px;margin-left:2px;color:var(--dim)}
.timing-label{font-size:10px}.market-cap{font-weight:600}.timing-reason{font-size:10px;line-height:1.4}
.safety-check{display:grid;grid-template-columns:1fr auto;gap:4px;padding:8px;border-bottom:1px solid var(--line)}
.safety-check small{grid-column:1/-1;color:var(--muted);line-height:1.4}.research-score{font-variant-numeric:tabular-nums}
/* An open AI drawer must not take the chart's majority share. The list can scroll internally. */
@media(min-width:1101px) and (min-height:581px){.workspace.ai-open .market-workspace{grid-template-columns:minmax(280px,36%) minmax(0,1fr)}}
