:root {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-header: #f8f9fb;
  --bg-row-alt: #f9fafb;
  --bg-row-hover: rgba(8, 85, 196, 0.1);
  --bg-row-active: rgba(8, 85, 196, 0.12);
  --bg-row-active-group: rgba(8, 85, 196, 0.14);
  --bg-selected: #eef1f5;
  --bg-totals: #eef1f5;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-header: #374151;
  --border: #e0e1e8;
  --border-strong: #c9c9d1;
  --border-group: #c9c9d1;
  --table-line-color: #d7d9e0;
  --group-bg-color: #f3f4f6;
  --accent: #0855c4;
  --accent-light: #0077ee;
  --accent-bg: #eef4ff;
  --accent-border: #c9c9d1;
  --chart-detail-bg: rgba(235, 237, 244, 0.38);
  --chart-grid: rgba(100, 116, 139, 0.2);
  --rag-negative: #d81159;
  --rag-warning: #fbb13c;
  --rag-positive: #008e89;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: 150ms ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  background: transparent;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#easytables-app {
  height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

#grid-shell {
  --table-font-size: 13px;
  --table-header-font-size: 12px;
  --table-cell-padding-y: 10px;
  --table-cell-padding-x: 14px;
  --table-cell-padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
  --table-header-padding: 6px 12px 5px;
  --table-ungrouped-header-padding-top: 35px;
  --table-group-header-height: 28px;
  --table-filter-margin-top: 3px;
  --table-filter-height: 22px;
  --table-filter-padding: 0 8px 0 22px;
  --table-filter-line-height: 18px;
  --table-filter-radius: 2px;
  --table-filter-bg-position: 7px center;
  --table-totals-padding-y: 6px;
  --table-totals-padding: var(--table-totals-padding-y) var(--table-cell-padding-x);
  --table-group-row-min-height: 40px;
  --table-group-stacked-row-min-height: 58px;
  --table-stacked-row-min-height: 66px;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--table-filter-radius);
  overflow: hidden;
  flex: 1;
  box-shadow: none;
}

#grid-container {
  flex: 1;
  min-height: 0;
  position: relative;
}

.active-filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-header);
  min-height: 42px;
  overflow-x: auto;
  flex-shrink: 0;
}

.active-filters-bar[hidden] {
  display: none;
}

.filter-label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  padding: 4px 7px 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  white-space: nowrap;
}

.filter-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-chip button,
.filter-clear {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.filter-chip button:hover,
.filter-clear:hover {
  color: var(--accent);
}

.filter-clear {
  flex-shrink: 0;
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-weight: 600;
}

.et-text-filter-values {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 2px;
}

.et-text-filter-values-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.et-text-filter-value-search {
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
}

.et-text-filter-value-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-bg);
}

.et-text-filter-value-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 92px;
  overflow: auto;
}

.et-text-filter-value-list button {
  appearance: none;
  max-width: 132px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.et-text-filter-value-list button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.et-text-filter-value-list button.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
  font-weight: 600;
}

#footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}

.selection-summary {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.selection-summary[hidden] {
  display: none;
}

.copy-status {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 180px;
  padding: 3px 8px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-status.copy-status-fail {
  border-color: var(--danger-soft);
  background: #fff5f7;
  color: var(--danger);
}

.copy-status[hidden] {
  display: none;
}

.selection-summary-item {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  min-width: 0;
}

.selection-summary-item.muted {
  color: var(--text-muted);
}

.selection-summary-label {
  color: inherit;
}

.selection-summary-value {
  color: var(--text-primary);
  font-weight: 600;
}

.search-input {
  width: 220px;
  height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--bg-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input:hover {
  border-color: var(--border-strong);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

@media (max-width: 520px) {
  #footer-bar {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .footer-left,
  .footer-right,
  .selection-summary {
    flex: 1 1 100%;
  }

  .footer-left {
    order: 1;
  }

  .footer-right {
    order: 2;
    justify-content: flex-end;
  }

  .selection-summary {
    order: 3;
  }

  .search-input {
    width: min(220px, 100%);
  }
}

#row-count {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.page-size-select {
  height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition);
}

.page-size-select:hover {
  border-color: var(--border-strong);
}

.page-size-select:focus {
  outline: none;
  border-color: var(--accent);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.action-btn.primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

.icon-only-action {
  width: 24px;
  min-width: 24px;
  padding: 0;
  gap: 0;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 16px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.tabulator {
  height: 100%;
  border: none;
  font-size: var(--table-font-size);
  background: var(--bg-surface);
}

.tabulator .tabulator-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--table-line-color);
}

#grid-shell.sticky-header .tabulator .tabulator-header {
  position: sticky;
  top: 0;
  z-index: 3;
}

.tabulator .tabulator-header .tabulator-col {
  background: var(--bg-header);
  border-right: 1px solid var(--table-line-color);
}

.tabulator .tabulator-header .tabulator-col:last-child {
  border-right: none;
}

#grid-shell .tabulator .tabulator-col-content {
  padding: var(--table-header-padding);
}

#grid-shell .tabulator .tabulator-col.et-ungrouped-column > .tabulator-col-content {
  padding-top: var(--table-ungrouped-header-padding-top);
}

.tabulator .tabulator-col.tabulator-col-group {
  background: var(--bg-header);
}

