/* The workspace sidebar (design/v5/V5Work.dc.html), inside core's floating pane: the header, the
   search box (search.css), New and Select, one list of files and directories, and the Bin. */

.ws-side { display: flex; flex: 1; flex-direction: column; min-height: 0; }

/* ---- the header, on one line: Workspace · the view picker (UI-9g, V5Morph; views were terminals until UI-11). 36 tall, reaching out
   over the pane's padding at the top and left, so Hide Sidebar and Workspace sit 4 px from the pane's top
   and left edges, where the menus they open have their header rows; the picker ends on the content's
   right edge, as on the board. Its parts add up to its width: 28 + 2 + Workspace + 2 + the gap (8 at
   least) + 2 + the picker, which gives way */
.sb-head {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
  height: 36px;
  margin: -8px 0 4px -4px;
  white-space: nowrap;
}
/* (Spaces set to Sidebar, the header is the view picker alone: under the spaces list while there's one to
   show; with one space there's no list (UI-14e), and it keeps the header's own place at the top, Hide
   Sidebar where the closed sidebar's capsule is) */
.sp-top:not(:empty) + .sp-body .sb-head.full { height: 32px; margin: 0 0 8px; }
.sb-space {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  color: var(--fg-strong);
  font: 600 13px var(--font-ui);
}
.sb-space .car { display: inline-flex; color: var(--muted); }
.sb-gap { flex: 1 1 8px; min-width: 8px; }
.term-pick {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font: 500 12px var(--font-ui);
}
.term-pick .tn { min-width: 0; overflow: hidden; line-height: 18px; text-overflow: ellipsis; }
.term-pick .car { display: inline-flex; flex: none; }
.term-pick.full { flex: 1; gap: 8px; height: 28px; padding: 0 8px 0 10px; border-radius: 10px; color: var(--fg-strong); font-weight: 600; }
.sp-top:not(:empty) + .sp-body .term-pick.full { height: 32px; }
.term-pick.full .tn { flex: 1; text-align: left; }
.term-arrow {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  color: var(--fg);
}
.term-arrow:disabled { opacity: .35; }

