.projectRow,
.sessionRow {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 0 8px;
  cursor: pointer;
  user-select: none;
  color: var(--dsw-alias-label-primary);
}

.projectRow:hover,
.sessionRow:hover {
  background: var(--dsw-alias-interactive-bg-hover);
}

.sessionRow.selected {
  background: var(--dsw-alias-interactive-bg-hover);
}

.searchResultRow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  border: none;
  border-radius: 8px;
  padding: 4px 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--dsw-alias-label-primary);
}

.searchResultRow:hover {
  background: var(--dsw-alias-interactive-bg-hover);
}

.searchResultRow.selected {
  background: var(--dsw-alias-interactive-bg-hover);
}

.searchResultHeading {
  display: flex;
  align-items: center;
  min-width: 0;
}

.searchResultTitle {
  min-width: 0;
  margin-left: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 20px;
}

.searchResultMeta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-left: 20px;
}

.searchResultWorkspace,
.searchResultSnippet {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 17px;
}

.searchResultWorkspace {
  flex: none;
  max-width: 40%;
  color: var(--dsw-alias-label-tertiary);
}

.searchResultSnippet {
  flex: 1;
  min-width: 0;
  color: var(--dsw-alias-label-secondary);
}

/* Compact one-line Workspace row after removing the session-count subtitle. */
.projectRow {
  height: 34px;
  align-items: center;
  box-sizing: border-box;
}

.projectRow .rowActions {
  height: 20px;
}

/* Session cell (figma): pad 8, a 16px status slot, then a 4px title gap. */
.sessionRow {
  height: 32px;
  gap: 0;
  /* Mount fade: session rows appear by unfolding a group (or the tree
     mounting). Stable row keys keep already-visible rows from replaying it. */
  animation: row-in 150ms var(--ds-ease-in-out);
}

.sessionRow .title {
  margin: 0 6px 0 4px;
}

.flatSessionRowWithoutStatus .title {
  margin-left: 0;
}

@keyframes row-in {
  from { opacity: 0; }
}

.slot {
  flex: none;
  width: 16px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dsw-alias-label-tertiary);
}

.visuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.folderActive {
  color: var(--dsw-alias-state-business-primary);
}


/* Project leading slot: folder by default, expand arrow on row hover. */
.projectRow .chevron { display: none; }
.projectRow:hover .chevron { display: inline-flex; }
.projectRow:hover .folder { display: none; }

/* Expand arrow (filled triangle): points right closed, rotates to point down open. */
.arrow {
  transition: transform 150ms var(--ds-ease-in-out);
}

.arrowOpen {
  transform: rotate(90deg);
}

.projectText {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 20px;
}

.renameInput {
  min-width: 0;
  font-size: 14px;
  line-height: 20px;
  padding: 0 2px;
  border: 1px solid var(--dsw-alias-border-l2);
  border-radius: 4px;
  background: var(--dsw-alias-button-elevated-fill);
  color: inherit;
  outline: none;
}

.sessionRow .title {
  flex: 1;
}

.meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 20px;
  color: var(--dsw-alias-label-tertiary);
}

.time {
  flex: none;
  font-size: 12px;
  line-height: 20px;
  color: var(--dsw-alias-label-tertiary);
}

.dot {
  flex: none;
}

/* Trailing action buttons surface on hover only (figma 27:4668 / 27:4656):
   bare 16px glyphs, gap 12, tertiary grey. */
.rowActions {
  flex: none;
  display: none;
  align-items: center;
  gap: 12px;
}

.projectRow:hover .rowActions,
.sessionRow:hover .rowActions,
.projectRow.menuOpen .rowActions,
.sessionRow.menuOpen .rowActions {
  display: inline-flex;
}

.sessionRow:hover .time,
.sessionRow.menuOpen .time {
  display: none;
}

/* An open row menu pins the hover affordances (figma: the row keeps its
   hover fill while its dropdown is up). */
.projectRow.menuOpen,
.sessionRow.menuOpen {
  background: var(--dsw-alias-interactive-bg-hover);
}

/* Session drag insert marker: a leading chevron and 2px rule between rows,
   absolutely positioned so it neither resembles a row border nor changes layout. */
.sessionRow.dropBefore,
.sessionRow.dropAfter {
  position: relative;
}

.sessionRow.dropBefore::before,
.sessionRow.dropAfter::after {
  content: '';
  position: absolute;
  z-index: 1;
  left: 0;
  right: 4px;
  height: 12px;
  background:
    linear-gradient(
      55deg,
      transparent calc(50% - 1px),
      var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px),
      transparent calc(50% + 1px)
    ) 0 0 / 5px 7px no-repeat,
    linear-gradient(
      125deg,
      transparent calc(50% - 1px),
      var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px),
      transparent calc(50% + 1px)
    ) 0 5px / 5px 7px no-repeat,
    linear-gradient(
      var(--dsw-alias-state-business-primary) 0 0
    ) 4px 5px / calc(100% - 4px) 2px no-repeat;
  pointer-events: none;
}

.sessionRow.dropBefore::before {
  top: -7px;
}

.sessionRow.dropAfter::after {
  bottom: -7px;
}

/* Hover-card body (figma 169:16903): dark surface, fixed colors both themes. */
.hoverContent {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hoverTitle {
  font-size: 14px;
  line-height: 20px;
  color: #FFFFFF;
  overflow-wrap: break-word;
}

.hoverPath {
  font-size: 12px;
  line-height: 16px;
  color: #CFD3D6;
  word-break: break-all;
}

.hoverTime {
  font-size: 12px;
  line-height: 16px;
  color: #CFD3D6;
}

.hoverStatus {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 20px;
  color: #ADB2B8;
}

.iconButton {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 4px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  color: var(--dsw-alias-label-tertiary);
}

.iconButton:hover {
  color: var(--dsw-alias-label-primary);
}

/* Chevrons ride the caption grey (#ADB2B8); the folder glyph stays one step
   darker (tertiary, #81858C) per the cell spec. */
.chevron {
  color: var(--dsw-alias-label-caption);
}

@media (prefers-reduced-motion: reduce) {
  .sessionRow,
  .arrow {
    animation: none;
    transition: none;
  }
}
