/* The Keep chapter's widgets: the start screen's Last session line with the
   resume commands Deck types, and terminals beside the docked side panel.
   Real px, the app's own values. */

/* ---------- restore ---------- */

.w-restore {
  padding: 14px;
  background: var(--sg-bg);
}

/* `.nt-last-session`: one raised row above the composer, quieter than it —
   the clock, the title, the meta, a secondary Reopen, and the dismiss. */
.w-last {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--sg-hair-strong);
  border-radius: 10px;
  background: var(--sg-rail);
}

.w-last__text {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: baseline;
  gap: 8px;
}

.w-last__text b {
  flex: none;
  font: 560 12.5px / 1.3 var(--font-display);
}

.w-last__text span {
  overflow: hidden;
  color: var(--sg-fg-faint);
  font: 450 11px / 1.3 var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.w-btn--solid {
  padding: 5px 10px;
  border-color: var(--sg-hair-strong);
  background: var(--sg-chrome-2);
}

.w-last__x {
  margin: 0 8px 0 4px;
}

/* What Reopen types, one pane each. */
.w-resume {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding: 0 4px;
}

.w-resume__line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.w-resume__line .w-mark {
  margin-top: 2px;
}

.w-resume__cmd {
  min-width: 0;
  color: var(--sg-fg);
  font: 400 12.5px / 1.5 var(--tree-mono);
  overflow-wrap: anywhere;
}

.w-resume__cmd::before {
  margin-right: 8px;
  color: var(--sg-green);
  content: "❯";
}

/* ---------- surfaces ---------- */

/* The stage's gutter is the rail's colour; the pane is a rounded card on it and
   the dock a column against its right edge (DL-19, `06-stage-panes.css`). */
.w-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.w-pane {
  display: flex;
  min-width: 10rem;
  flex: 1 1 14rem;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--sg-hair-strong);
  border-radius: 6px;
  background: var(--sg-bg);
}

.w-pane header {
  display: flex;
  height: 33px;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--sg-bg);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

.w-pane header span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.w-pane__body {
  flex: 1;
  padding: 6px 11px 12px;
  font: 400 11px / 1.55 var(--tree-mono);
}

.w-pane__line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.w-pane__line.is-user,
.w-pane__line.is-body {
  color: var(--sg-fg);
}

.w-pane__line.is-tool {
  color: var(--sg-fg-faint);
}

/* The docked side panel: icon-only tabs on top, then the explorer. */
.w-dock {
  display: flex;
  min-width: 11rem;
  flex: 0 0 12.5rem;
  flex-direction: column;
  border-left: 1px solid var(--sg-hairline);
}

.w-dock__head {
  display: flex;
  height: 34px;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 0 6px;
}

.w-dock__tab,
.w-dock__hide {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  color: var(--sg-fg-faint);
}

.w-dock__tab .w-icon,
.w-dock__hide.w-icon {
  width: 15px;
  height: 15px;
  color: inherit;
}

.w-dock__tab.is-active {
  background: var(--w-active);
  color: var(--sg-fg);
}

.w-dock__hide {
  margin-left: 2px;
}

.w-dock__switch {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  padding: 0 6px;
}

.w-dock__switch > span {
  display: flex;
  height: 22px;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border-radius: 6px;
  color: var(--sg-fg-faint);
  font-size: 12px;
}

.w-dock__switch .is-active {
  background: var(--w-active);
  color: var(--sg-fg);
}

/* Changes carries `+N −M` once there is something to count; added lines are
   green and removed ones red (DL-3.2). */
.w-dock__switch small {
  color: var(--sg-fg-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.w-dock__switch i {
  font-style: normal;
}

.w-dock__switch .is-add {
  color: var(--sg-green);
}

.w-dock__switch .is-del {
  color: var(--sg-red);
}

/* A tree row is 22px (docs/internals/file-surface.md): one caret and one glyph
   at the folder's depth. */
.w-tree {
  padding: 4px 0;
}

.w-tree__row {
  display: flex;
  height: 22px;
  align-items: center;
  gap: 4px;
  padding: 0 8px 0 calc(8px + var(--depth) * 12px);
  color: var(--sg-fg-dim);
  font-size: 12px;
  white-space: nowrap;
}

.w-tree__row.is-root {
  color: var(--sg-fg);
  font-weight: 560;
}

.w-tree__row .w-icon {
  width: 13px;
  height: 13px;
}

.w-tree__row .w-tree__caret {
  width: 10px;
  height: 10px;
}

.w-tree__row span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Narrow: the dock drops under the pane and takes its full width. */
@media (max-width: 40rem) {
  .w-pane,
  .w-dock {
    flex-basis: 100%;
  }

  .w-dock {
    border-top: 1px solid var(--sg-hairline);
    border-left: 0;
  }

  .w-dock__head {
    justify-content: flex-start;
  }
}

/* The chords that open and drive it. */
.w-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 14px 6px 4px;
}

.w-keys span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--sg-fg-dim);
  font-size: 12.5px;
}

.w-keys kbd {
  min-width: 3.1rem;
  padding: 2px 6px;
  border: 1px solid var(--sg-hair-strong);
  border-radius: 5px;
  color: var(--sg-fg);
  font: 500 11px / 1.4 var(--font-mono);
  text-align: center;
}