.tabulator .tabulator-col.tabulator-col-group > .tabulator-col-content {
  height: var(--table-group-header-height);
  min-height: var(--table-group-header-height);
  padding: 0 10px;
  border-bottom: 1px solid var(--table-line-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

#grid-shell .tabulator .tabulator-col.tabulator-col-group .tabulator-col-group-cols {
  border-top: 0;
}

.tabulator .tabulator-col.tabulator-col-group.et-group-color-0 > .tabulator-col-content { background: #eef2ff; }
.tabulator .tabulator-col.tabulator-col-group.et-group-color-1 > .tabulator-col-content { background: #e6f7f1; }
.tabulator .tabulator-col.tabulator-col-group.et-group-color-2 > .tabulator-col-content { background: #fdecef; }
.tabulator .tabulator-col.tabulator-col-group.et-group-color-3 > .tabulator-col-content { background: #fdf4e3; }
.tabulator .tabulator-col.tabulator-col-group.et-group-color-4 > .tabulator-col-content { background: #f1ecfd; }
.tabulator .tabulator-col.tabulator-col-group.et-group-color-5 > .tabulator-col-content { background: #e6f6fb; }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-noname > .tabulator-col-content {
  height: var(--table-group-header-height);
  min-height: var(--table-group-header-height);
  padding: 0;
  overflow: hidden;
}

.tabulator .tabulator-col.tabulator-col-group > .tabulator-col-content .tabulator-col-title {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.tabulator .tabulator-col.tabulator-col-group.et-empty-column-group > .tabulator-col-content .tabulator-col-title {
  color: transparent;
}

.tabulator .tabulator-col.tabulator-col-group.et-empty-column-group > .tabulator-col-content {
  border-bottom-color: var(--border-strong);
}

.tabulator .tabulator-col-title {
  font-weight: 600;
  color: var(--text-header);
  font-size: var(--table-header-font-size);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  min-width: 0;
}

.et-header-title-wrap {
  display: block;
  position: relative;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.et-header-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  display: block;
  transition: padding-right var(--transition);
}

.et-header-pin {
  appearance: none;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), color var(--transition), background var(--transition);
}

.tabulator .tabulator-col:hover .et-header-pin,
.tabulator .tabulator-col:focus-within .et-header-pin,
.et-header-pin:focus-visible,
.et-header-pin.pinned {
  opacity: 1;
  pointer-events: auto;
}

.tabulator .tabulator-col:hover .et-header-title-text,
.tabulator .tabulator-col:focus-within .et-header-title-text,
.et-header-title-wrap.pinned .et-header-title-text {
  padding-right: 24px;
}

.et-header-pin:hover,
.et-header-pin.pinned {
  color: var(--accent);
  background: var(--accent-bg);
}

.tabulator .tabulator-col .tabulator-col-sorter {
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition);
}

.tabulator .tabulator-col.tabulator-sortable:hover .tabulator-col-sorter,
.tabulator .tabulator-col.tabulator-sortable:focus-within .tabulator-col-sorter,
.tabulator .tabulator-col[aria-sort="ascending"] .tabulator-col-sorter,
.tabulator .tabulator-col[aria-sort="descending"] .tabulator-col-sorter {
  opacity: 1;
}

#grid-shell .tabulator .tabulator-header-filter {
  margin-top: var(--table-filter-margin-top);
}

.et-condition-filter,
.et-date-filter {
  position: relative;
  display: block;
}

.tabulator .tabulator-col input {
  width: 100%;
  height: var(--table-filter-height);
  padding: var(--table-filter-padding);
  border: 1px solid var(--border);
  border-radius: var(--table-filter-radius);
  font-size: 11px;
  line-height: var(--table-filter-line-height);
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: var(--table-filter-bg-position);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.tabulator-popup-container .tabulator-edit-list {
  font-size: 12px;
  line-height: 1.25;
}

.tabulator-popup-container .tabulator-edit-list .tabulator-edit-list-item {
  min-height: 22px;
  padding: 3px 8px;
}

.tabulator-popup-container .tabulator-edit-list .tabulator-edit-list-placeholder {
  min-height: 22px;
  padding: 3px 8px;
}

.tabulator .tabulator-col input::placeholder {
  color: var(--text-muted);
}

.tabulator .tabulator-col input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-bg);
}

.tabulator .tabulator-col input:focus,
.tabulator .tabulator-col input:not(:placeholder-shown) {
  background-image: none;
  padding-left: 10px;
}

.tabulator .tabulator-col .et-condition-filter-input,
.tabulator .tabulator-col .et-date-filter-input {
  padding: 0 24px 0 8px;
  background-image: none;
  background-position: initial;
  font-size: 11px;
}

.et-condition-filter-button,
.et-date-filter-button {
  position: absolute;
  top: 50%;
  right: 3px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 2px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%230855c4' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5h18l-7 8v5l-4 2v-7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transform: translateY(-50%);
  opacity: 0.75;
}

.et-condition-filter-button:hover,
.et-condition-filter-button:focus-visible,
.et-date-filter-button:hover,
.et-date-filter-button:focus-visible {
  background-color: var(--accent-bg);
  opacity: 1;
  outline: none;
}

.et-date-filter-panel {
  position: fixed;
  z-index: 10020;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  color: var(--text-primary);
}

.et-date-filter-condition {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 8px;
}

.et-date-filter-condition select,
.et-date-filter-condition input {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 28px;
}

.et-date-value-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  min-width: 0;
}

.et-date-filter-condition .et-date-native-picker {
  padding: 0 4px;
  color: transparent;
  cursor: pointer;
}

.et-date-native-picker::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.78;
}

.et-date-filter-condition select:focus,
.et-date-filter-condition input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-bg);
}

.et-date-filter-logic {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--text-primary);
  font-size: 13px;
}

.et-date-filter-logic label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.et-date-filter-logic input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.et-date-filter-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.et-date-filter-presets button {
  appearance: none;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.et-date-filter-presets button:hover,
.et-date-filter-presets button:focus-visible {
  outline: none;
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.et-date-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.et-date-filter-actions button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}

.et-date-filter-actions button:hover,
.et-date-filter-actions button:focus-visible {
  background: var(--accent-bg);
  outline: none;
}

.et-date-filter-actions button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.tabulator .tabulator-tableholder {
  background: var(--bg-surface);
}

.tabulator .tabulator-row {
  border-bottom: 1px solid var(--table-line-color);
  transition: background-color var(--transition);
}

.tabulator .tabulator-row.tabulator-row-even {
  background: var(--bg-row-alt);
}

.tabulator .tabulator-row:hover {
  background: var(--bg-row-hover);
}

#grid-shell .tabulator-row.et-row-active,
#grid-shell .tabulator-row.et-row-active.tabulator-row-even {
  background: var(--bg-row-active);
}

#grid-shell .tabulator-row.et-row-active .tabulator-cell:not(.et-cell-selected):not(.et-cell-focus) {
  background-color: var(--bg-row-active);
}

#grid-shell .tabulator-row:hover:not(.et-row-active) .tabulator-cell:not(.et-cell-selected):not(.et-cell-focus) {
  background-color: var(--bg-row-hover);
}

.tabulator .tabulator-row.tabulator-selected {
  background: var(--bg-selected);
}

.tabulator .tabulator-row.tabulator-group {
  color: var(--text-primary);
  background: #f8fafc;
  border-color: var(--border);
  padding: 0;
  box-shadow: inset 3px 0 0 rgba(8, 85, 196, 0.24);
}

.tabulator .tabulator-row.tabulator-group.tabulator-group-level-1 {
  background: #f4f7fc;
  box-shadow: inset 3px 0 0 rgba(8, 85, 196, 0.32);
}

.tabulator .tabulator-row.tabulator-group.tabulator-group-level-2 {
  background: #eef4fb;
  box-shadow: inset 3px 0 0 rgba(8, 85, 196, 0.4);
}

.tabulator .tabulator-row.tabulator-group .et-group-title,
.tabulator .tabulator-row.tabulator-group .et-group-value-cell {
  color: var(--text-primary);
  font-weight: 700;
}

.tabulator .tabulator-row.tabulator-group .et-group-count,
.tabulator .tabulator-row.tabulator-group .et-group-chevron {
  color: var(--text-muted);
}

