/* Workspace (screens/workspace.js): the grid of panes, the tile picker over
   a pane, a pane floating as a window, and the pane mode a frame's own
   document takes (body.pane, set by core/webshim/install.js when the
   document is a pane of a BMWeb shell). */

.ws {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}
/* the page is the whole view: no page padding around the grid */
.view:has(> .ws) {
  padding: 0;
  overflow: hidden;
}
.ws-toolbar {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.ws-eyebrow {
  margin-right: 6px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}
.ws-ctl {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ws-ctl-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.ws-dd .lkd {
  min-width: 200px;
}
.ws-dd-scale .lkd {
  min-width: 190px;
}
.ws-dd .lkd-pop {
  min-width: 220px;
}
.ws-dd-glyph {
  width: 18px;
  text-align: center;
  font-size: 15px;
  opacity: 0.85;
}
.ws-grid {
  flex: 1;
  display: grid;
  gap: 4px;
  padding: 4px;
  min-height: 0;
}
.ws-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border: 1px solid var(--border, #3a3f47);
  border-radius: 6px;
  overflow: hidden;
  position: relative; /* the picker sits over the frame */
  background: var(--bg, #15181c);
}
.ws-pane[hidden] {
  display: none;
}
.ws-pane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px 3px 10px;
  font-size: 12px;
  background: var(--panel, rgba(255, 255, 255, 0.04));
  user-select: none;
}
.ws-pane-no {
  opacity: 0.5;
  font-family: ui-monospace, Menlo, monospace;
}
.ws-name {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
}
.ws-name:hover {
  border-color: var(--border, #3a3f47);
}
.ws-name-icon {
  opacity: 0.8;
}
.ws-name-caret {
  opacity: 0.5;
  font-size: 11px;
}
.ws-grip {
  flex: 1;
  align-self: stretch;
  min-width: 24px;
}
.ws-float-btn {
  font: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 3px 7px;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0.7;
}
.ws-float-btn:hover {
  opacity: 1;
  border-color: var(--border, #3a3f47);
}

/* the picker: the tiles over the pane, under its header */
.ws-picker {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  overflow: auto;
  padding: 14px;
  background: var(--bg, #15181c);
}
.ws-picker[hidden] {
  display: none;
}
.ws-picker-head {
  font-size: 12px;
  opacity: 0.6;
  margin: 0 0 10px 2px;
}
.ws-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.ws-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  text-align: left;
  background: var(--panel, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border, #3a3f47);
  border-radius: 6px;
  cursor: pointer;
}
.ws-tile:hover {
  border-color: var(--accent, #e9c46a);
}
.ws-tile[aria-pressed='true'] {
  border-color: var(--accent, #e9c46a);
  box-shadow: inset 0 0 0 1px var(--accent, #e9c46a);
}
.ws-tile-icon {
  font-size: 18px;
  opacity: 0.85;
}
.ws-tile-title {
  font-weight: 600;
  font-size: 13px;
}
.ws-tile-desc {
  font-size: 11px;
  opacity: 0.6;
  line-height: 1.3;
}

/* the frame is laid out at the scale width and shrunk to the box
   (screens/workspace.js, fit): absolute, scaled from its top-left corner */
.ws-frame-box {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.ws-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  transform-origin: top left;
}

/* a floating pane: out of the grid and fixed to the window, so it can be
   dragged over the app's top bar right up to the top; dragged by its
   header and resized from its corner; its grid cell stays empty */
.ws-pane.ws-float {
  position: fixed;
  grid-area: auto;
  resize: both;
  min-width: 320px;
  min-height: 200px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  border-color: var(--accent, #e9c46a);
}
.ws-pane.ws-float .ws-pane-head,
.ws-pane.ws-float .ws-grip {
  cursor: move;
}
.ws-grid.ws-dragging .ws-frame {
  pointer-events: none;
}

/* A pane's own document: the shell's bar holds the cable, so the pane shows
   only the cable state and drops the chrome it does not need. */
body.pane .topbar-right > :not(.status) {
  display: none;
}
