/* ==========================================================================
   Chart workspace (/markets/chart, markets/chart.html, chart-workspace.js).
   A full-window terminal on the Terminal Light tokens: the top bar, the
   drawing tools on the left, the chart, the side panel, each a card on the
   page with a 4px gap between them (TradingView's layout).
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body.cw-page { height: 100%; margin: 0; }
body.cw-page { overflow: hidden; background: var(--tl-page); color: var(--tl-ink); font: 400 13px/1.4 var(--tl-font); -webkit-font-smoothing: antialiased; }
.cw-page button { font: inherit; color: inherit; }
.cw-page [hidden] { display: none !important; }
.cw-spacer { flex: 1; }
.cw-meta { font-size: 11.5px; color: var(--tl-ink-50); }

.cw { display: grid; grid-template-rows: 46px minmax(0, 1fr); gap: 4px; height: 100vh; padding: 4px; }

/* ---------- Top bar ---------- */
.cw-top { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 6px; border-radius: 8px; background: var(--tl-card-body); box-shadow: var(--tl-card-shadow); }
.cw-home { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 7px; }
.cw-home:hover { background: var(--tl-fill-05); }
.cw-home img { border-radius: 5px; }
.cw-top-sep, .cw-bottom-sep { flex: none; width: 1px; height: 22px; background: var(--tl-line-10); }

.cw-tabs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cw-tabs::-webkit-scrollbar { display: none; }
.cw-tab { display: inline-flex; align-items: center; gap: 7px; flex: none; max-width: 220px; height: 32px; padding: 0 6px 0 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; cursor: pointer; color: var(--tl-ink-60); white-space: nowrap; }
.cw-tab:hover { background: var(--tl-fill-04); color: var(--tl-ink); }
.cw-tab[aria-selected="true"] { border-color: var(--tl-line-12); background: var(--tl-fill-05); color: var(--tl-ink); }
.cw-tab-name { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cw-tab-kind { flex: none; padding: 1px 5px; border-radius: 4px; background: var(--tl-fill-06); font: 600 9.5px var(--tl-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--tl-ink-50); }
.cw-tab-x { display: grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 4px; color: var(--tl-ink-45); }
.cw-tab-x:hover { background: var(--tl-fill-07); color: var(--tl-ink); }
.cw-tab-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }

.cw-icon-btn { display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--tl-ink-60); cursor: pointer; text-decoration: none; }
.cw-icon-btn:hover, .cw-icon-btn[aria-expanded="true"] { background: var(--tl-fill-05); color: var(--tl-ink); }
.cw-icon-btn[aria-pressed="false"] { color: var(--tl-ink-40); }
.cw-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; margin: 0; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--tl-ink-70); font-weight: 500; cursor: pointer; white-space: nowrap; }
.cw-btn:hover { background: var(--tl-fill-05); color: var(--tl-ink); }
.cw-btn:disabled { opacity: 0.4; cursor: default; background: transparent; }
.cw-sym { display: inline-flex; align-items: center; gap: 8px; flex: none; max-width: 260px; height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--tl-line-10); border-radius: 7px; background: var(--tl-fill-03); color: var(--tl-ink); font-weight: 600; cursor: pointer; }
.cw-sym:hover { border-color: var(--tl-line-20); }
.cw-sym svg { flex: none; color: var(--tl-ink-50); }
.cw-sym span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-page :focus-visible { outline: 2px solid var(--tl-ink); outline-offset: 1px; }

/* Segmented controls */
.cw-seg { display: inline-flex; flex: none; padding: 2px; border-radius: 8px; background: var(--tl-fill-05); }
.cw-seg button { height: 28px; margin: 0; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--tl-ink-55); font-weight: 500; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.cw-seg button:hover { color: var(--tl-ink); }
.cw-seg button[aria-pressed="true"] { background: var(--tl-control); color: var(--tl-ink); box-shadow: var(--tl-seg-on-shadow); }
.cw-seg.is-xs button { height: 22px; padding: 0 8px; font-size: 11.5px; }