.tabulator .tabulator-row.tabulator-group .et-group-field {
  color: #64748b;
}

.tabulator .tabulator-row.tabulator-group span {
  margin-left: 0;
  color: var(--text-primary);
}

.tabulator .tabulator-row:not(.tabulator-group) {
  --row-group-level: 0;
}

.tabulator .tabulator-row:not(.tabulator-group) .tabulator-cell:first-child {
  padding-left: calc(var(--table-cell-padding-x) + (var(--row-group-level) * 20px));
}

.tabulator .tabulator-row.et-row-in-group:not(.tabulator-group) .tabulator-cell:first-child {
  padding-left: calc(var(--table-cell-padding-x) + (var(--row-group-depth, 0) * 20px));
}

#grid-shell.sticky-group-headers .tabulator .tabulator-row.tabulator-group {
  position: sticky;
  top: var(--totals-top-height, 0px);
  z-index: 5;
  box-shadow: 0 1px 0 var(--table-line-color);
}

#grid-shell.sticky-group-headers .tabulator .tabulator-row.tabulator-group.tabulator-group-level-1 {
  top: calc(var(--totals-top-height, 0px) + 36px);
  z-index: 4;
}

#grid-shell.sticky-group-headers .tabulator .tabulator-row.tabulator-group.tabulator-group-level-2 {
  top: calc(var(--totals-top-height, 0px) + 72px);
  z-index: 3;
}

#grid-shell.sticky-group-headers .tabulator .tabulator-row.tabulator-group .et-group-label-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  background: inherit;
}

.tabulator .tabulator-row.tabulator-group .tabulator-group-toggle {
  display: none;
}

.et-sticky-group-overlay {
  position: absolute;
  z-index: 8;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 1px 0 var(--table-line-color);
}

.et-sticky-group-overlay[hidden] {
  display: none;
}

.et-sticky-group-overlay .et-group-header {
  background: #f8fafc;
}

.et-group-header {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: var(--table-group-row-min-height);
  background: inherit;
  cursor: pointer;
}

.et-group-header.et-group-header-has-stack-bars {
  min-height: var(--table-group-stacked-row-min-height);
}

.et-group-label-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 var(--table-cell-padding-x);
  overflow: hidden;
}

.et-group-tree {
  --group-level: 0;
  display: inline-flex;
  align-self: stretch;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 calc(22px + (var(--group-level) * 20px));
  width: calc(22px + (var(--group-level) * 20px));
  min-width: calc(22px + (var(--group-level) * 20px));
  color: var(--text-muted);
  overflow: visible;
}

.et-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color var(--transition), background-color var(--transition);
}

.tabulator .tabulator-row.tabulator-group:hover .et-group-chevron {
  color: var(--accent);
  background: var(--accent-bg);
}

.et-group-chevron svg {
  transform: rotate(0deg);
  transition: transform var(--transition);
}

.tabulator-row.tabulator-group.tabulator-group-visible .et-group-chevron svg {
  transform: rotate(90deg);
}

.et-group-text {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.et-group-field {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  max-width: min(150px, 44%);
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  flex: 0 0 auto;
}

.et-group-title {
  font-size: 13px;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.et-group-count {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
  flex: 0 0 auto;
}

.et-group-value-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  box-sizing: border-box;
  padding: 0 var(--table-cell-padding-x);
  border-right: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}

.et-group-value-cell-has-stacked-bar {
  align-items: center;
}

.et-group-value-cell:last-child {
  border-right: none;
}

.tabulator .tabulator-cell {
  padding: var(--table-cell-padding);
  border-right: 1px solid var(--table-line-color);
  line-height: 1.25;
}

.tabulator .tabulator-row.et-row-has-stack-bars:not(.tabulator-group) {
  min-height: var(--table-stacked-row-min-height);
}

.tabulator .tabulator-row.et-row-has-stack-bars:not(.tabulator-group) .tabulator-cell {
  min-height: var(--table-stacked-row-min-height);
}

.tabulator .tabulator-cell:last-child {
  border-right: none;
}

.tabulator .tabulator-cell.et-expansion-scope-cell {
  cursor: pointer;
}

#grid-shell.no-column-lines .tabulator .tabulator-cell,
#grid-shell.no-column-lines .tabulator .tabulator-header .tabulator-col {
  border-right: none;
}

#grid-shell.hide-column-filters .tabulator .tabulator-header-filter {
  display: none;
}

#grid-shell.hide-group-count .et-group-count {
  display: none;
}

#grid-shell .tabulator .tabulator-row:hover .tabulator-cell.et-group-has-bg {
  background-color: var(--bg-row-hover);
}

#grid-shell .tabulator .tabulator-row.et-row-active .tabulator-cell.et-group-has-bg {
  background-color: var(--bg-row-active);
}

#grid-shell .tabulator .tabulator-row.tabulator-selected .tabulator-cell.et-group-has-bg {
  background-color: var(--bg-selected);
}

#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-boundaries.et-group-start,
#grid-shell .tabulator .tabulator-row .tabulator-cell.et-group-has-boundaries.et-group-start,
#grid-shell .totals-cell.et-group-has-boundaries.et-group-start {
  position: relative;
}

#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-boundaries.et-group-end,
#grid-shell .tabulator .tabulator-row .tabulator-cell.et-group-has-boundaries.et-group-end,
#grid-shell .totals-cell.et-group-has-boundaries.et-group-end {
  position: relative;
}

#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-boundaries.et-group-start::before,
#grid-shell .tabulator .tabulator-row .tabulator-cell.et-group-has-boundaries.et-group-start::before,
#grid-shell .totals-cell.et-group-has-boundaries.et-group-start::before,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-boundaries.et-group-end::after,
#grid-shell .tabulator .tabulator-row .tabulator-cell.et-group-has-boundaries.et-group-end::after,
#grid-shell .totals-cell.et-group-has-boundaries.et-group-end::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-group);
  pointer-events: none;
  z-index: 4;
}

#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-boundaries.et-group-start::before,
#grid-shell .tabulator .tabulator-row .tabulator-cell.et-group-has-boundaries.et-group-start::before,
#grid-shell .totals-cell.et-group-has-boundaries.et-group-start::before {
  left: 0;
}

#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-boundaries.et-group-end::after,
#grid-shell .tabulator .tabulator-row .tabulator-cell.et-group-has-boundaries.et-group-end::after,
#grid-shell .totals-cell.et-group-has-boundaries.et-group-end::after {
  right: 0;
}

#grid-shell .tabulator .tabulator-header .tabulator-col.tabulator-col-group.et-group-has-boundaries.et-group-edge-end::after {
  right: -1px;
}

