/* Pro Charts workbench (feature #988). Page chrome on the house tokens; the CHART CANVAS has its own
   dark / paper screen (data-chart-theme). Header font untouched. */
.pcw { --pcw-bg:var(--bg); --pcw-text:var(--text); --pcw-dim:var(--text-3); --pcw-line:var(--hairline); --pcw-up:var(--pos); --pcw-down:var(--neg);
  /* svh, not dvh (CentCom 32398): on a phone the dynamic viewport grows and shrinks as the browser bar collapses
     while the thumb scrolls, and every change re-laid-out the whole chart mid-gesture. The small viewport
     height is stable for the life of the page. */
  display:flex; flex-direction:column; width:100%; height:calc(100vh - 150px); height:calc(100svh - 150px); min-height:420px;
  max-width:100vw; box-sizing:border-box; color:var(--text); font-family:'IBM Plex Sans',system-ui,sans-serif; overflow:hidden; overflow:clip; position:relative; }
.pcw-top { display:flex; flex-wrap:wrap; align-items:center; gap:8px 10px; padding:8px 12px; background:var(--surface); border-bottom:1px solid var(--hairline); }
.pcw-title { font-family:'Archivo Black',sans-serif; font-size:1rem; margin:0 6px 0 0; color:var(--text-heading, var(--text)); }
.pcw-sym input { width:96px; height:36px; box-sizing:border-box; padding:0 10px; border-radius:8px; border:1px solid var(--hairline); background:var(--bg); color:var(--text); font:600 0.95rem 'IBM Plex Sans',system-ui,sans-serif; text-transform:uppercase; }
.pcw-tf { display:flex; gap:2px; }
.pcw-tf button, .pcw-btn, .pcw-sel, .pcw-tools button, .pcw-drawer-h button, .pcw-ask button { min-height:36px; padding:0 11px; border-radius:8px; border:1px solid var(--hairline); background:var(--surface-2); color:var(--text); font:600 0.82rem 'IBM Plex Sans',system-ui,sans-serif; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; }
.pcw-tf button { padding:0 9px; min-width:40px; }
.pcw-tf button.on, .pcw-btn[aria-pressed="true"], .pcw-tools button.on { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.pcw-btn.pcw-hot { border-color:var(--accent); color:var(--accent); }
.pcw-btn.pcw-hot[aria-expanded="true"] { background:var(--accent); color:var(--accent-ink); }
.pcw-btn b { margin-left:6px; color:var(--accent); }
.pcw-acts { display:flex; flex-wrap:wrap; gap:6px; margin-left:auto; align-items:center; }
.pcw button:focus-visible, .pcw input:focus-visible, .pcw select:focus-visible, .pcw a:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.pcw-body { flex:1; min-height:0; display:flex; position:relative; }
.pcw-tools { display:flex; flex-direction:column; gap:4px; padding:8px 6px; width:64px; box-sizing:border-box; background:var(--surface); border-right:1px solid var(--hairline); overflow-y:auto; }
.pcw-tools button { width:100%; padding:0 4px; font-size:0.74rem; }
.pcw-stage { flex:1; min-width:0; position:relative; background:var(--pcw-bg); display:flex; flex-direction:column; }
.pcw-main { flex:1; min-height:120px; position:relative; }
.pcw-panes { flex:none; display:flex; flex-direction:column; }
.pcw-pane { position:relative; height:118px; border-top:1px solid var(--pcw-line); }
.pcw-pane-t { position:absolute; left:10px; top:4px; z-index:5; font:600 0.72rem 'IBM Plex Sans',system-ui,sans-serif; color:var(--pcw-dim); pointer-events:none; }
.pcw-chart { position:absolute; inset:0; }
.pcw-draw { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:3; }
.pcw-legend { position:absolute; left:10px; top:8px; z-index:5; color:var(--pcw-text); font:500 0.78rem 'IBM Plex Mono',ui-monospace,monospace; pointer-events:none; max-width:calc(100% - 90px); line-height:1.5; text-shadow:0 0 4px var(--pcw-bg); }
.pcw-legend b { font-family:'IBM Plex Sans',system-ui,sans-serif; font-size:0.95rem; margin-right:8px; }
.pcw-legend .up { color:var(--pcw-up); } .pcw-legend .dn { color:var(--pcw-down); } .pcw-legend .dim { color:var(--pcw-dim); }
.pcw-state { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; z-index:8; color:var(--pcw-dim); background:var(--pcw-bg); font-size:0.95rem; text-align:center; padding:20px; }
.pcw-state[hidden], .pcw-msg[hidden], .pcw-ask[hidden], .pcw-menu[hidden], .pcw-drawer[hidden] { display:none; }
.pcw-msg { position:absolute; left:50%; transform:translateX(-50%); bottom:14px; z-index:6; max-width:92%; padding:9px 14px; border-radius:8px; background:var(--surface); border:1px solid var(--accent); color:var(--text); font-size:0.85rem; }
.pcw-msg.err { border-color:var(--negative); }
.pcw-ask { position:absolute; z-index:7; display:flex; gap:4px; }
.pcw-ask input { height:34px; padding:0 8px; border-radius:6px; border:1px solid var(--accent); background:var(--surface); color:var(--text); font:500 0.9rem 'IBM Plex Sans',system-ui,sans-serif; width:200px; }
.pcw-ask button { min-height:34px; }
.pcw-menu { position:absolute; z-index:20; right:12px; top:56px; width:260px; max-height:70%; overflow-y:auto; background:var(--surface); border:1px solid var(--hairline-strong); border-radius:10px; padding:6px; box-shadow:0 10px 30px rgba(0,0,0,0.4); }
.pcw-menu label { display:flex; align-items:center; gap:10px; padding:9px 10px; min-height:40px; box-sizing:border-box; border-radius:6px; cursor:pointer; font-size:0.86rem; }
.pcw-menu label:hover { background:var(--surface-2); }
.pcw-menu small { color:var(--text-3); margin-left:auto; }
.pcw-menu h4 { margin:8px 10px 2px; font-size:0.72rem; letter-spacing:0.06em; text-transform:uppercase; color:var(--text-3); }
.pcw-drawer { --pcw-dock-w:340px; position:relative; width:min(var(--pcw-dock-w), 70vw); flex:none; display:flex; flex-direction:column; background:var(--bg); border-left:1px solid var(--hairline); }
.pcw-drawer.wide { position:absolute; inset:0; width:auto; z-index:18; border-left:0; }
.pcw-grip { position:absolute; left:-4px; top:0; bottom:0; width:9px; cursor:col-resize; z-index:19; touch-action:none; }
.pcw-grip::after { content:""; position:absolute; left:4px; top:0; bottom:0; width:2px; background:transparent; transition:background 0.15s; }
.pcw-grip:hover::after, .pcw-grip:focus-visible::after, .pcw-drawer.sizing .pcw-grip::after { background:var(--text-3); }
.pcw-drawer.wide .pcw-grip { display:none; }
.pcw-drawer.sizing iframe { pointer-events:none; }
.pcw-drawer-h { display:flex; align-items:flex-start; gap:4px; padding:6px 8px; border-bottom:1px solid var(--hairline); min-width:0; }
.pcw-dtabs { display:flex; flex-wrap:wrap; gap:2px; flex:1 1 0; min-width:0; }
.pcw-drawer-h .pcw-dtabs button { flex:none; min-height:32px; padding:0 9px; border-radius:7px; border:1px solid transparent; background:transparent; color:var(--text-3); font:600 0.78rem 'IBM Plex Sans',system-ui,sans-serif; cursor:pointer; }
.pcw-drawer-h .pcw-dtabs button[aria-selected="true"] { background:var(--surface-2); color:var(--accent); border-color:var(--accent); }
.pcw-drawer-h .pcw-dbtn { flex:none; display:inline-flex; align-items:center; justify-content:center; min-height:32px; min-width:32px; padding:0 6px; font-size:1rem; border-radius:7px; border:1px solid var(--hairline); background:var(--surface-2); color:var(--text); font:600 1rem "IBM Plex Sans",system-ui,sans-serif; cursor:pointer; text-decoration:none; line-height:1; }
.pcw-drawer-h .pcw-dbtn[aria-pressed="true"] { background:var(--surface-2); color:var(--accent); border-color:var(--accent); }
.pcw-drawer iframe { flex:1; width:100%; border:0; background:var(--bg); }
.pcw-share { position:absolute; z-index:30; left:50%; top:50%; transform:translate(-50%,-50%); width:min(560px, 92%); max-height:92%; overflow-y:auto; background:var(--surface); border:1px solid var(--hairline-strong); border-radius:12px; padding:12px; box-shadow:0 14px 40px rgba(0,0,0,0.5); }
.pcw-share[hidden] { display:none; }
.pcw-share-h { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.pcw-share-h button { min-height:34px; padding:0 11px; border-radius:8px; border:1px solid var(--hairline); background:var(--surface-2); color:var(--text); font:600 0.8rem 'IBM Plex Sans',system-ui,sans-serif; cursor:pointer; }
.pcw-share img { display:block; width:100%; height:auto; border-radius:8px; border:1px solid var(--hairline); background:var(--bg); }
.pcw-share-a { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.pcw-share-n { margin:8px 0 0; font-size:0.76rem; color:var(--text-3); }
.pcw-cust { display:flex; gap:6px; align-items:center; padding:6px 10px 4px; }
.pcw-cust select, .pcw-cust input { height:34px; min-width:0; border-radius:6px; border:1px solid var(--hairline); background:var(--bg); color:var(--text); font:500 0.84rem 'IBM Plex Sans',system-ui,sans-serif; }
.pcw-cust select { flex:1; } .pcw-cust input { width:64px; padding:0 6px; }
.pcw-cust button { height:34px; padding:0 12px; border-radius:6px; border:1px solid var(--accent); background:var(--surface-2); color:var(--accent); font:600 0.8rem 'IBM Plex Sans',system-ui,sans-serif; cursor:pointer; }
.pcw-foot { padding:5px 12px; font-size:0.72rem; color:var(--text-3); background:var(--surface); border-top:1px solid var(--hairline); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pcw-foot a { color:var(--accent); }
#pcwToolsBtn { display:none; }
.pcw-opts { display:contents; }
.pcw-hot { order:2; } #pcwPlans { order:3; }

@media (max-width: 760px) {
  .pcw { height:calc(100vh - 160px); height:calc(100svh - 160px); }
  .pcw-title { display:none; }
  .pcw-top { gap:6px; padding:6px 8px; display:grid; grid-template-columns:auto 1fr; }
  .pcw-sym input { width:84px; }
  .pcw-acts { margin-left:0; display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; }
  .pcw-acts .pcw-btn { padding:0 4px; font-size:0.78rem; }
  .pcw-btn b { margin-left:4px; }
  .pcw select.pcw-sel { font-size:0.82rem; }
  .pcw-hot { order:0; } #pcwIndBtn { order:-1; }
  .pcw-tf { grid-column:1 / -1; overflow-x:auto; scrollbar-width:none; order:3; }
  .pcw-tf button { flex:1 0 auto; }
  .pcw-tools .pcw-opts { display:flex; flex-wrap:wrap; gap:6px; width:100%; margin-top:6px; }
  .pcw-tools .pcw-opts .pcw-btn, .pcw-tools .pcw-opts .pcw-sel { flex:1 1 40%; min-height:44px; }
  #pcwToolsBtn { display:inline-flex; }
  .pcw-tools { position:absolute; left:0; right:0; bottom:0; z-index:15; width:auto; flex-direction:row; flex-wrap:wrap; border-right:0; border-top:1px solid var(--hairline-strong); border-radius:14px 14px 0 0; padding:12px; transform:translateY(105%); transition:transform .18s ease; box-shadow:0 -10px 30px rgba(0,0,0,0.4); }
  .pcw-tools.open { transform:none; }
  .pcw-tools:not(.open) { visibility:hidden; }
  .pcw-tools > button { width:auto; flex:1 1 22%; min-height:44px; }
  .pcw-drawer { position:absolute; inset:0; width:auto; z-index:18; border-left:0; }
  .pcw-grip, #pcwDockWide { display:none; }
  .pcw-foot { display:none; }
  .pcw-pane { height:84px; }
  .pcw-menu { left:8px; right:8px; top:auto; bottom:8px; width:auto; max-height:60%; }
}
@media (prefers-reduced-motion: reduce) { .pcw-tools { transition:none; } }