/* Popovers */
.cw-pop-wrap { position: relative; }
.cw-pop { position: absolute; top: calc(100% + 6px); z-index: 50; width: 300px; padding: 10px; border: 1px solid var(--tl-line-08); border-radius: 10px; background: var(--tl-card-body); box-shadow: var(--tl-float-shadow); }
.cw-pop.is-right { right: 0; }
.cw-pop-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 10px; }
.cw-pop-head span { font-size: 11.5px; color: var(--tl-ink-50); }
.cw-set-acct { display: flex; gap: 8px; padding: 0 4px 10px; border-bottom: 1px solid var(--tl-line-06); margin-bottom: 4px; }
.cw-set-acct label { display: flex; flex-direction: column; gap: 4px; flex: 1; font-size: 11px; font-family: var(--tl-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--tl-ink-50); }
.cw-in { display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px; border: 1px solid var(--tl-line-12); border-radius: 6px; background: var(--tl-card-body); }
.cw-in i { font-style: normal; color: var(--tl-ink-45); }
.cw-in input { width: 100%; min-width: 0; height: 28px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--tl-ink); font: 500 13px var(--tl-font); outline: none; box-shadow: none; }
.cw-set-row { display: flex; align-items: center; gap: 12px; padding: 7px 4px; }
.cw-set-row span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cw-set-row b { font-weight: 600; font-size: 13px; }
.cw-set-row small { font-size: 11.5px; color: var(--tl-ink-50); }
.cw-switch { position: relative; flex: none; width: 32px; height: 18px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--tl-fill-07); cursor: pointer; transition: background 0.2s var(--tl-ease); }
.cw-switch i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.2s var(--tl-ease); }
.cw-switch[aria-checked="true"] { background: var(--tl-ink); }
.cw-switch[aria-checked="true"] i { transform: translateX(14px); }

/* ---------- Body: rail, chart, side ---------- */
.cw-body { display: grid; grid-template-columns: 46px minmax(0, 1fr) 320px; gap: 4px; min-height: 0; }
.cw-body.is-side-off { grid-template-columns: 46px minmax(0, 1fr); }
.cw-body.is-side-off .cw-side { display: none; }

.cw-rail { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 8px; background: var(--tl-card-body); box-shadow: var(--tl-card-shadow); }
.cw-rail .cw-spacer { flex: 1; }
.cw-rail-sep { flex: none; width: 24px; height: 1px; margin: 4px 0; background: var(--tl-line-08); }
.cw-tool { display: grid; place-items: center; flex: none; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--tl-ink-60); cursor: pointer; }
.cw-tool:hover { background: var(--tl-fill-05); color: var(--tl-ink); }
.cw-tool.is-on, .cw-tool[aria-pressed="true"] { background: var(--tl-fill-07); color: var(--tl-ink); }

