.work-grid-wrap {
  position: relative;
}

.work-grid {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  background: #ffffff;
  outline: none;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.work-grid-spacer {
  position: relative;
}

.work-grid-layer,
.work-grid-header-layer,
.work-grid-row-layer,
.work-grid-corner {
  position: absolute;
  top: 0;
  left: 0;
}

.work-grid-header-layer {
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
  z-index: 8;
  pointer-events: none;
}

.work-grid-row-layer {
  z-index: 7;
  pointer-events: none;
}

.work-grid-cell,
.work-grid-col-header,
.work-grid-row-header,
.work-grid-corner {
  box-sizing: border-box;
  border-right: 1px solid #d9e2ea;
  border-bottom: 1px solid #d9e2ea;
}

.work-grid-col-header,
.work-grid-row-header,
.work-grid-corner {
  background: #edf3f8;
  color: #334a5f;
  font-weight: 700;
  user-select: none;
}

.work-grid-row-header,
.work-grid-corner {
  background: #e4ecf3;
  color: #40566b;
  text-align: center;
}

.work-grid-corner {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  display: block;
}

.work-grid-corner-top,
.work-grid-corner-bottom {
  display: grid;
  place-items: center;
  box-sizing: border-box;
}

.work-grid-corner-top {
  background: #f8fafc;
  border-bottom: 1px solid #cfd8e3;
}

.work-grid-cell,
.work-grid-col-header,
.work-grid-row-header {
  position: absolute;
  overflow: hidden;
}

.work-grid-col-header,
.work-grid-row-header {
  display: grid;
  place-items: center;
  padding: 0 6px;
  font-size: 12px;
  pointer-events: auto;
}

.work-grid-col-letter {
  background: #f8fafc;
  color: #4f5f6f;
  font-weight: 500;
  border-bottom: 1px solid #cfd8e3;
}

.work-grid-col-title-row {
  font-weight: 700;
}

.work-grid-col-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.work-grid-cell {
  z-index: 1;
  background: #ffffff;
}

.work-grid-cell.has-link textarea {
  color: #0b63c7 !important;
  cursor: pointer;
  text-decoration: underline;
}

.work-grid-cell.selected {
  box-shadow: inset 0 0 0 2px #1f6feb;
  z-index: 4;
}

.work-grid-col-header.selected,
.work-grid-row-header.selected {
  box-shadow: inset 0 0 0 2px #1f6feb;
  z-index: 9;
}

.work-grid-cell.row-selected,
.work-grid-cell.col-selected {
  box-shadow: inset 0 0 0 1px rgba(31, 111, 235, .7);
  z-index: 3;
}

.work-grid-cell.merged-covered {
  pointer-events: none;
}

.work-grid-cell textarea {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  padding: 4px 6px;
  background: transparent;
  resize: none;
  overflow: auto;
  scrollbar-width: thin;
  font: inherit;
  font-size: 12px;
  color: inherit;
  font-weight: inherit;
  font-style: inherit;
  text-align: inherit;
  line-height: 1.25;
  white-space: pre-wrap;
  word-break: break-word;
}

.work-grid-cell textarea::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.work-grid-cell textarea::-webkit-scrollbar-thumb {
  background: rgba(75, 95, 115, .42);
  border-radius: 8px;
}

.work-grid-cell textarea::-webkit-scrollbar-track {
  background: rgba(229, 236, 243, .55);
}

.work-grid-cell textarea:focus {
  outline: 2px solid #1f6feb;
  outline-offset: -2px;
  background: rgba(255, 255, 255, .86);
  overflow: auto;
}

.work-grid-col-resizer {
  position: absolute;
  top: 0;
  right: -8px;
  width: 16px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.work-grid-row-resizer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 15px;
  cursor: row-resize;
  z-index: 2;
}

.work-grid-col-resizer:hover,
.work-grid-row-resizer:hover {
  background: rgba(31, 111, 235, .22);
}

.work-grid-col-header:hover .work-grid-col-resizer {
  background: rgba(31, 111, 235, .12);
}

.work-grid-row-header:hover .work-grid-row-resizer {
  background: rgba(31, 111, 235, .12);
}

.work-grid-hidden-fields {
  display: none;
}

.column-visibility {
  position: relative;
  display: inline-flex;
}

.column-visibility-menu {
  position: fixed;
  z-index: 100;
  top: 126px;
  right: 12px;
  width: min(360px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 170px));
  overflow: hidden;
  border: 1px solid #b8c7d6;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(24, 43, 62, .18);
}

.column-visibility-menu[hidden] {
  display: none;
}

.column-visibility-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #d9e2ea;
  color: #26384a;
  font-weight: 700;
}

.column-visibility-head button {
  min-width: 96px;
}

.column-visibility-list {
  display: block;
  max-height: 440px;
  overflow: auto;
  padding: 5px 0;
}

.column-visibility-option {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  color: #26384a;
  cursor: pointer;
}

.column-visibility-option:hover {
  background: #f1f6fa;
}

.column-visibility-option input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.column-visibility-option span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .column-visibility-menu {
    top: 112px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100vh - 128px);
  }
}

.work-grid-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 32, 42, .35);
}

.work-grid-editor {
  width: min(1180px, calc(100vw - 48px));
  height: min(680px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #ffffff;
  border: 1px solid #b8c7d6;
  border-radius: 6px;
  box-shadow: 0 18px 44px rgba(16, 32, 48, .24);
}

.work-grid-editor-head,
.work-grid-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #d9e2ea;
}

.work-grid-editor-actions {
  justify-content: flex-end;
  border-top: 1px solid #d9e2ea;
  border-bottom: 0;
}

.work-grid-editor-title {
  color: #334a5f;
  font-weight: 700;
}

.work-grid-editor textarea {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: 0;
  padding: 12px;
  resize: none;
  overflow: auto;
  font: 13px Arial, sans-serif;
  line-height: 1.35;
  white-space: pre-wrap;
}

.work-grid-editor textarea:focus {
  outline: none;
}
