[data-ui-surface="table-workspace"] {
  --arhix-canvas-ink: var(--arhix-ink);
  --table-workspace-axis-header-height: var(--arhix-control-height);
  --table-workspace-cell-min-size: var(--arhix-control-height);
  --table-workspace-row-header-width: var(--arhix-header-height);
  --table-workspace-source-field-width: 152px;
}

.table-workspace__axis-size > :is(input, span) {
  line-height: var(--arhix-control-height);
}

.table-workspace__bar--identity,
.table-workspace__bar--commands {
  gap: var(--arhix-space-gap);
}

.table-workspace__command-mode {
  display: flex;
  min-width: 0;
  flex: none;
  align-items: center;
  gap: var(--arhix-space-gap);
}

.table-workspace__command-mode[hidden] { display: none; }

.table-workspace__merge-command {
  flex: none;
  margin: 0;
}

[data-ui-surface="shell"] .table-workspace__merge-command > span {
  background: var(--arhix-surface-pill);
  box-shadow: var(--arhix-shadow-pill);
}

[data-ui-surface="shell"] .table-workspace__merge-command:active:not(:disabled) > span {
  box-shadow: var(--arhix-shadow-pill-pressed);
}

[data-ui-surface="shell"] .table-workspace__merge-command:disabled {
  color: var(--arhix-ink-ghost);
  cursor: default;
}

[data-ui-surface="shell"] .table-workspace__merge-command:disabled > span {
  background: transparent;
  box-shadow: none;
}

[data-ui-surface="shell"] .table-workspace__merge-command > span[hidden] {
  display: none;
}

.table-workspace__bar--identity { justify-content: flex-start; }

.table-workspace__identity-controls {
  display: flex;
  align-items: center;
  gap: var(--arhix-space-gap);
  margin-inline-start: auto;
}

.table-workspace__bar--identity > .workspace-chrome__state {
  margin-inline-start: 0;
}

[data-ui-surface="table-workspace"]
  .table-workspace__source-control > .inspector-panel__field {
  width: 100%;
  margin: 0;
}
[data-ui-surface="table-workspace"]
  [data-table-workspace-tag] .inspector-panel__field-select-left {
  display: block;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-ui-surface="table-workspace"]
  .table-workspace__command-mode > :is(
    .table-workspace__source-control,
    .table-workspace__axis-size
  ) {
  flex: 0 0 var(--table-workspace-source-field-width);
  width: var(--table-workspace-source-field-width);
  min-width: var(--table-workspace-source-field-width);
  max-width: var(--table-workspace-source-field-width);
  margin: 0;
}
[data-ui-surface="table-workspace"]
  .table-workspace__identity-controls > .table-workspace__source-control {
  flex: 0 0 var(--table-workspace-source-field-width);
  width: var(--table-workspace-source-field-width);
  min-width: var(--table-workspace-source-field-width);
  max-width: var(--table-workspace-source-field-width);
}
.table-workspace__axis-size[hidden] { display: none; }
.table-workspace__column-name {
  width: var(--table-workspace-source-field-width);
}
[data-ui-surface="table-workspace"]
  .table-workspace__command-mode > .table-workspace__column-name {
  margin: 0;
}
.table-workspace__column-name[hidden],
[data-table-workspace-column-source][hidden] { display: none; }
[data-ui-surface="table-workspace"]
  .table-workspace__formula-control > .inspector-panel__field {
  width: var(--table-workspace-source-field-width);
  margin: 0;
}
.table-workspace__formula-control[hidden] { display: none; }

.table-workspace__formula-editor {
  width: 280px;
  min-height: var(--arhix-control-height);
  box-sizing: border-box;
  overflow: hidden;
  padding: 0 var(--arhix-space-inset);
  border: 0;
  border-radius: var(--arhix-radius-control);
  background: var(--arhix-surface);
  color: var(--arhix-ink);
  line-height: var(--arhix-control-height);
  outline: 0;
  white-space: nowrap;
}

.table-workspace__formula-editor[hidden] { display: none; }
.table-workspace__formula-editor:focus { box-shadow: inset 0 0 0 1px var(--arhix-accent); }

.table-workspace__formula-token { font-weight: inherit; }

.table-workspace__text-font,
.table-workspace__text-size {
  width: var(--table-workspace-source-field-width);
  flex: none;
}

[data-ui-surface="table-workspace"]
  :is(.table-workspace__text-font, .table-workspace__text-size)
  > .inspector-panel__field {
  width: 100%;
  margin: 0;
}

.table-workspace__text-size .inspector-panel__field-select-left {
  flex: 1 1 auto;
  gap: 0;
}

.table-workspace__text-size .inspector-graphic-preview { cursor: pointer; }

.table-workspace__cell-fill {
  width: var(--arhix-control-width-compact);
  flex: none;
}

.table-workspace__cell-fill > .inspector-panel__field {
  width: 100%;
  margin: 0;
  padding: var(--arhix-space-micro);
  justify-content: center;
}

.table-workspace__cell-fill .inspector-graphic-preview {
  display: grid;
  width: 100%;
  height: var(--arhix-preview-height);
  place-items: center;
  cursor: pointer;
}

.table-workspace__cell-fill-glyph {
  color: var(--arhix-ink);
  font-size: var(--arhix-font-size-body);
  line-height: 1;
}

.table-workspace__emphasis {
  display: flex;
  flex: none;
  gap: var(--arhix-space-micro);
}

.table-workspace__emphasis > .inspector-panel__visibility-button { margin: 0; }
.table-workspace__emphasis > .inspector-panel__visibility-button:nth-child(1) > span { font-weight: 600; }
.table-workspace__emphasis > .inspector-panel__visibility-button:nth-child(2) > span { font-style: italic; }
.table-workspace__emphasis > .inspector-panel__visibility-button:nth-child(3) > span {
  text-decoration: underline;
  text-underline-offset: var(--arhix-space-pill);
}

[data-ui-surface="shell"] .table-workspace__text-controls > .inspector-panel__scope {
  width: calc(3 * var(--arhix-control-width-compact) + 4 * var(--arhix-space-micro));
  height: var(--arhix-control-height);
  flex: none;
  gap: var(--arhix-space-micro);
  margin: 0;
}

[data-ui-surface="shell"] .table-workspace__text-controls
  > .inspector-panel__scope > button {
  width: var(--arhix-control-width-compact);
  height: var(--arhix-pill-height);
  flex: none;
}
