/* ===== Sheet rename UI layout (Edit/Share common) =====
   Goals:
   - Keep icon buttons compact (do not inherit wide button sizing).
   - Give rename input the space (flex-grow).
   - Avoid overlap with Create button in the same row.
*/

#sheet-select-wrapper,
#save-target-sheet-wrapper{
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Select itself should be able to shrink without forcing overflow */
#sheet-select,
#save-target-sheet{
  min-width: 0;
  flex: 1 1 auto;
}

/* The injected rename UI root (created by sheet-rename.module.js) */
#sheet-rename-root{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

/* Label: keep compact with ellipsis */
#sheet-rename-label{
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: .85;
}

/* Rename input should be the main width consumer while editing */
#sheet-rename-input{
  flex: 1 1 auto;
  min-width: 140px;
  width: 100%;
  box-sizing: border-box;
}

/* Compact icon buttons (pencil / ok / cancel) */
.sr-btn{
  width: 28px;
  height: 28px;
  min-width: 28px; /* override global min-width rules */
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-sizing: border-box;
  flex: 0 0 auto;
}

/* Busy spinner stays small */
#sheet-rename-spin{
  flex: 0 0 auto;
  font-size: 14px;
  opacity: .8;
}

/* When renaming, hide the select to avoid squashing everything */
#save-target-sheet-wrapper.is-renaming > #save-target-sheet{
  display: none;
}
#sheet-select-wrapper.is-renaming > #sheet-select{
  display: none;
}

/* Optional: busy state also hides select (keeps the row stable) */
#save-target-sheet-wrapper.is-busy > #save-target-sheet,
#sheet-select-wrapper.is-busy > #sheet-select{
  display: none;
}
