/* ==========================================================================
   RIVENHOLD — the right-hand rail
   Every dock button is the same box: a fixed square, icon centred in the top
   row, one-line label in the bottom row. Modules add their own buttons with
   their own markup, so the shape is enforced here rather than in each of them.
   ========================================================================== */

.tr-dock {
  display: grid;
  grid-auto-flow: row;
  grid-auto-rows: auto;
  justify-items: center;
  align-items: start;
  gap: 6px;
  right: 10px;
  bottom: 96px;
}

.tr-dock .tr-dock-btn {
  box-sizing: border-box;
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  height: 58px;
  padding: 5px 2px 4px;
  display: grid;
  grid-template-rows: 30px 1fr;
  align-content: center;
  justify-items: center;
  align-items: center;
  gap: 2px;
  border-radius: 12px;
  text-align: center;
  line-height: 1;
  overflow: visible;
}
.tr-dock .tr-dock-btn:hover { transform: none; }

/* icon cell: fixed, so a 24px glyph and a 34px glyph still sit on the same line */
.tr-dock .tr-dock-btn > .tr-dock-ic,
.tr-dock .tr-dock-btn > .tr-dock-ic > svg {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto;
}
.tr-dock .tr-dock-btn > .tr-dock-ic { display: grid; place-items: center; }

/* label cell: one line, clipped rather than pushing the box wider */
.tr-dock .tr-dock-btn > small {
  display: block;
  width: 100%;
  max-width: 54px;
  margin: 0 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the fold handle is a strip, not a square: it sits at the end of the rail */
.tr-dock .dock-fold {
  height: 26px;
  min-height: 26px;
  grid-template-rows: 1fr;
  padding: 2px 0 3px;
  border-radius: 9px;
}
.tr-dock .dock-fold .df-ar { font: 900 13px/1 sans-serif; }
.tr-dock .dock-fold small { font-size: 9px; }

/* a rail with nothing in it should not float there */
.tr-dock:not(:has(.tr-dock-btn)) { display: none; }

/* badges ride the top-right corner of the square, never re-centre the icon */
.tr-dock .tr-dock-btn .tr-badge { position: absolute; top: -5px; right: -5px; }

@media (max-width: 900px) {
  .tr-dock { gap: 5px; right: 8px; bottom: 84px; }
  .tr-dock .tr-dock-btn { width: 52px; min-width: 52px; max-width: 52px; height: 52px; grid-template-rows: 26px 1fr; }
  .tr-dock .tr-dock-btn > .tr-dock-ic,
  .tr-dock .tr-dock-btn > .tr-dock-ic > svg { width: 26px; height: 26px; }
  .tr-dock .tr-dock-btn > small { font-size: 9px; max-width: 48px; }
}
