/* Workbench — dockable-panel window manager (Plan 70.1).
   Frame only; panel bodies are owned by consumer modules. Rung-1 ships a fixed
   two-region scaffold (center + one left edge dock); rungs 2+ add resize, tabs,
   float, and persistence. Theme tokens are DaisyUI oklch vars, matching the app. */

.wb-root {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: oklch(var(--b1));
}

.wb-dock {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.wb-dock-left {
  flex: 0 0 18rem;
  border-right: 1px solid oklch(var(--bc) / 0.12);
}

.wb-dock-center {
  flex: 1 1 auto;
}

/* Rung-2 (70.2.1): the draggable divider between an edge dock and center.
   `touch-action: none` so a touch drag is a resize, not a scroll. */
.wb-splitter {
  flex: 0 0 6px;
  align-self: stretch;
  cursor: col-resize;
  background: oklch(var(--bc) / 0.06);
  touch-action: none;
}
.wb-splitter:hover {
  background: oklch(var(--p) / 0.4);
}

/* Panels stacked in a dock share the space until tab-stack (rung 2) lands. */
.wb-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  border-bottom: 1px solid oklch(var(--bc) / 0.08);
}
.wb-panel:last-child {
  border-bottom: none;
}

.wb-panel-titlebar {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: oklch(var(--bc) / 0.65);
  background: oklch(var(--b2));
  border-bottom: 1px solid oklch(var(--bc) / 0.1);
  user-select: none;
}

.wb-panel-focused > .wb-panel-titlebar {
  color: oklch(var(--bc));
  box-shadow: inset 2px 0 0 oklch(var(--p));
}

.wb-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.5rem;
}

/* Rung-2 (70.2.2): tab bar shown when a dock holds >1 panel. Tokens mirror the
   titlebar; the active tab carries the same inset-bar focus affordance. */
.wb-tabbar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  background: oklch(var(--b2));
  border-bottom: 1px solid oklch(var(--bc) / 0.1);
  user-select: none;
}
.wb-tab {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: oklch(var(--bc) / 0.55);
  border-right: 1px solid oklch(var(--bc) / 0.08);
  cursor: pointer;
}
.wb-tab:hover {
  color: oklch(var(--bc) / 0.85);
}
.wb-tab-active {
  color: oklch(var(--bc));
  background: oklch(var(--b1));
  box-shadow: inset 0 2px 0 oklch(var(--p));
}
/* Defensive: a focused panel that is NOT the dock's visible tab (see 70.2.2
   T6-fix — unreachable under the current reducers). Dimmer than -active. */
.wb-tab-focused {
  box-shadow: inset 0 2px 0 oklch(var(--p) / 0.5);
}