#grid-shell .tabulator .tabulator-header .tabulator-col.tabulator-col-group.et-group-has-boundaries.et-group-edge-end {
  overflow: visible;
  z-index: 6;
}

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-no-header-rule > .tabulator-col-content {
  border-bottom-color: transparent;
}

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-0 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-0,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-0,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-0 { background-color: var(--column-group-bg-0, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-0 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-0, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-1 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-1,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-1,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-1 { background-color: var(--column-group-bg-1, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-1 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-1, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-2 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-2,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-2,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-2 { background-color: var(--column-group-bg-2, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-2 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-2, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-3 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-3,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-3,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-3 { background-color: var(--column-group-bg-3, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-3 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-3, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-4 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-4,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-4,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-4 { background-color: var(--column-group-bg-4, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-4 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-4, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-5 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-5,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-5,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-5 { background-color: var(--column-group-bg-5, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-5 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-5, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-6 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-6,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-6,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-6 { background-color: var(--column-group-bg-6, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-6 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-6, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-7 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-7,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-7,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-7 { background-color: var(--column-group-bg-7, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-7 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-7, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-8 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-8,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-8,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-8 { background-color: var(--column-group-bg-8, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-8 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-8, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-9 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-9,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-9,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-9 { background-color: var(--column-group-bg-9, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-9 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-9, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-10 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-10,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-10,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-10 { background-color: var(--column-group-bg-10, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-10 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-10, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-style-11 > .tabulator-col-content,
#grid-shell .tabulator .tabulator-header .tabulator-col.et-group-has-bg.et-group-style-11,
#grid-shell .tabulator .tabulator-row:not(.et-row-formatted) .tabulator-cell.et-group-has-bg.et-group-style-11,
#grid-shell .totals-cell.et-group-has-bg.et-group-style-11 { background-color: var(--column-group-bg-11, var(--group-bg-color)); }
#grid-shell .tabulator .tabulator-col.tabulator-col-group.et-group-has-bg.et-group-edge-end.et-group-style-11 { overflow: visible; box-shadow: 1px 0 0 var(--column-group-bg-11, var(--group-bg-color)); }

#grid-shell .tabulator .tabulator-row:hover:not(.et-row-formatted) .tabulator-cell.et-group-has-bg,
#grid-shell .tabulator .tabulator-row:hover:not(.et-row-formatted) .tabulator-cell.et-group-member {
  background-color: var(--bg-row-hover);
}

#grid-shell .tabulator .tabulator-row.et-row-active:not(.et-row-formatted) .tabulator-cell.et-group-has-bg,
#grid-shell .tabulator .tabulator-row.et-row-active:not(.et-row-formatted) .tabulator-cell.et-group-member {
  background-color: var(--bg-row-active-group);
}

#grid-shell.density-compact {
  --table-cell-padding-y: 7px;
  --table-cell-padding-x: 10px;
  --table-header-padding: 4px 11px;
  --table-ungrouped-header-padding-top: 33px;
  --table-filter-height: 20px;
  --table-filter-line-height: 18px;
  --table-filter-padding: 0 8px 0 21px;
  --table-totals-padding-y: 4px;
  --table-group-row-min-height: 36px;
  --table-group-stacked-row-min-height: 52px;
  --table-stacked-row-min-height: 58px;
}

#grid-shell.density-dense {
  --table-cell-padding-y: 4px;
  --table-cell-padding-x: 8px;
  --table-header-padding: 3px 9px;
  --table-ungrouped-header-padding-top: 27px;
  --table-group-header-height: 24px;
  --table-filter-margin-top: 2px;
  --table-filter-height: 18px;
  --table-filter-line-height: 16px;
  --table-filter-padding: 0 7px 0 19px;
  --table-filter-bg-position: 6px center;
  --table-totals-padding-y: 3px;
  --table-group-row-min-height: 32px;
  --table-group-stacked-row-min-height: 48px;
  --table-stacked-row-min-height: 50px;
}

#grid-shell.font-small {
  --table-font-size: 12px;
  --table-header-font-size: 11px;
}

#grid-shell.font-large {
  --table-font-size: 14px;
  --table-header-font-size: 13px;
}

.tabulator .tabulator-footer {
  display: none;
}

.tabulator .tabulator-calcs-holder {
  background: var(--bg-totals);
  border-top: 2px solid var(--border-strong);
}

.tabulator .tabulator-calcs-holder .tabulator-row {
  background: var(--bg-totals);
  border-bottom: none;
}

.tabulator .tabulator-calcs-holder .tabulator-cell {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-totals);
}

#grid-shell.totals-top .tabulator .tabulator-calcs-holder {
  border-top: none;
  border-bottom: 2px solid var(--border-strong);
}

#table-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.stream-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.stream-progress.visible {
  opacity: 1;
}

.stream-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(79, 143, 255, 0.65);
  transition: width 0.3s ease;
}

.stream-progress-label {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  background: var(--bg-elevated, rgba(20, 20, 28, 0.92));
  border: 1px solid var(--border);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}

#totals-row {
  display: none;
  background: var(--bg-totals);
  border-top: 2px solid var(--border-strong);
  font-weight: 500;
  font-size: var(--table-font-size);
  overflow: hidden;
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 2;
}

#totals-row.visible {
  display: flex;
}

#totals-row.totals-top {
  top: 0;
  border-top: none;
  border-bottom: 2px solid var(--border-strong);
}

.totals-cell {
  padding: var(--table-totals-padding);
  border-right: 1px solid var(--table-line-color);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
  will-change: transform;
}

.totals-cell-frozen {
  position: relative;
  z-index: 3;
  background: var(--bg-totals);
}

.totals-cell:last-child {
  border-right: none;
}

#grid-shell.no-column-lines .totals-cell {
  border-right: none;
}

#totals-row.totals-bottom {
  bottom: 0;
}

.totals-inner {
  display: flex;
  will-change: transform;
}

#grid-shell.no-zebra .tabulator .tabulator-row.tabulator-row-even {
  background: var(--bg-surface);
}

#pagination-container {
  display: flex;
  align-items: center;
  gap: 3px;
}

#pagination-container button {
  width: 28px;
  min-width: 28px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 12px;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0;
  transition: all var(--transition);
}

#pagination-container button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

#pagination-container button.active,
#pagination-container button[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

#pagination-container button[data-page="first"],
#pagination-container button[data-page="last"] {
  display: inline-flex;
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 396px;
  height: 100%;
  max-height: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
}

.drawer.hidden {
  display: none;
}

body.author-mode .drawer {
  width: min(720px, 46vw);
  min-width: 396px;
  max-width: calc(100vw - 24px);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-header);
}

.drawer-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.drawer-content {
  flex: 1;
  min-height: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.drawer-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-header);
}

.settings-save-status {
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-tabs {
  display: flex;
  gap: 2px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-header);
  flex-shrink: 0;
  overflow-x: auto;
}

.drawer-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.drawer-tab:hover {
  color: var(--text-primary);
}

.drawer-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

body.viewer-mode .drawer-tabs,
body.viewer-mode .drawer-tab,
body.viewer-mode .tab-panel:not([data-panel="columns"]),
body.viewer-mode #reset-widths,
body.viewer-mode .columns-workspace-tabs,
body.viewer-mode .drawer-tab[data-tab="groups"],
body.viewer-mode .drawer-tab[data-tab="interactions"],
body.viewer-mode .drawer-tab[data-tab="calculations"],
body.viewer-mode #settings-reset {
  display: none;
}