.cw-main { display: grid; grid-template-rows: minmax(0, 1fr) 36px; min-width: 0; min-height: 0; border-radius: 8px; background: var(--tl-card-body); box-shadow: var(--tl-card-shadow); overflow: hidden; }
.cw-stage { position: relative; min-height: 0; }
.cw-chart { position: absolute; inset: 0; }
.cw-stage.is-drawing .cw-chart { cursor: crosshair; }
.cw-draw { position: absolute; left: 0; top: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.cw-draw .cw-d { pointer-events: stroke; cursor: pointer; }
.cw-draw .cw-d-hit { stroke: transparent; stroke-width: 12; fill: none; }
.cw-draw .cw-d-line { stroke: var(--cw-draw, #2962ff); stroke-width: 1.5; fill: none; }
.cw-draw .is-sel .cw-d-line { stroke-width: 2; }
.cw-draw .cw-d-handle { fill: var(--tl-card-body); stroke: var(--cw-draw, #2962ff); stroke-width: 1.5; }
.cw-draw .cw-d-tag rect { fill: var(--cw-draw, #2962ff); }
.cw-draw .cw-d-tag text { fill: #fff; font: 600 11px var(--tl-mono); }
.cw-draw .cw-d-box { fill: var(--cw-measure-fill, rgba(41, 98, 255, 0.12)); stroke: none; }
.cw-draw .cw-d-box.is-neg { fill: var(--cw-measure-neg, rgba(214, 48, 49, 0.12)); }
.cw-draw .cw-d-note rect { fill: var(--tl-tooltip-bg); }
.cw-draw .cw-d-note text { fill: var(--tl-tooltip-ink); font: 500 12px var(--tl-font); }
.cw-draw .cw-d-note { pointer-events: all; }

.cw-legend { position: absolute; left: 12px; top: 8px; z-index: 4; display: flex; flex-direction: column; gap: 3px; max-width: calc(100% - 120px); pointer-events: none; }
.cw-lg-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.cw-lg-name { font-size: 15px; font-weight: 650; letter-spacing: -0.2px; }
.cw-lg-k { font-size: 12px; color: var(--tl-ink-50); }
.cw-lg-v { font: 600 13px var(--tl-mono); font-variant-numeric: tabular-nums; }
.cw-lg-chg { font: 500 12px var(--tl-mono); }
.cw-lg-when { font: 500 11.5px var(--tl-mono); color: var(--tl-ink-50); }
.cw-lg-row { display: flex; align-items: center; gap: 8px; height: 22px; font-size: 12.5px; pointer-events: auto; }
.cw-lg-sw { flex: none; width: 14px; height: 3px; border-radius: 2px; }
.cw-lg-row .cw-lg-name2 { font-weight: 600; }
.cw-lg-row.is-off .cw-lg-name2, .cw-lg-row.is-off .cw-lg-v { opacity: 0.4; }
.cw-lg-act { display: none; gap: 2px; }
.cw-lg-row:hover .cw-lg-act { display: inline-flex; }
.cw-lg-act button { display: grid; place-items: center; width: 20px; height: 20px; margin: 0; padding: 0; border: 0; border-radius: 4px; background: var(--tl-fill-05); color: var(--tl-ink-60); cursor: pointer; }
.cw-lg-act button:hover { color: var(--tl-ink); background: var(--tl-fill-07); }
.is-pos { color: var(--tl-up); }
.is-neg { color: var(--tl-down); }

.cw-msg { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px; background: var(--tl-card-body); text-align: center; }
.cw-msg-in { max-width: 380px; }
.cw-msg-in b { display: block; margin-bottom: 6px; font-size: 16px; font-weight: 650; }
.cw-msg-in p { margin: 0 0 14px; font-size: 13px; color: var(--tl-ink-60); }
.cw-msg-in a, .cw-msg-in button { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 0; border-radius: var(--tl-r-btn); background: var(--tl-ink); color: var(--tl-on-ink); font-weight: 600; text-decoration: none; cursor: pointer; }

.cw-note-edit { position: absolute; z-index: 6; }
.cw-note-edit input { width: 220px; height: 30px; padding: 0 10px; border: 1px solid var(--tl-line-20); border-radius: 6px; background: var(--tl-card-body); color: var(--tl-ink); font: 500 12.5px var(--tl-font); box-shadow: var(--tl-float-shadow); outline: none; }

.cw-bottom { display: flex; align-items: center; gap: 10px; padding: 0 10px; border-top: 1px solid var(--tl-line-06); }
.cw-ranges { display: flex; gap: 2px; }
.cw-ranges button { height: 26px; margin: 0; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--tl-ink-60); font: 500 12px var(--tl-font); cursor: pointer; }
.cw-ranges button:hover { background: var(--tl-fill-05); color: var(--tl-ink); }
.cw-ranges button[aria-pressed="true"] { background: var(--tl-fill-07); color: var(--tl-ink); }
.cw-bottom-meta { font-size: 11.5px; color: var(--tl-ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cw-clock { font: 500 12px var(--tl-mono); color: var(--tl-ink-60); white-space: nowrap; }

/* ---------- Side panel ---------- */
.cw-side { display: grid; grid-template-rows: minmax(160px, 0.9fr) auto minmax(140px, 1fr); gap: 4px; min-height: 0; }
.cw-panel { display: flex; flex-direction: column; min-height: 0; border-radius: 8px; background: var(--tl-card-body); box-shadow: var(--tl-card-shadow); overflow: hidden; }
.cw-panel-head { display: flex; align-items: center; gap: 8px; flex: none; height: 40px; padding: 0 12px; border-bottom: 1px solid var(--tl-line-06); }
.cw-panel-head b { font-size: 13.5px; font-weight: 650; }
.cw-watch-cols { display: grid; grid-template-columns: minmax(0, 1fr) 70px 54px; gap: 8px; flex: none; padding: 6px 12px; font: 500 10.5px var(--tl-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--tl-ink-45); border-bottom: 1px solid var(--tl-line-05); }
.cw-watch-cols > :not(:first-child) { text-align: right; }
.cw-watch-list, .cw-list-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cw-w-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 70px 54px; align-items: center; gap: 8px; width: 100%; min-height: 40px; margin: 0; padding: 5px 12px; border: 0; border-bottom: 1px solid var(--tl-line-05); background: transparent; text-align: left; cursor: pointer; }
.cw-w-row:hover { background: var(--tl-fill-03); }
.cw-w-row.is-on { background: var(--tl-fill-05); }
.cw-w-row.is-on::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--tl-ink); }
.cw-w-name { display: flex; flex-direction: column; min-width: 0; }
.cw-w-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 12.5px; }
.cw-w-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--tl-ink-50); }
.cw-w-num { font: 500 12px var(--tl-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cw-w-sub { font: 500 11px var(--tl-mono); color: var(--tl-ink-50); text-align: right; white-space: nowrap; }
.cw-w-add { position: absolute; right: 4px; top: 50%; display: none; place-items: center; width: 22px; height: 22px; margin-top: -11px; border-radius: 5px; background: var(--tl-card-body); box-shadow: var(--tl-card-shadow); color: var(--tl-ink-60); }
.cw-w-row:hover .cw-w-add { display: grid; }
.cw-w-add:hover { color: var(--tl-ink); }
.cw-pro { display: inline-block; padding: 0 5px; border-radius: 4px; background: var(--tl-pro, #111); color: #fff; font: 700 9px/15px var(--tl-mono); letter-spacing: 0.06em; vertical-align: 1px; }
.cw-empty { margin: 0; padding: 16px 12px; font-size: 12.5px; color: var(--tl-ink-50); }

.cw-detail { padding: 12px; gap: 10px; }
.cw-d-top { display: flex; align-items: flex-start; gap: 10px; }
.cw-d-title { flex: 1; min-width: 0; }
.cw-d-title b { display: block; font-size: 15px; font-weight: 650; letter-spacing: -0.2px; }
.cw-d-title span { font-size: 11.5px; color: var(--tl-ink-50); }
.cw-d-big { display: flex; align-items: baseline; gap: 8px; }
.cw-d-big strong { font-size: 26px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cw-d-rule { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--tl-ink-70); }
.cw-d-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin: 0; }
.cw-d-stats div { min-width: 0; }
.cw-d-stats dt { font: 500 10px var(--tl-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--tl-ink-45); }
.cw-d-stats dd { margin: 1px 0 0; font: 600 13px var(--tl-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-d-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--tl-ink-70); text-decoration: none; }
.cw-d-link:hover { color: var(--tl-ink); text-decoration: underline; text-underline-offset: 3px; }
.cw-d-prices { display: grid; grid-template-columns: auto 1fr 1fr; gap: 4px 10px; font-size: 12.5px; }
.cw-d-prices span:nth-child(3n+1) { color: var(--tl-ink-50); font: 500 11px var(--tl-mono); text-transform: uppercase; letter-spacing: 0.04em; }
.cw-d-prices span:not(:nth-child(3n+1)) { font: 600 12.5px var(--tl-mono); text-align: right; }

.cw-b-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 6px 12px; border: 0; border-bottom: 1px solid var(--tl-line-05); background: transparent; text-align: left; cursor: pointer; }
.cw-b-row:hover { background: var(--tl-fill-03); }
.cw-b-row.is-on { background: var(--tl-fill-05); }
.cw-b-when { font: 500 11px var(--tl-mono); color: var(--tl-ink-50); }
.cw-b-what { display: flex; flex-direction: column; min-width: 0; }
.cw-b-what b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 12.5px; }
.cw-b-what small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--tl-ink-50); }
.cw-b-res { display: flex; flex-direction: column; align-items: flex-end; font: 600 12px var(--tl-mono); white-space: nowrap; }
.cw-b-res small { font: 500 10.5px var(--tl-mono); color: var(--tl-ink-45); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Symbol search ---------- */
.cw-dialog-back { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; background: rgba(10, 12, 14, 0.35); }
.cw-dialog { display: flex; flex-direction: column; width: min(620px, 100%); max-height: 72vh; border-radius: 12px; background: var(--tl-card-body); box-shadow: var(--tl-float-shadow); overflow: hidden; }
.cw-dialog-head { display: flex; align-items: center; padding: 10px 10px 4px 16px; }
.cw-dialog-head b { font-size: 15px; font-weight: 650; }
.cw-search-in { display: flex; align-items: center; gap: 10px; margin: 6px 16px 10px; padding: 0 12px; height: 40px; border: 1px solid var(--tl-line-14); border-radius: 8px; color: var(--tl-ink-50); }
.cw-search-in:focus-within { border-color: var(--tl-ink); }
.cw-search-in input { flex: 1; min-width: 0; height: 38px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--tl-ink); font: 500 14px var(--tl-font); outline: none; box-shadow: none; }
.cw-search-kinds { align-self: flex-start; margin: 0 16px 8px; }
.cw-search-list { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--tl-line-06); }
.cw-s-group { padding: 8px 16px 4px; font: 500 10.5px var(--tl-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--tl-ink-45); }
.cw-s-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: 100%; min-height: 46px; margin: 0; padding: 6px 16px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.cw-s-row:hover, .cw-s-row.is-hl { background: var(--tl-fill-05); }
.cw-s-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--tl-fill-06); font: 700 10px var(--tl-mono); color: var(--tl-ink-60); }
.cw-s-ic img { width: 22px; height: 22px; object-fit: contain; }
.cw-s-name { display: flex; flex-direction: column; min-width: 0; }
.cw-s-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cw-s-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--tl-ink-50); }
.cw-s-tag { font: 600 10px var(--tl-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--tl-ink-45); }
.cw-s-num { font: 600 12.5px var(--tl-mono); text-align: right; min-width: 56px; }
.cw-s-row.is-dis { opacity: 0.45; cursor: default; }

