.section-shell {
  --section-rail-width: 220px;
  --section-rail-collapsed-width: 0px;
  --section-rail-gap: 24px;
  display: grid;
  grid-template-columns: var(--section-rail-width) minmax(0, 1fr);
  gap: var(--section-rail-gap);
  align-items: start;
}

.section-rail {
  min-width: 0;
  transition: width 220ms ease, min-width 220ms ease, margin 220ms ease, opacity 180ms ease, transform 220ms ease;
}

.section-main {
  min-width: 0;
}

.section-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-rail-toggle,
.section-rail-reopen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color, rgba(255,255,255,0.12));
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, rgba(255,255,255,0.7));
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.section-rail-toggle:hover,
.section-rail-reopen:hover {
  border-color: var(--color-primary, #1b708b);
  color: var(--color-primary, #1b708b);
  background: rgba(27, 112, 139, 0.06);
}

.section-rail-reopen {
  display: none;
  margin-bottom: 16px;
}

.section-rail-utility-btn {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.section-rail-utility-btn:hover {
  border-color: var(--color-primary, #1b708b);
  color: var(--color-primary, #1b708b);
  background: rgba(27, 112, 139, 0.08);
}

.section-rail-utility-status {
  min-height: 14px;
  margin-top: 6px;
  font-size: 11px;
  text-align: center;
  color: rgba(255,255,255,0.5);
}

.section-rail-collapsed {
  grid-template-columns: var(--section-rail-collapsed-width) minmax(0, 1fr);
}

.section-rail-collapsed > .section-rail {
  width: 0;
  min-width: 0;
  margin-right: calc(var(--section-rail-gap) * -1);
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-10px);
}

.section-rail-collapsed > .section-main .section-rail-reopen {
  display: inline-flex;
}

body.ds-refresh .section-shell.section-rail-collapsed,
body.ds-refresh .section-shell {
  transition: grid-template-columns 220ms ease;
}

body.ds-refresh .section-shell .section-rail {
  position: sticky;
  top: 72px;
  height: calc(100vh - 88px);
  overflow-y: auto;
  border-radius: 0;
}

body.ds-refresh .section-shell .section-main {
  min-width: 0;
}

body.ds-refresh .section-shell .section-rail-toggle,
body.ds-refresh .section-shell .section-rail-reopen {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

body.ds-refresh .section-shell .section-rail-utility-btn {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

body.ds-refresh .section-shell .section-rail-utility-status {
  color: var(--text-muted);
}

body.ds-refresh .section-shell .section-rail-toggle:hover,
body.ds-refresh .section-shell .section-rail-reopen:hover {
  background: var(--surface-subtle);
}

@media (max-width: 960px) {
  .section-shell,
  .section-rail-collapsed {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .section-rail,
  .section-rail-collapsed > .section-rail {
    position: static !important;
    width: auto;
    height: auto;
    min-width: 0;
    margin-right: 0;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    transform: none;
  }

  .section-rail-toggle,
  .section-rail-reopen {
    display: none !important;
  }
}