body.viewer-mode .tab-panel[data-panel="columns"] {
  display: flex;
}

body.viewer-mode .drawer-footer {
  justify-content: space-between;
}

body.viewer-mode .drawer-footer #settings-reset {
  margin-left: auto;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.tab-panel.active {
  display: flex;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.settings-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.settings-hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.columns-toolbar {
  position: sticky;
  top: 0;
  padding: 0 0 6px;
  background: var(--bg-surface);
  z-index: 1;
  display: flex;
  gap: 8px;
}

.settings-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-surface);
  color: var(--text-primary);
}

.columns-toolbar .settings-search {
  min-width: 0;
}

.columns-toolbar .action-btn {
  flex-shrink: 0;
}

.columns-workspace-tabs {
  position: sticky;
  top: 40px;
  z-index: 1;
  display: flex;
  gap: 0;
  padding: 0 0 6px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.columns-workspace-tab {
  appearance: none;
  flex: 0 0 auto;
  min-width: 68px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.columns-workspace-tab:hover {
  color: var(--text-primary);
  background: var(--bg-header);
}

.columns-workspace-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

.columns-workspace-empty,
.workspace-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workspace-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.settings-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.columns-detail {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.col-group-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(234, 239, 255, 0.28);
}

.col-group-card-label,
.col-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 1px 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.col-group-card-label::after,
.col-group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.col-group-config {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 4px 2px 5px;
}

.col-group-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.col-group-config-head > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-group-config-head > span:last-child {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.col-group-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
}

.col-group-config-grid .col-field {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.col-group-config .theme-color-control {
  width: 100%;
  justify-content: flex-end;
}

.column-group-manager {
  gap: 8px;
}

.column-group-manager-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.column-group-manager-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-header);
}

.column-group-manager-head,
.column-group-manager-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.column-group-manager-head {
  justify-content: space-between;
}

.column-group-manager-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--text-primary);
}

.column-group-manager-count {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11px;
}

.column-group-manager-actions {
  flex-wrap: wrap;
}

.column-group-member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.column-group-member-chip {
  min-width: 0;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-btn.compact {
  height: 24px;
  padding: 2px 8px;
  font-size: 11px;
}

.column-group-create {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 2px;
}

.column-group-field-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  max-height: 156px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.column-group-field-option {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 11px;
}

.column-group-field-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.columns-empty {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  padding: 24px 0;
}

.columns-advanced-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.advanced-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
}

.advanced-section-summary {
  display: grid;
  grid-template-columns: 14px minmax(0, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  min-height: 38px;
  padding: 9px 11px;
  cursor: pointer;
  list-style: none;
  color: var(--text-primary);
}

.advanced-section-summary::-webkit-details-marker {
  display: none;
}

.advanced-section-summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.8px solid var(--text-muted);
  border-bottom: 1.8px solid var(--text-muted);
  transform: rotate(-45deg);
  justify-self: center;
  align-self: center;
  grid-column: 1;
  grid-row: 1;
  transition: transform 120ms ease;
}

.advanced-section[open] .advanced-section-summary::before {
  transform: rotate(45deg);
}

.advanced-section-title {
  grid-column: 2;
  font-size: 13px;
  font-weight: 750;
}

.advanced-section-meta {
  grid-column: 3;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advanced-section-body {
  padding: 0 10px 10px;
}

.advanced-section-body > .settings-card {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 10px 0 0;
  box-shadow: none;
  background: transparent;
}

.advanced-section-body > .settings-card > .settings-card-title {
  display: none;
}

.viewer-section-title {
  padding: 3px 2px 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.viewer-group-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.viewer-group-dropzone {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 38px;
  padding: 7px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  transition: border-color var(--transition), background var(--transition);
}

.viewer-group-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.viewer-group-empty {
  align-self: center;
  color: var(--text-muted);
  font-size: 12px;
}

.viewer-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 5px 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
}

.viewer-group-chip span {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-group-chip button,
.viewer-group-toggle {
  appearance: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.viewer-group-chip button:hover:not(:disabled),
.viewer-group-toggle:hover,
.viewer-group-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.viewer-group-chip button:disabled {
  opacity: 0.35;
  cursor: default;
}

.viewer-group-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 2px 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.viewer-group-option .toggle-switch {
  flex: 0 0 auto;
  transform: scale(0.84);
  transform-origin: right center;
}

.viewer-column-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  transition: border-color var(--transition), background var(--transition);
}

.viewer-column-row.no-group-controls {
  grid-template-columns: minmax(0, 1fr);
}

.viewer-column-row:hover,
.viewer-column-row.grouped {
  border-color: var(--border-strong);
}

.viewer-column-row.grouped {
  background: var(--accent-bg);
}

.viewer-column-row.dragging {
  opacity: 0.55;
}

.viewer-drag-handle {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.viewer-column-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-primary);
  font-size: 13px;
}

.viewer-column-label input {
  flex-shrink: 0;
  accent-color: var(--accent);
}

.viewer-column-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expansion-settings-card {
  gap: 9px;
}

.expansion-hint {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.expansion-hint-warn {
  background: rgba(251, 177, 60, 0.14);
  color: #8a5a00;
}

.expansion-groups-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expansion-group-editor {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
}

.expansion-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px 28px;
  gap: 8px;
  align-items: center;
}

.expansion-group-head .col-control {
  min-width: 0;
  max-width: none;
  width: 100%;
}

.expansion-metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
  max-height: 150px;
  overflow-y: auto;
}

.expansion-metric-option {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-primary);
  font-size: 12px;
}

.expansion-metric-option input {
  flex-shrink: 0;
  accent-color: var(--accent);
}

.expansion-metric-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-tooltip-settings-card {
  gap: 8px;
}

.tooltip-field-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
  max-height: 132px;
  overflow-y: auto;
}

.tooltip-field-option {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-primary);
  font-size: 12px;
}

.tooltip-field-option input {
  flex-shrink: 0;
  accent-color: var(--accent);
}

.tooltip-field-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip-note-input {
  min-height: 54px;
  resize: vertical;
}

.tooltip-field-hidden-tag {
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--bg-row-alt);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
}

.et-expandable-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

.et-row-expand-btn {
  appearance: none;
  width: 16px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
}

