@layer clickui {/* stylelint-disable custom-property-pattern -- design tokens use camelCase (e.g. selectDirect) */

/*
 * The original styled-component dispatches background / text colour / border
 * colour off `$type` (body|header) and `$selectionType`, and toggles individual
 * borders / a `::before` overlay off boolean flags. Colours are aliased to local
 * custom properties (set by the type + selection modifiers) so the shared border
 * / overlay rules can reference them once.
 */

.cell__OXAxg {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: var(--cell-space-y) var(--cell-space-x);
  overflow: hidden;
  border-top: 1px solid var(--cell-stroke-default);
  border-left: 1px solid var(--cell-stroke-default);
  background: var(--cell-background);
  color: var(--cell-color);
  font: var(--click-grid-cell-text-default);
  text-align: left;
  white-space: nowrap;
  cursor: default;
  text-overflow: ellipsis;
}

.cell__OXAxg[data-align='right'] {
  text-align: right;
}

.cell_type_body__SohuF {
  --cell-stroke-default: var(--click-grid-body-cell-color-stroke-default);
  --cell-stroke-select-direct: var(--click-grid-body-cell-color-stroke-selectDirect);
  --cell-stroke-last: var(--click-grid-body-cell-color-stroke-default);
  --cell-space-y: var(--click-grid-body-cell-space-y);
  --cell-space-x: var(--click-grid-body-cell-space-x);
  --cell-background: var(--click-grid-body-cell-color-background-default);
  --cell-color: var(--click-grid-body-cell-color-text-default);
}

.cell_type_body__SohuF.cell_selection_indirect__6e6yy {
  --cell-stroke-last: var(--click-grid-body-cell-color-stroke-selectIndirect);
  --cell-background: var(--click-grid-body-cell-color-background-selectIndirect);
  --cell-color: var(--click-grid-body-cell-color-text-selectIndirect);
}

.cell_type_body__SohuF.cell_selection_direct__QEL9m {
  --cell-stroke-last: var(--click-grid-body-cell-color-stroke-selectDirect);
  --cell-background: var(--click-grid-body-cell-color-background-selectDirect);
  --cell-color: var(--click-grid-body-cell-color-text-selectDirect);
}

.cell_type_header__3tsr- {
  --cell-stroke-default: var(--click-grid-header-cell-color-stroke-default);
  --cell-stroke-select-direct: var(--click-grid-header-cell-color-stroke-selectDirect);
  --cell-stroke-last: var(--click-grid-header-cell-color-stroke-default);
  --cell-space-y: var(--click-grid-header-cell-space-y);
  --cell-space-x: var(--click-grid-header-cell-space-x);
  --cell-background: var(--click-grid-header-cell-color-background-default);
  --cell-color: var(--click-grid-header-cell-color-title-default);
}

.cell_type_header__3tsr-.cell_selection_indirect__6e6yy {
  --cell-stroke-last: var(--click-grid-header-cell-color-stroke-selectIndirect);
  --cell-background: var(--click-grid-header-cell-color-background-selectIndirect);
  --cell-color: var(--click-grid-header-cell-color-title-selectIndirect);
}

.cell_type_header__3tsr-.cell_selection_direct__QEL9m {
  --cell-stroke-last: var(--click-grid-header-cell-color-stroke-selectDirect);
  --cell-background: var(--click-grid-header-cell-color-background-selectDirect);
  --cell-color: var(--click-grid-header-cell-color-title-selectDirect);
}

/* header cell with no border removes top/left edges on the corner cells */
.cell_type_header__3tsr-.cell_no-border__9gXDK[data-grid-row='-1'] {
  border-top: none;
}

.cell_type_header__3tsr-.cell_no-border__9gXDK[data-grid-column='-1'] {
  border-left: none;
}

/* a focused cell draws its last-edge borders with the select-direct stroke */
.cell_focused__cmh-b {
  box-shadow: inset 0 0 0 1px var(--cell-stroke-select-direct);
}

/*
 * Focus must win the last-edge stroke colour over any selection state. The
 * original styled-component resolved the last-row / last-column border colour
 * inline as `stroke[$isFocused ? 'selectDirect' : $selectionType]`, so focus
 * always overrode the selection stroke. The `.cell_type_*.cell_selection_*`
 * rules above set `--cell-stroke-last` at (0,2,0) specificity, so the focus
 * override is qualified with the type class to match that specificity and,
 * coming later in source order, take precedence. `.cell_focused` always
 * co-occurs with a type class.
 */
.cell_type_body__SohuF.cell_focused__cmh-b,
.cell_type_header__3tsr-.cell_focused__cmh-b {
  --cell-stroke-last: var(--cell-stroke-select-direct);
}

/* only the last row/column draw the closing border, colored by focus/selection */
.cell_last-row__DoJdk {
  border-bottom: 1px solid var(--cell-stroke-last);
}

.cell_last-column__LgKM7 {
  border-right: 1px solid var(--cell-stroke-last);
}

/* rowAutoHeight resets the entire border last, overriding every rule above */
.cell_row-auto-height__yzQUR {
  min-height: auto;
  overflow-y: auto;
  border: none;
}

/* selection / focus overlay drawn on top of the cell so adjacent borders meet */
.cell__overlay__U9XGO::before {
  content: '';
  position: absolute;
  inset: 0;
}

.cell__overlay_selected_top__OMUJB::before {
  border-top: 1px solid var(--cell-stroke-select-direct);
}

.cell__overlay_selected_left__MiimG::before {
  border-left: 1px solid var(--cell-stroke-select-direct);
}

.cell__overlay_selected_bottom__2ra9F::before {
  border-bottom: 1px solid var(--cell-stroke-select-direct);
}

.cell__overlay_selected_right__Dt-g5::before {
  border-right: 1px solid var(--cell-stroke-select-direct);
}

.cell__overlay_row-auto-height__teKk1::before {
  border: none;
}
}
