/* rdock.css — the right TRADING DOCK (#rdock, rdock.js; design/42 §7). Only the dock's own chrome: the tab
   strip, the two sections and their split bar, the width grip. What a tab draws inside its host
   (.rdock-host) is the tab's own sheet (datawin.css, watch.css, tas.css). The stage-width contract
   (--right-gutter, body.rdock-docked, the pre-paint stamp, the L4 panel beside it) lives in chart.css. */
#rdock.rdock {
  position: fixed; top: calc(48px + var(--tabs-h, 0px)); right: 0; bottom: 0; width: var(--rdock-w, 300px); z-index: 30; /* under the tab strip (tabs.css) */
  display: flex; flex-direction: column; min-width: 0;
  background: var(--bg); color: var(--fg);
  border-left: 1px solid var(--border);
  font-size: 12px; line-height: 1.4;
}
#rdock.rdock[hidden] { display: none; }
/* 1024-1279 px, or a stage that docking would crush: floated over the chart's right edge, explicit only. */
#rdock.rdock.overlay { z-index: 35; box-shadow: -10px 0 28px rgba(0, 0, 0, 0.45); }
:root[data-theme="light"] #rdock.rdock.overlay { box-shadow: -10px 0 24px rgba(0, 0, 0, 0.16); }

/* The width grip: the left edge, a little wider than it looks. */
.rdock-grip {
  position: absolute; left: -3px; top: 0; bottom: 0; width: 7px; z-index: 2;
  cursor: col-resize; touch-action: none;
}
.rdock-grip:hover, .rdock-grip.dragging { background: linear-gradient(90deg, transparent 2px, var(--accent) 2px, var(--accent) 4px, transparent 4px); }

.rdock-head {
  flex: 0 0 auto; display: flex; align-items: stretch; gap: 2px;
  height: 32px; padding: 0 3px 0 4px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  user-select: none;
}
.rdock-tabs { flex: 1 1 auto; min-width: 0; display: flex; align-items: stretch; gap: 1px; overflow: hidden; }
.rdock-tab {
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.2px;
  color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 0 7px; cursor: pointer; white-space: nowrap;
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; /* a 240 px dock: shrink, never wrap */
}
/* Six or more tabs (rdock.js renderStrips: .many): labels never truncate. Compact padding, no shrinking, and the strip
   scrolls sideways with its scrollbar hidden (the selected tab is kept in view; a vertical wheel scrolls it). */
.rdock-tabs.many { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.rdock-tabs.many::-webkit-scrollbar { display: none; }
.rdock-tabs.many .rdock-tab { flex: 0 0 auto; padding: 0 5px; letter-spacing: 0; overflow: visible; text-overflow: clip; }
.rdock-tab:hover { color: var(--fg); }
.rdock-tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.rdock-tab.below { color: var(--fg); border-bottom-color: var(--border); }
.rdock-tab.off, .rdock-tab:disabled { opacity: 0.4; cursor: default; }
.rdock-tab.off:hover { color: var(--muted); }
.rdock-tab:focus-visible, .rdock-ic:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
.rdock-ic {
  flex: 0 0 auto; align-self: center; width: 22px; height: 22px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 5px; cursor: pointer;
}
.rdock-ic svg { width: 15px; height: 15px; display: block; pointer-events: none; }
.rdock-ic:hover { color: var(--fg); background: var(--panel-2); border-color: var(--border); }
.rdock-ic[aria-pressed="true"] { color: var(--accent); }
.rdock-ic:disabled { opacity: 0.35; cursor: default; background: transparent; border-color: transparent; }

.rdock-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.rdock-sec { position: relative; min-height: 0; display: flex; flex-direction: column; }
.rdock-top { flex: 1 1 auto; }
.rdock-bot { flex: 1 1 0; border-top: 1px solid var(--border); }
.rdock-bot[hidden], .rdock-sbar[hidden] { display: none; }
.rdock-sbar {
  flex: 0 0 6px; margin: -3px 0; position: relative; z-index: 2; cursor: row-resize; touch-action: none;
}
.rdock-sbar:hover, .rdock-sbar.dragging { background: linear-gradient(180deg, transparent 2px, var(--accent) 2px, var(--accent) 4px, transparent 4px); }
.rdock-bhead {
  flex: 0 0 auto; display: flex; align-items: stretch; height: 26px; padding: 0 4px 0 6px;
  background: var(--panel); border-bottom: 1px solid var(--border); user-select: none;
}
.rdock-bhead .rdock-tab { font-size: 11.5px; padding: 0 7px; }
.rdock-bhead .rdock-ic { width: 20px; height: 20px; }
.rdock-bbody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

/* A tab's host: the tab owns what is inside, including its scroller(s). */
.rdock-host { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.rdock-host[hidden] { display: none; }
.rdock-empty { padding: 16px 12px; color: var(--muted); font-size: 12px; }
.rdock-empty[hidden] { display: none; }