.et-row-expand-btn:hover,
.et-row-expand-btn:focus-visible {
  color: var(--accent);
  outline: none;
}

.et-row-expanded .et-row-expand-btn {
  color: var(--accent);
}

.et-row-expanded .et-row-expand-btn svg {
  transform: rotate(90deg);
}

.et-expandable-cell-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.et-row-expanded {
  box-shadow: inset 3px 0 0 var(--accent);
}

.et-row-expansion {
  width: 100%;
  max-width: none;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--chart-detail-bg);
}

.et-expansion-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.et-expansion-tabs button {
  appearance: none;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.et-expansion-tabs button:hover,
.et-expansion-tabs button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.et-expansion-chart {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  position: relative;
  width: 100%;
  gap: 10px;
}

.et-chart-bar {
  transition: opacity var(--transition), filter var(--transition);
}

.et-chart-reference-line {
  stroke-width: 1;
  stroke-dasharray: 5 5;
  opacity: 0.42;
  pointer-events: none;
}

.et-chart-band-rule {
  opacity: 0.65;
}

.et-chart-band-label {
  font-size: 10px;
  font-weight: 600;
}

.et-expansion-chart-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.et-expansion-scope {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.et-expansion-scope-label {
  color: var(--text-muted);
  font-weight: 500;
  line-height: 24px;
  white-space: nowrap;
}

.et-expansion-scope strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-weight: 600;
}

.et-expansion-scope-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.et-expansion-scope-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  height: 24px;
  padding: 0 8px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-muted);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), color var(--transition), opacity var(--transition);
}

.et-expansion-scope-chip:hover {
  border-color: rgba(8, 85, 196, 0.28);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-secondary);
}

.et-expansion-scope-chip.active {
  border-color: rgba(8, 85, 196, 0.30);
  background: rgba(8, 85, 196, 0.08);
  color: var(--accent);
}

.et-expansion-scope-chip.primary {
  border-color: rgba(8, 85, 196, 0.48);
  font-weight: 600;
}

.et-expansion-scope-chip.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.et-scope-chip-label,
.et-scope-chip-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.et-scope-chip-label {
  color: var(--text-muted);
}

.et-scope-chip-value {
  color: inherit;
}

.et-expansion-legend {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.et-expansion-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: opacity var(--transition);
}

.et-expansion-legend-item:hover {
  opacity: 0.8;
}

.et-expansion-legend-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.et-expansion-legend-item.et-legend-hidden {
  color: var(--text-muted);
}

.et-expansion-legend-item .et-legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 2px solid transparent;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.et-expansion-chart svg {
  display: block;
  width: 100%;
  height: 260px;
  overflow: visible;
}

.et-chart-grid {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.et-chart-axis-label {
  fill: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
}

.et-chart-series-path,
.et-chart-point {
  transition: none;
}

.et-chart-crosshair {
  stroke: rgba(100, 116, 139, 0.48);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0;
  pointer-events: none;
}

.et-chart-crosshair.visible {
  opacity: 1;
}

.et-chart-tooltip-locked .et-chart-crosshair.visible {
  stroke-width: 1.4;
  opacity: 0.95;
}

.et-chart-hover-capture {
  fill: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.et-chart-point {
  cursor: pointer;
  outline: none;
}

.et-chart-hovering .et-chart-series-path.inactive,
.et-chart-hovering .et-chart-point.inactive {
  opacity: 0.14;
}

.et-chart-hovering .et-chart-series-path.active,
.et-chart-hovering .et-chart-point.active {
  opacity: 1;
}

.et-chart-point.hovered {
  filter: drop-shadow(0 0 4px rgba(8, 85, 196, 0.28));
}

.et-expansion-tooltip {
  position: absolute;
  z-index: 8;
  min-width: 200px;
  max-width: min(360px, calc(100% - 16px));
  max-height: calc(100% - 16px);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  overflow: auto;
  opacity: 0;
  pointer-events: none;
}

.et-expansion-tooltip.visible {
  opacity: 1;
}

.et-expansion-tooltip-title {
  grid-column: 1 / -1;
  color: var(--text-primary);
  font-weight: 600;
}

.et-tooltip-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  align-items: baseline;
}

.et-tooltip-label {
  color: var(--text-secondary);
  white-space: nowrap;
}

.et-tooltip-value {
  min-width: 0;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
}

.et-tooltip-note {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: normal;
}

.et-expansion-tooltip-value {
  margin-top: 2px;
  color: var(--accent);
  font-weight: 700;
}

.et-row-tooltip {
  position: fixed;
  z-index: 9999;
  min-width: 220px;
  max-width: 360px;
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
}

.et-row-tooltip.visible {
  opacity: 1;
}

#grid-container .tabulator-cell {
  user-select: none;
}

#grid-container .tabulator-header-filter input,
#grid-container .tabulator-header-filter select {
  user-select: text;
}

#grid-container .tabulator-cell.et-cell-selected {
  background: rgba(8, 85, 196, 0.12) !important;
  box-shadow: inset 0 0 0 1px rgba(8, 85, 196, 0.34);
}

#grid-container .tabulator-cell.et-cell-focus {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  box-shadow: inset 0 0 0 1px rgba(8, 85, 196, 0.46);
}

.et-cell-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.et-cell-link:hover,
.et-cell-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  outline: none;
}

.et-expansion-empty {
  padding: 16px 0;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

.col-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.col-item:hover {
  border-color: var(--border-strong);
}

.col-item.expanded {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  cursor: pointer;
  user-select: none;
}

.col-expand {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition), color var(--transition);
}

.col-item.expanded .col-expand {
  transform: rotate(90deg);
  color: var(--accent);
}

.col-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  flex-shrink: 0;
}

