/* Paint — right dock shell (dock.js): groups, tabs, splits, Color values, Brushes chrome */

/* ── Right dock: Color, Properties, Navigator, History, Layers, Brushes ── */

.dock {
  width: var(--layer-panel-w);
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  flex-shrink: 0;
  align-self: stretch;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dock-group {
  position: relative;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  min-height: 0;
  flex: 0 1 auto;
  overflow: hidden;
}
/* A percentage cap never applied when the dock's height was indefinite, so the groups
   above Layers ate the column and the footer was clipped. A pixel cap always applies,
   and these groups are allowed to shrink below it so Layers keeps its floor. */
.dock-group:not(.dock-group-fill) {
  max-height: 140px;
}
.dock-group:not(.dock-group-fill) .dock-panel {
  flex: 1;
  min-height: 0;
}
/* The group that holds the Layers panel takes the leftover height, and never less than
   the filter row, the header, one layer, and the footer. */
.dock-group-fill {
  flex: 1 1 0%;
  min-height: 220px;
  max-height: none;
  border-bottom: 0;
}

/* Drag the bottom border of a group to resize it; Layers keeps the leftover height. */
.dock-split {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  cursor: row-resize;
  z-index: 2;
  touch-action: none;
}
.dock-split:hover,
.dock-split.dragging {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
}
.dock-split[hidden] {
  display: none;
}

.dock-tabs {
  display: flex;
  gap: 2px;
  padding: 4px 4px 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dock-tab {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: transparent;
  color: var(--fg-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: grab;
  touch-action: none;
}
.dock-tab-dragging {
  opacity: 0.55;
  cursor: grabbing;
}
.dock-tabs.dock-tab-target {
  box-shadow: inset 0 -2px 0 var(--accent);
}
.dock-tab:hover {
  color: var(--fg);
}
.dock-tab[aria-selected='true'] {
  background: var(--bg-2);
  border-color: var(--border);
  color: var(--fg);
}

.dock-panel {
  overflow-y: auto;
  min-height: 0;
}
.dock-group-fill .dock-panel {
  flex: 1;
}
.dock-panel[hidden] {
  display: none;
}
#panel-history {
  max-height: 160px;
}

/* Placeholder for a panel whose own story has not landed yet */
.panel-empty {
  margin: 0;
  min-height: 28px;
}

/* Brushes tab: search and the shared brush Size */
.brushes-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
}
.brush-search {
  min-width: 0;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-1);
  color: var(--fg);
  font-size: 12px;
}
.brush-size-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-dim);
  font-size: 12px;
}
.brush-size-row input {
  flex: 1;
  min-width: 0;
}
.brush-size-row output {
  min-width: 44px;
  text-align: right;
  color: var(--fg);
}

/* Color tab: current foreground and background values */
.color-values {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
}
.color-value {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--fg-dim);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.color-value:hover {
  background: var(--bg-3);
  color: var(--fg);
}
.color-value-chip {
  width: 18px;
  height: 18px;
  border: 1px solid var(--hairline-strong);
  border-radius: 3px;
  flex-shrink: 0;
}
.color-value-label {
  flex: 1;
}
.color-value-hex {
  color: var(--fg);
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
}
