/* Market-linked research workbook; visually separate from price canvas. */
.atlas-excel-workspace{border:1px solid var(--border,#334252);border-radius:12px;margin:12px 0 2px;padding:14px;background:var(--panel,#111c28);color:var(--text,#dae3e9);max-width:100%;min-width:0}
.atlas-excel-workspace[hidden]{display:none!important}
.excel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.excel-head h3{font-size:17px;margin:0 0 4px}
.excel-head p,.excel-hint{font-size:12px;opacity:.76;margin:3px 0}
.excel-hint[data-error="true"]{color:#e9a3a3;opacity:1}
.excel-controls{display:flex;align-items:flex-end;flex-wrap:wrap;gap:8px;margin:12px 0}
.excel-controls label{display:flex;flex-direction:column;font-size:11px;gap:4px;min-width:145px;flex:1}
.excel-controls .button{min-height:34px}
.excel-editbar{display:flex;align-items:flex-end;flex-wrap:wrap;gap:8px;margin:10px 0}
.excel-editbar label{display:flex;flex-direction:column;gap:4px;font-size:11px}
.excel-editbar label:nth-child(2){flex:1;min-width:150px}
.excel-editbar #atlasExcelAddress{max-width:90px}
.excel-editbar #atlasExcelColor{width:38px;height:34px;border:1px solid #556;background:transparent;padding:2px;border-radius:5px}
.excel-scroll{max-height:435px;overflow:auto;min-height:150px;background:#f8fafb;color:#243444;border:1px solid #728091;border-radius:8px;margin:10px 0;overscroll-behavior:contain}
.excel-grid{border-collapse:separate;border-spacing:0;min-width:100%;font:12px/1.4 'Segoe UI',Arial,sans-serif;table-layout:auto}
.excel-grid td,.excel-grid th{border-right:1px solid #d7dfe5;border-bottom:1px solid #dde4e9;min-width:91px;height:27px;max-width:235px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:4px 7px;user-select:none}
.excel-grid th{font-weight:600;background:#e6edf3;color:#475967;position:sticky;top:0;z-index:3;text-align:center}
.excel-grid th.excel-rownum{min-width:48px;width:48px;position:sticky;left:0;z-index:4}
.excel-grid tbody th.excel-rownum{z-index:2}
.excel-grid td{cursor:cell;background:var(--excel-highlight,#fff)}
.excel-grid td.excel-edited{font-weight:600}
.excel-grid td.excel-current{outline:2px solid #18837d;outline-offset:-2px;position:relative;z-index:1}
.excel-grid td.excel-selected:not(.excel-current){box-shadow:inset 0 0 0 2px #72a8ca}
body[data-atlas-main-tab="excel"] .centerpane{min-width:0}
@media(max-width:820px){.excel-controls{align-items:stretch}.excel-controls label{min-width:130px}.excel-head h3{font-size:15px}.atlas-excel-workspace{padding:9px}}
/* Excel tab gets the full width. The shared chart stays above the sheet. */
body[data-atlas-main-tab="excel"] .workspace{display:grid!important;grid-template-columns:minmax(0,1fr)!important}
body[data-atlas-main-tab="excel"] .centerpane{grid-column:1!important;grid-row:1!important;min-width:0}
body[data-atlas-main-tab="excel"] .sidebar,
body[data-atlas-main-tab="excel"] #atlasResearchDock{display:none!important}
body[data-atlas-main-tab="excel"] .canvas-wrap{height:min(41dvh,480px);min-height:245px}
body[data-atlas-main-tab="excel"] .info-strip,
body[data-atlas-main-tab="excel"] .hint{display:none}
body[data-atlas-main-tab="excel"] #atlasExcelWorkspace{display:block!important}

/* v0.42: virtualized, continuously scrollable grid. */
.excel-virtual-canvas{position:relative;min-width:100%;min-height:100%;}
.excel-grid{position:absolute;min-width:0;table-layout:fixed;}
.excel-grid td,.excel-grid th{box-sizing:border-box;min-width:113px;width:113px;max-width:113px;height:29px;max-height:29px;padding:3px 6px;}
.excel-grid th.excel-rownum{box-sizing:border-box;min-width:50px;width:50px;max-width:50px;}
.excel-grid thead th{height:31px;max-height:31px;}
.excel-grid-settings{align-items:end;border-top:1px solid var(--border,#334252);padding-top:9px;}
.excel-grid-settings label{min-width:112px;max-width:170px;}
.excel-inline-input{width:100%;height:100%;padding:1px 3px;margin:0;border:1px solid #218e8c;background:#fff;color:#132435;font:inherit;box-sizing:border-box;}
body[data-atlas-excel-layout="overlay"] #atlasExcelWorkspace{position:fixed;right:14px;top:105px;width:min(54vw,950px);height:min(78vh,800px);z-index:999;box-shadow:0 12px 45px #0009;overflow:auto;resize:both;}
body[data-atlas-excel-layout="overlay"] #atlasExcelViewport{max-height:min(48vh,520px);}
body[data-atlas-excel-layout="overlay"] .canvas-wrap{height:min(76vh,780px)}

body[data-atlas-excel-layout="overlay"] #atlasExcelDragHandle{cursor:move;user-select:none;border-bottom:1px solid #324960;padding-bottom:8px;}

/* v0.43: independent floating Excel overlay, survives tab changes and
   escapes chart-panel clipping by being portaled directly under <body>. */
body[data-atlas-excel-layout="overlay"] #atlasExcelWorkspace{display:block!important;position:fixed!important;z-index:1500!important;min-width:min(340px,96vw);min-height:220px;max-width:96vw;max-height:90vh;overflow:auto;overscroll-behavior:contain;border:1px solid #83b6df;box-shadow:0 18px 50px #07101ddd;resize:both}
body[data-atlas-excel-layout="overlay"] #atlasExcelDragHandle{position:sticky;top:0;background:var(--panel,#12293e);z-index:15;padding:5px 0 9px;cursor:move;user-select:none}
.excel-window-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.excel-window-actions .button{white-space:nowrap}
.atlas-excel-float-tool[aria-pressed="true"]{border-color:#d7b56d;background:#2c435d;color:#fff3d7}
@media(max-width:650px){body[data-atlas-excel-layout="overlay"] #atlasExcelWorkspace{width:96vw!important;height:65vh!important;right:2vw!important;left:unset!important;top:100px!important}}
