/* The right panel (assets/side-panel.js): no backdrop; over the page below 1900 px, beside it (the page reflows) from 1900. Under the top bar (95),
   so the bar's menus (Tools, accounts) open over it (Igor 14 Nov «что это» on Tools cut by the panel). */
:root{--tsb-side-panel-width:420px}
.tsb-side-panel{position:fixed;top:var(--ws-topbar-height,58px);right:0;bottom:0;z-index:94;display:flex;flex-direction:column;width:var(--tsb-side-panel-width);border-left:1px solid var(--app-border-soft,#e7e8eb);background:var(--bg-primary,#fff);color:var(--text-primary,#1d1d22);font:400 14px/20px var(--ui-font,'TSB Inter',Inter,sans-serif)}
.tsb-side-panel[hidden]{display:none}
.tsb-side-panel *{box-sizing:border-box}
.tsb-side-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px 20px 14px;border-bottom:1px solid var(--app-border-soft,#e7e8eb)}
.tsb-side-panel-eyebrow{margin:0;color:var(--text-secondary,#6b6b75);font-size:12px;line-height:16px}
.tsb-side-panel-eyebrow[hidden]{display:none}
.tsb-side-panel-head h2{margin:2px 0 0;font-size:20px;line-height:26px;font-weight:600;letter-spacing:-.01em}
.tsb-side-panel-head>div:first-child{flex:1 1 auto;min-width:0}
.tsb-side-panel-sub[hidden]{display:none}
.tsb-side-panel-actions{display:flex;align-items:center;gap:2px;margin:-4px -2px 0 auto}
.tsb-side-panel-actions:empty{display:none}
.tsb-side-panel-actions>a,.tsb-side-panel-actions>button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:0;border-radius:6px;background:transparent;color:var(--text-secondary,#6b6b75);cursor:pointer}
.tsb-side-panel-actions>a:hover,.tsb-side-panel-actions>button:hover{background:var(--ui-hover,color-mix(in srgb,currentColor 8%,transparent));color:var(--text-primary,#1d1d22)}
.tsb-side-panel-actions svg{width:20px;height:20px}
.tsb-side-panel-close{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;margin:-4px -6px 0 0;padding:0;border:0;border-radius:6px;background:transparent;color:var(--text-secondary,#6b6b75);cursor:pointer}
.tsb-side-panel-close:hover{background:var(--ui-hover,color-mix(in srgb,currentColor 8%,transparent));color:var(--text-primary,#1d1d22)}
.tsb-side-panel-close svg{width:20px;height:20px}
.tsb-side-panel-body{flex:1 1 auto;min-height:0;overflow:auto;padding:16px 20px 20px}
.tsb-side-panel-foot{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:12px 20px;border-top:1px solid var(--app-border-soft,#e7e8eb)}
.tsb-side-panel-foot[hidden]{display:none}
/* From 1900 px the page reflows beside the panel instead of lying under it; a modal dialog it lives in makes room too. */
dialog.has-side-panel-inside>.tsb-side-panel{top:0}
@media(min-width:1900px){dialog.has-side-panel-inside{box-sizing:border-box;padding-right:var(--tsb-side-panel-width)!important}}
@media(min-width:1900px){html.has-side-panel body.workspace-shell-native{padding-right:var(--tsb-side-panel-width)}html.has-side-panel .workspace-shell-native .workspace-topbar{right:0}}
/* The trade review as a page (no top bar): the panel runs the full height, and the review and its Save bar make room. */
@media(min-width:1024px){body.trade-review-page>.tsb-side-panel{top:0}}
/* The trade review in light carries its own palette, not the app's (assets/trade-review.css), so the kit roles inside the
   panel (.tsb-content-controls reads --app-*) came out empty: the loss figure in ink and Ask with no fill (gate 8,
   fresh eyes, 14 Nov). The panel gets the app's light palette there; dark already defines it. */
html.light body.trade-review-page .tsb-side-panel{--bg-primary:#fff;--app-accent:var(--user-action-accent,#443ab8);--app-accent-text:var(--user-action-text,var(--app-accent));--app-accent-soft:var(--user-action-accent-soft,#443ab80f);--app-positive:#449a6b;--app-negative:#c51f17;--app-positive-text:#2f7d54;--app-negative-text:#bf2d23;--app-positive-soft:#e8f8ee;--app-negative-soft:#ffeeeb;--app-surface-control:#f5f5f7;--app-action-bg-hover:#f8fafc;--app-divider-default:rgba(15,23,42,.16);--app-divider-muted:rgba(15,23,42,.12);--app-border-hover:rgba(15,23,42,.24)}
@media(min-width:1900px){html.has-side-panel body.trade-review-page{padding-right:var(--tsb-side-panel-width)}html.has-side-panel body.trade-review-page .review-footer{right:var(--tsb-side-panel-width)}}
/* From 1024 to 1899 the panel lies over the page, which keeps its own width (Igor 14 Nov «Поверх страницы»: squeezed to
   ~800 px, Lab and Reports broke); a drawer's shadow parts it from the page. */
@media(min-width:1024px) and (max-width:1899px){.tsb-side-panel{box-shadow:var(--ui-shadow-dialog,0 24px 80px rgb(32 35 31 / .15))}}
/* Below 1024 the page cannot reflow beside 420 px, so the panel is a bottom sheet there, as on the phone (Igor 14 Nov
   «развалилось» at 768: the panel lay over the page and cut it in half). */
@media(max-width:1023px){
 .tsb-side-panel{top:auto;left:var(--ws-sidebar-width,0px);width:auto;height:min(55dvh,560px);border-left:0;border-top:1px solid var(--app-border-soft,#e7e8eb);border-radius:16px 16px 0 0;box-shadow:0 -12px 32px #0000001f}
 .tsb-side-panel-head,.tsb-side-panel-body,.tsb-side-panel-foot{padding-left:16px;padding-right:16px}
}