/* ---- New ⌄ and Select; while selecting, how many, Move to Bin and Done */
.sb-actions {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 4px;
  padding: 0 2px;
}
.sb-actions.selbar { gap: 4px; height: 28px; padding: 0 2px 0 10px; border-radius: 10px; background: var(--fill); }
.sel-n { flex: 1; min-width: 0; overflow: hidden; color: var(--fg); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sb-small {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  color: var(--fg);
  font: 500 12px var(--font-ui);
  white-space: nowrap;
}
.sb-small.quiet { color: var(--muted); transition: opacity 160ms var(--ease), background-color 120ms var(--ease); }
.sb-small .car { display: inline-flex; }
/* New's panel covers Select while it's open: Select fades out under it */
.sb-actions.menu-open > .sb-small.quiet { opacity: 0; }
.sb-small.strong { color: var(--fg-strong); font-weight: 600; }
.sb-small.danger { color: var(--drift-text); }
.sb-small:disabled { opacity: .35; }

/* ---- the list: it scrolls, with the Bin at its foot */
.sb-scroll {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin: 4px -8px 0;
  padding: 0 8px;
  overflow: auto;
}
.sb-list { display: flex; flex: none; flex-direction: column; }
.sb-fill { flex: 1; min-height: 16px; }
.sb-blank {
  margin: 2px 4px 0;
  padding: 10px;
  border: 1px dashed var(--sep);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.sb-blank[hidden] { display: none; }

.sb-row { position: relative; border-radius: 10px; }
.sb-main,
.sb-binbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  height: 28px;
  padding: 0 30px 0 10px;
  border: 0;
  border-radius: 10px;
  color: var(--fg);
  font: 400 13px var(--font-ui);
  text-align: left;
  white-space: nowrap;
}
/* however narrow the sidebar, the tick and icons keep their size and the name gives way, with … */
.sb-main > :not(.sb-name) { flex-shrink: 0; }
/* every fill on a row is 26 of its 28: the selected row and a hovered one beside it sit 2 apart, fill edge
   to fill edge (UI-14d, Tom: they touched). The row's 1 px above and below does it, so a fill on the row itself
   (a drop target, its ⋯ menu's header and its fill handed back) is 26 too; the rows keep their places */
.sb-row { padding-block: 1px; background-clip: content-box; }
.sb-row > .sb-main { height: 26px; }
.sb-row.nested .sb-main { padding-left: 48px; }
.sb-row.dir .sb-main { gap: 6px; padding-left: 4px; }
.sb-row.cur .sb-main { color: var(--fg-strong); }
/* the open file: its icon in the accent (selection), as the Spaces menu's current space */
.sb-row.cur .sb-main .sb-ic { color: var(--accent-text); }
.sb-ic { display: inline-flex; flex: none; color: var(--muted); }
/* words for screen readers only */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sb-ic[hidden],
.sb-count[hidden] { display: none; }
.sb-name { flex: 1 1 0; min-width: 0; overflow: hidden; line-height: 20px; text-overflow: ellipsis; }
.sb-count { flex: none; color: var(--muted); font-size: 11px; }
.sb-tw { display: inline-flex; flex: none; justify-content: center; width: 16px; color: var(--muted); transition: transform 200ms var(--ease); }
.sb-tw.open { transform: rotate(90deg); }

/* ⋯ shows on hover, focus, while its menu is open, and always where there's no hover */
.sb-row .more {
  position: absolute;
  top: 2px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 120ms var(--ease), background-color 120ms var(--ease);
}
/* 24 drawn, 28 to click (the row's height) */
.sb-row .more::after,
.sb-binmore::after { position: absolute; inset: -2px; border-radius: 14px; content: ""; }
.sb-row:hover > .more,
.sb-row:focus-within > .more,
.sb-row.menu-on > .more,
.sb-row.cur > .more { opacity: 1; }
.sb-list.selecting .more { visibility: hidden; }
@media (hover: none) { .sb-row .more { opacity: 1; } }

/* Select: the ticks slide in by width */
.mk {
  display: grid;
  flex: none;
  place-items: center;
  box-sizing: border-box;
  width: 0;
  height: 14px;
  margin-right: -8px;
  overflow: hidden;
  border: 0 solid var(--faint);
  border-radius: 4px;
  color: var(--on-accent);
  opacity: 0;
  transition: width 200ms var(--sp-smooth), margin-right 200ms var(--sp-smooth), border-width 200ms var(--sp-smooth), opacity 200ms var(--ease);
}
.mk .ic { opacity: 0; }
.sb-list.selecting .mk { width: 14px; margin-right: 0; border-width: 1.5px; opacity: 1; }
.sb-row.picked > .sb-main .mk,
.sb-row.mixed > .sb-main .mk { border-color: var(--accent); background: var(--accent); }
.sb-row.picked > .sb-main .mk .ic { opacity: 1; }
/* a directory's tick (UI-11): at the same x as a top-level file's (10), its arrow and icon after it; some
   of its files picked shows a dash */
.sb-row.dir .mk { position: relative; margin-right: -6px; transition-property: width, margin, border-width, opacity; }
.sb-list.selecting .sb-row.dir .mk { margin: 0 2px 0 6px; }
.sb-row.mixed .mk::after { position: absolute; top: 50%; left: 50%; width: 7px; height: 1.5px; margin: -.75px 0 0 -3.5px; border-radius: 1px; background: var(--on-accent); content: ""; }

/* a directory's files, opening and shutting with the disclosure */
.sb-kids-in { display: flex; flex-direction: column; }

/* drag and drop: what's being dragged dims; the spot that takes it lights up */
.sb-row.dragging { opacity: .5; }
.sb-row.drop-on { background: var(--drop-on); }
.sb-binbtn.drop-on { box-shadow: inset 0 0 0 1.5px var(--drift-edge); }

/* the rename box, over its row (or the header) */
.ws-side .rename {
  position: absolute;
  top: 3px;
  right: 8px;
  /* (7 left of where the name starts, its border and padding: the words don't move as it opens, UI-11 sweep #12) */
  left: 26px;
  box-sizing: border-box;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  outline: none;
  background: var(--bg);
  color: var(--fg-strong);
  font: 400 13px var(--font-ui);
}
.sb-row.nested > .rename { left: 64px; }
.sb-row.dir > .rename { left: 40px; }
.sb-head > .rename { top: 6px; right: 8px; left: 142px; height: 24px; font-weight: 500; }
.sb-head.full > .rename { top: 6px; right: 60px; left: 38px; font-weight: 600; }
.sp-top:not(:empty) + .sp-body .sb-head.full > .rename { top: 4px; }

/* ---- the list and, under it, the Bin */
.sb-lower { display: flex; flex: 1; flex-direction: column; min-height: 0; }