.cw-toast { position: fixed; left: 50%; bottom: 56px; z-index: 120; padding: 8px 14px; transform: translateX(-50%); border-radius: 8px; background: var(--tl-tooltip-bg); color: var(--tl-tooltip-ink); font-size: 12.5px; font-weight: 500; box-shadow: var(--tl-float-shadow); }

/* ---------- Narrow windows ---------- */
@media (max-width: 1100px) {
  .cw-body { grid-template-columns: 46px minmax(0, 1fr); }
  .cw-side { display: none; }
  .cw-body.is-side-on { grid-template-columns: 46px minmax(0, 1fr) 300px; }
  .cw-body.is-side-on .cw-side { display: grid; }
}
@media (max-width: 760px) {
  /* Two rows: the tabs, then the controls. */
  .cw { grid-template-rows: auto minmax(0, 1fr); }
  .cw-top { flex-wrap: wrap; row-gap: 2px; padding: 4px 6px; }
  .cw-tabs { order: -1; flex: 1 1 calc(100% - 80px); }
  .cw-tab-add { order: -1; }
  .cw-home { order: -2; }
  .cw-top-sep { display: none; }
  .cw-seg button { padding: 0 8px; }
  .cw-sym span, .cw-btn { font-size: 0; gap: 0; }
  .cw-sym { padding: 0 8px; }
  .cw-btn { padding: 0 8px; }
  .cw-btn svg { margin: 0; }
  .cw-bottom-meta, .cw-bottom-sep { display: none; }
  .cw-body { grid-template-columns: 40px minmax(0, 1fr); }
  .cw-tool { width: 32px; height: 32px; }
  .cw-body.is-side-on { grid-template-columns: minmax(0, 1fr); }
  .cw-body.is-side-on .cw-rail, .cw-body.is-side-on .cw-main { display: none; }
}

/* Free viewers: the upgrade panel in place of the workspace (chart.html). */
.cw-lock { display: grid; place-items: center; min-height: 100vh; padding: 24px; box-sizing: border-box; background: var(--tl-page); color: var(--tl-ink); font-family: var(--tl-font); }
.cw-lock-card { max-width: 520px; padding: 28px 30px; border: 1px solid var(--tl-line-10); border-radius: 16px; background: var(--tl-card-body); }
.cw-lock-k { font: 500 11px var(--tl-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--tl-ink-50); }
.cw-lock-k b { color: var(--tl-ink); font-weight: 600; }
.cw-lock h1 { margin: 12px 0 10px; font-size: 24px; font-weight: 650; letter-spacing: -0.5px; line-height: 1.2; }
.cw-lock p { margin: 0 0 20px; font-size: 14.5px; line-height: 1.55; color: var(--tl-ink-60); }
.cw-lock-actions { display: flex; align-items: center; gap: 16px; }
.cw-lock-btn { display: inline-flex; align-items: center; height: 38px; padding: 0 18px; border-radius: 9px; background: var(--tl-ink); color: var(--tl-on-ink); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.cw-lock-link { font-size: 13.5px; color: var(--tl-ink-60); }