.col-badges {
  flex: 1;
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-detail {
  display: none;
  flex-direction: column;
  gap: 7px;
  padding: 8px 9px;
  border-top: 1px solid var(--border);
  background: var(--bg-app);
}

.col-item.expanded .col-detail {
  display: flex;
}

.column-inspector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.column-inspector-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.column-inspector-tab {
  appearance: none;
  flex: 0 0 auto;
  height: 30px;
  min-width: 64px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-inspector-tab:hover {
  color: var(--text-primary);
  background: var(--bg-header);
}

.column-inspector-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

.column-inspector-body {
  display: flex;
  flex-direction: column;
}

.column-inspector-panel {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.column-inspector-panel[hidden] {
  display: none;
}

.col-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.col-field-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.col-field-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.col-control {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-surface);
  color: var(--text-primary);
  min-width: 160px;
  max-width: 210px;
}

.col-field-stacked .col-control {
  width: 100%;
  max-width: none;
}

.col-control-stack {
  display: grid;
  gap: 5px;
  width: 100%;
}

.col-subsection {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.68);
}

.col-subsection-title {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.col-subsection-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.settings-hint.compact {
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
}

.col-control:focus {
  outline: none;
  border-color: var(--accent);
}

.cf-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cf-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cf-template {
  appearance: none;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.cf-template:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.cf-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cf-rule {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.cf-rule-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cf-mode {
  flex: 1;
}

.cf-remove {
  appearance: none;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.cf-remove:hover {
  border-color: var(--rag-negative);
  color: var(--rag-negative);
  background: #fce8f0;
}

.cf-rule-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cf-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.cf-rule .col-control {
  min-width: 0;
  max-width: none;
}

.cf-line > select.col-control,
.cf-line > input.col-control {
  flex: 1;
}

.cf-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}

.cf-group-label {
  white-space: nowrap;
}

.cf-color-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cf-color-toggle {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
  cursor: pointer;
}

.cf-group input[type="color"] {
  width: 30px;
  height: 26px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  cursor: pointer;
}

.theme-color-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.theme-color-control input[type="color"] {
  width: 30px;
  height: 26px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  cursor: pointer;
}

.cf-hex-input {
  width: 76px;
  height: 26px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.cf-hex-input:focus {
  outline: none;
  border-color: var(--accent);
}

.cf-hex-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cf-opacity-control {
  display: inline-flex;
  align-items: center;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  overflow: hidden;
}

.cf-opacity-input {
  width: 44px;
  height: 24px;
  padding: 3px 2px 3px 6px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  text-align: right;
}

.cf-opacity-input:focus {
  outline: none;
}

.cf-opacity-input::-webkit-outer-spin-button,
.cf-opacity-input::-webkit-inner-spin-button {
  margin: 0;
}

.cf-opacity-suffix {
  padding: 0 6px 0 2px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
}

.cf-opacity-control:focus-within {
  border-color: var(--accent);
}

.cf-opacity-input:disabled,
.cf-opacity-input:disabled + .cf-opacity-suffix {
  opacity: 0.35;
  cursor: not-allowed;
}

.tag-color-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cf-group input[type="color"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cf-group select {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--bg-surface);
  color: var(--text-primary);
}

.calc-fields-card {
  gap: 8px;
}

.calc-note,
.calc-ref {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.calc-field-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.calc-formula {
  width: 100%;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.calc-status {
  font-size: 11px;
  min-height: 14px;
  color: var(--text-secondary);
}

.calc-status-ok {
  color: var(--rag-positive);
}

.calc-status-error {
  color: var(--rag-negative);
}

.calc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.calc-chip {
  appearance: none;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
}

.calc-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.cf-remove {
  appearance: none;
  align-self: flex-start;
  padding: 3px 8px;
  border: none;
  background: transparent;
  color: var(--rag-negative);
  font-size: 11px;
  cursor: pointer;
}

.cf-remove:hover {
  text-decoration: underline;
}

.cf-add {
  appearance: none;
  align-self: flex-start;
  padding: 6px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.cf-add:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.cf-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

.segmented {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-app);
}

.col-field > .segmented {
  flex: 0 0 auto;
}

.segmented button {
  appearance: none;
  position: relative;
  border: none;
  background: transparent;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.segmented button + button {
  border-left: 1px solid var(--border);
}

.segmented button:hover {
  color: var(--text-primary);
}

.segmented button.active {
  background: var(--accent);
  color: #ffffff;
}

.segmented button.segmented-visual-btn {
  min-width: 42px;
  padding: 6px 12px;
}

.segmented button.segmented-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 6px 12px;
}

.segmented button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  z-index: 80;
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--table-filter-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-2px);
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}

.segmented button[data-tooltip]:hover::after,
.segmented button[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.segmented-icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.segmented-visual {
  display: block;
  width: 24px;
  border-radius: 999px;
  background: currentColor;
}

.segmented-visual-bar-thin {
  height: 3px;
}

.segmented-visual-bar-hairline {
  height: 1.5px;
}

.segmented-visual-bar-normal {
  height: 6px;
}

.segmented-visual-bar-thick {
  height: 10px;
}

.segmented-visual-chart-line {
  width: 30px;
  height: 18px;
  border-radius: 0;
  background:
    radial-gradient(circle at 14% 70%, currentColor 0 2px, transparent 2.5px),
    radial-gradient(circle at 50% 34%, currentColor 0 2px, transparent 2.5px),
    radial-gradient(circle at 86% 58%, currentColor 0 2px, transparent 2.5px),
    linear-gradient(145deg, transparent 0 22%, currentColor 23% 28%, transparent 29% 52%, currentColor 53% 58%, transparent 59%);
}

.segmented-visual-chart-bar {
  width: 28px;
  height: 18px;
  border-radius: 0;
  background:
    linear-gradient(to top, currentColor 0 45%, transparent 45%) 2px 0 / 6px 100% no-repeat,
    linear-gradient(to top, currentColor 0 72%, transparent 72%) 11px 0 / 6px 100% no-repeat,
    linear-gradient(to top, currentColor 0 58%, transparent 58%) 20px 0 / 6px 100% no-repeat;
}

.segmented-visual-chart-small-multiples {
  width: 28px;
  height: 18px;
  border-radius: 0;
  background:
    linear-gradient(currentColor 0 0) 1px 2px / 11px 5px no-repeat,
    linear-gradient(currentColor 0 0) 16px 2px / 11px 5px no-repeat,
    linear-gradient(currentColor 0 0) 1px 11px / 11px 5px no-repeat,
    linear-gradient(currentColor 0 0) 16px 11px / 11px 5px no-repeat;
  opacity: 0.9;
}

.segmented-visual-reference-none {
  width: 28px;
  height: 18px;
  border-radius: 0;
  background: linear-gradient(currentColor 0 0) 4px 8px / 20px 2px no-repeat;
  opacity: 0.35;
}

.segmented-visual-reference-avg {
  width: 28px;
  height: 18px;
  border-radius: 0;
  background:
    linear-gradient(currentColor 0 0) 3px 8px / 22px 2px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 3px, currentColor 3px 5px, transparent 5px 8px);
}

.segmented-visual-height-compact,
.segmented-visual-height-normal,
.segmented-visual-height-tall {
  width: 28px;
  border-radius: var(--table-filter-radius);
  background: currentColor;
}

.segmented-visual-height-compact {
  height: 5px;
}

.segmented-visual-height-normal {
  height: 9px;
}

.segmented-visual-height-tall {
  height: 13px;
}

.col-move {
  display: inline-flex;
  gap: 6px;
}

.col-move button {
  appearance: none;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.col-move button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.col-move button:disabled {
  opacity: 0.4;
  cursor: default;
}

.drawer-tab:focus-visible,
.columns-workspace-tab:focus-visible,
.col-head:focus-visible,
.segmented button:focus-visible,
.action-btn:focus-visible,
.icon-btn:focus-visible,
.cf-add:focus-visible,
.cf-template:focus-visible,
.cf-remove:focus-visible,
.col-move button:focus-visible,
.advanced-section-summary:focus-visible,
.et-expansion-tabs button:focus-visible,
.viewer-group-chip button:focus-visible,
.viewer-group-toggle:focus-visible,
.page-size-select:focus-visible,
.filter-chip button:focus-visible,
.filter-clear:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.toggle-switch input:focus-visible + .toggle-slider,
.cf-hex-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.et-tag {
  display: inline-block;
  max-width: 100%;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-weight: 500;
  font-size: 0.92em;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.et-databar {
  --et-databar-height: 8px;
  --et-databar-label-width: clamp(58px, 36%, 92px);
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.et-databar-thickness-hairline {
  --et-databar-height: 5px;
}

.et-databar-thickness-normal {
  --et-databar-height: 11px;
}

.et-databar-thickness-thick {
  --et-databar-height: 14px;
}

.et-databar-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 24px;
  width: 100%;
  height: var(--et-databar-height);
  background: var(--border-strong);
  border-radius: var(--table-filter-radius);
  overflow: visible;
}

.et-databar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 1px;
  border-radius: var(--table-filter-radius);
}

.et-databar-fill-positive.et-databar-fill-has-zero {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.et-databar-fill-negative.et-databar-fill-has-zero {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.et-databar-zero {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: var(--text-secondary);
  transform: translateX(-0.5px);
  pointer-events: none;
  z-index: 2;
}

.et-databar-label {
  flex: 0 0 auto;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-primary);
}

.et-databar-label-outside {
  display: grid;
  grid-template-columns: minmax(42px, 1fr) var(--et-databar-label-width);
  column-gap: 8px;
}

.et-databar-layout-stacked.et-databar-label-outside {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(1.25em, auto) auto;
  align-items: center;
  justify-content: stretch;
  gap: 2px;
  min-height: calc(var(--et-databar-height) + 1.25em + 2px);
}

.et-databar-layout-stacked.et-databar-label-outside .et-databar-label {
  width: 100%;
  line-height: 1.15;
  text-align: right;
}

.et-databar-label-outside .et-databar-label {
  width: var(--et-databar-label-width);
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
}

.et-databar-label-inside .et-databar-track {
  height: max(var(--et-databar-height), 18px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.et-databar-label-inside .et-databar-label {
  position: relative;
  z-index: 1;
  padding: 0 6px;
  font-size: 11px;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.9), 0 0 3px rgba(255, 255, 255, 0.7);
}

.et-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}

.et-stack-main {
  font-weight: 600;
}

.et-stack-sub {
  display: flex;
  gap: 4px;
  align-items: baseline;
  font-size: 0.82em;
}

.et-stack-label {
  color: var(--text-muted);
  font-weight: 500;
}

.et-stack-value {
  color: var(--text-secondary);
}

.et-stack-bars {
  width: 100%;
  gap: 6px;
  min-width: 0;
  text-align: left;
}

.et-stack-bar-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  min-width: 0;
}

.et-stack-bar-label {
  grid-column: 1 / 2;
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.78em;
  font-weight: 500;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.et-stack-bar-line .et-databar {
  grid-column: 1 / -1;
  grid-row: 2;
  gap: 0;
  align-self: center;
}

.et-stack-bar-line .et-databar-track {
  min-width: 44px;
}

.et-stack-bar-value {
  grid-column: 2 / 3;
  justify-self: end;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.82em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf-stack-picker {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 150px;
  overflow-y: auto;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.stack-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-primary);
  padding: 2px 0;
  cursor: pointer;
}

.stack-option input {
  flex-shrink: 0;
}

.stack-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-input,
.settings-json {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  padding: 7px 8px;
  box-sizing: border-box;
}

.settings-json {
  min-height: 96px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.settings-json.invalid {
  border-color: var(--rag-negative);
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.diagnostics-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.diagnostic-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  align-items: start;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.diagnostic-row:last-child {
  border-bottom: none;
}

.diagnostic-key {
  color: var(--text-secondary);
}

.diagnostic-value {
  color: var(--text-primary);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.diagnostics-section {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.diagnostics-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.diagnostic-check {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
}

.diagnostic-check-marker {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.diagnostic-check-ok .diagnostic-check-marker {
  background: #008e89;
}

.diagnostic-check-warn .diagnostic-check-marker {
  background: #fbb13c;
}

.diagnostic-check-fail .diagnostic-check-marker {
  background: #d81159;
}

.diagnostic-check-label {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.diagnostic-check-detail {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.diagnostic-ref-list {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.diagnostic-actions {
  display: flex;
  justify-content: flex-start;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-primary);
  padding: 2px 0;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-strong);
  border-radius: 22px;
  transition: background-color var(--transition);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.toggle-switch input:disabled + .toggle-slider {
  cursor: not-allowed;
  opacity: 0.45;
}

.select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-primary);
  padding: 2px 0;
}

.select-row select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 100px;
}

.select-row select:focus {
  outline: none;
  border-color: var(--accent);
}

.no-data {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-secondary);
  pointer-events: none;
  z-index: 8;
}

.no-data-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.no-data-text {
  font-size: 13px;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 40;
  backdrop-filter: blur(2px);
}

.loading-progress {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-height: 16px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  #grid-shell .tabulator-row.et-row-active {
    forced-color-adjust: none;
    background: SelectedItem !important;
    color: SelectedItemText !important;
  }

  #grid-container .tabulator-cell.et-cell-selected,
  #grid-container .tabulator-cell.et-cell-focus {
    forced-color-adjust: none;
    background: Highlight !important;
    color: HighlightText !important;
    outline: 2px solid HighlightText;
    box-shadow: none;
  }

  .drawer-tab:focus-visible,
  .columns-workspace-tab:focus-visible,
  .col-head:focus-visible,
  .segmented button:focus-visible,
  .action-btn:focus-visible,
  .icon-btn:focus-visible,
  .cf-add:focus-visible,
  .cf-template:focus-visible,
  .cf-remove:focus-visible,
  .col-move button:focus-visible,
  .advanced-section-summary:focus-visible,
  .et-expansion-tabs button:focus-visible,
  .viewer-group-chip button:focus-visible,
  .viewer-group-toggle:focus-visible,
  .page-size-select:focus-visible,
  .filter-chip button:focus-visible,
  .filter-clear:focus-visible {
    outline: 2px solid Highlight;
  }
}

@media (max-width: 900px) {
  #footer-bar {
    gap: 6px;
  }
  .footer-left,
  .footer-right {
    width: auto;
  }
  .search-input {
    flex: 1;
    min-width: 90px;
    max-width: none;
  }
  .drawer {
    width: calc(100% - 20px);
    max-width: 320px;
  }
}
