/* ── Collapsible side columns ─────────────────────────────────── */
/* Enhanced by static/js/columns.js: .ns-feature-nav, .ns-split-pane__list and
   [data-ns-column]. The rail and the button are injected into Vue-managed
   columns, so `order` (not DOM order) keeps the rail first and the button last.
   Loaded by base.html for the admin, and by pages outside the shell that use
   columns.js (the Billing page, which sets the --ns-* colours from its own tokens).
   ref: journal/makiwara/176_admin_collapsible_columns/, journal/makiwara/530_billing_page/,
        specs/frontend/admin-ui.md */

.ns-column {
  display: flex;
  flex-direction: column;
}

.ns-column__collapse {
  order: 9999;
  margin-top: auto;
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex-shrink: 0;
  height: 30px;
  background-color: var(--ns-bg);
  color: var(--ns-fg-muted);
  border: none;
  border-top: 1px solid var(--ns-border);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.ns-column__collapse:hover {
  color: var(--ns-accent);
  background-color: var(--ns-bg-alt);
}

.ns-column__rail {
  display: none;
}

.ns-column--collapsed {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  flex: 0 0 28px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.ns-column--collapsed > :not(.ns-column__rail) {
  display: none !important;
}

.ns-column--collapsed > .ns-column__rail {
  order: -1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0.8rem 0 0;
  background-color: var(--ns-bg);
  color: var(--ns-fg-muted);
  border: none;
  cursor: pointer;
}

.ns-column--collapsed > .ns-column__rail:hover {
  background-color: var(--ns-bg-alt);
  color: var(--ns-accent);
}

.ns-column__rail-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ns-column__rail-chevron {
  margin-top: auto;
  width: 100%;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-top: 1px solid var(--ns-border);
  font-size: 0.8rem;
}
