/* Planned modules stay in the publishing sequence without opening a workspace. */
#sidebar #citations-nav > span > svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#sidebar .sidebar-nav-spacer {
  visibility: hidden;
  pointer-events: none;
}
#sidebar {
  overflow: hidden;
  background: #fff !important;
  padding-top: 24px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
#sidebar .brand {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0 0 22px;
  padding: 0 4px;
}
#sidebar .brand .brand-logo {
  width: auto !important;
  height: 44px !important;
  max-width: 100% !important;
}
#sidebar .brand-cube {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#sidebar .sidebar-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 2px;
  scrollbar-width: thin;
  scrollbar-color: #cad5e7 transparent;
}
#sidebar .sidebar-content > * { flex-shrink: 0; }
#sidebar .sidebar-nav-spacer { display: none; }
#sidebar :is(.history-list, .selfcheck-history-list) {
  flex: 1 0 auto;
  overflow: visible;
}
#sidebar .sidebar-bottom {
  flex: none;
  margin-top: 0;
  padding: 16px 6px 0;
  border: 0;
  background: #fff;
}
#sidebar .sidebar-bottom :is(.sidebar-collapse, .sidebar-pin),
#sidebar .sidebar-bottom :is(.sidebar-collapse, .sidebar-pin):hover {
  width: 36px !important;
  height: 36px !important;
  border: 0;
  border-radius: 8px !important;
  background: #f3f6fb;
  color: #7183a0;
  box-shadow: none !important;
  transform: none;
}
#sidebar .sidebar-bottom :is(.sidebar-collapse, .sidebar-pin):hover {
  background: #eaf0fa;
  color: #426291;
}
#sidebar .sidebar-content .nav-item {
  color: #2d3e56;
  font-weight: 500;
  --sidebar-glass-surface: rgb(244 247 252 / .66);
  border: 0;
  background: var(--sidebar-glass-surface);
  box-shadow: none;
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
}
#sidebar .sidebar-content .nav-item:not(:disabled):hover {
  --sidebar-glass-surface: rgb(237 243 252 / .84);
}
#sidebar .sidebar-content .nav-item.active {
  --sidebar-glass-surface: rgb(229 238 252 / .76);
  color: #2448a8;
  font-weight: 600;
}
#sidebar .sidebar-content .nav-item > span {
  border: 0;
  background: transparent;
  box-shadow: none;
}
#sidebar .sidebar-content > .nav-item {
  position: relative;
  align-items: center;
  justify-content: center;
  text-align: center;
}
#sidebar .sidebar-content > .nav-item > span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}
#sidebar .sidebar-content > .nav-item-planned > small {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}
#sidebar .sidebar-content .nav-item:disabled {
  --sidebar-glass-surface: rgb(247 248 251 / .58);
  color: #8b95a6;
}
#sidebar.collapsed .sidebar-content .nav-item {
  border: 0 !important;
  background: var(--sidebar-glass-surface) !important;
  box-shadow: none !important;
}
#sidebar.collapsed .sidebar-content .nav-item:not(:disabled):is(:hover, .active) {
  color: #315ac2 !important;
}
#sidebar.collapsed .sidebar-content > .nav-item:disabled { color: #9b85bc !important; }
#sidebar .nav-item-planned,
#sidebar .nav-item-planned:hover {
  color: #8b95a6;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
#sidebar .nav-item-planned > span {
  color: #9b85bc;
  background: #f5f0fa;
  border-color: #e8dff2;
}
#sidebar .nav-item-planned > small {
  margin-left: auto;
  padding: 3px 5px;
  border-radius: 5px;
  background: #e8eaf0;
  color: #8b95a6;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}
@media (min-width: 781px) {
  #sidebar:not(.collapsed) .new-project { margin-bottom: 18px; }
  #sidebar:not(.collapsed) .nav-section { margin-top: 0; }
  .sidebar-collapsed #sidebar .nav-item-planned > small { display: none; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  #sidebar:not(.collapsed) .sidebar-content > .nav-item { padding-inline: 10px; gap: 9px; }
  #sidebar:not(.collapsed) .sidebar-content > .nav-item > span { left: 8px; }
}

/* Keep the folded rail compact and its controls independent of scrolling. */
@media (min-width: 761px) {
  #sidebar.collapsed .sidebar-content { padding-inline: 0; scrollbar-width: none; }
  #sidebar.collapsed .sidebar-content::-webkit-scrollbar { display: none; }
  #sidebar.collapsed .sidebar-content > .nav-item { width: 100% !important; }
  #sidebar.collapsed .sidebar-content > .nav-item > span {
    position: static;
    transform: none;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #sidebar.collapsed .sidebar-bottom { padding: 16px 0 0; }
  #sidebar.collapsed :is(.selfcheck-history-heading, .selfcheck-history-list) {
    display: none !important;
  }
  #sidebar.collapsed .brand {
    margin-inline: 0;
    visibility: visible;
    pointer-events: auto;
  }
  #sidebar.collapsed .conversion-space-tools {
    width: 62px;
    margin: 0 0 11px;
    padding-left: 0;
    border-left: 0;
  }
  #sidebar.collapsed .conversion-space-tools .nav-item {
    width: 54px !important;
    height: 54px !important;
    min-height: 54px;
    border-radius: 11px !important;
    box-shadow: none !important;
  }
  #sidebar.collapsed .conversion-space-tools .nav-item > span {
    width: 100%;
    height: 100%;
    font-size: 24px !important;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
  }
}

/* All sidebar feature pages share the same borderless workspace toolbar. */
.main > .topbar {
  border-bottom: 0;
  box-shadow: none;
}

/* Match the service directory's text-only return pill. */
.topbar .workspace-header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  padding: 9px 20px;
  border: 0;
  border-radius: 999px;
  background: #f3f3f3;
  color: #28323f;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.topbar .workspace-header-action:hover {
  transform: none;
  background: #eaeaea;
  color: #171e2b;
  box-shadow: none;
}
.topbar .workspace-header-action:focus-visible {
  outline: 2px solid #6380cc;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  .topbar .workspace-header-action {
    min-height: 36px;
    padding: 7px 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .topbar .workspace-header-action { transition: none; }
}
