:root {
    --gw-ui-border: #d7e0e8;
    --gw-ui-radius: 10px;
    --gw-ui-accent: #176fa9;
    --gw-ui-text: #182d40;
    --gw-ui-muted: #556b7e;
}
/* One shared rule for table values/headings, including dialogs and sticky copies.
   Explicit metadata blocks and multiline editors retain their own structure. */
table th, table td { white-space: nowrap !important; overflow-wrap: normal !important; word-break: normal !important; }
.gw-table-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 8px; color: var(--gw-ui-text); }
.gw-table-scope { font-size: 12px; color: var(--gw-ui-muted); }
.gw-table-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.gw-table-tools button, .gw-table-tools .column-picker > summary { min-height: 34px; padding: 7px 12px; border: 1px solid var(--gw-ui-border); border-radius: 8px; background: white; font-size: 13px; color: var(--gw-ui-text); }
.gw-table-tools button[aria-pressed="true"] { color: var(--gw-ui-accent); background: #eaf4fc; border-color: #a7cce5; }
.gw-table-tools .column-picker-menu { width: min(320px, calc(100vw - 40px)); border-radius: var(--gw-ui-radius); border-color: var(--gw-ui-border); }
.gw-column-options { max-height: min(48vh, 380px); overflow-y: auto; overscroll-behavior: contain; }
.gw-column-search { width: 100%; min-height: 34px; margin-bottom: 6px; }
.gw-data-table th { position: relative; vertical-align: middle; }
.gw-data-table th.sortable-column::after { top: 50%; transform: translateY(-50%); }
.gw-data-table.gw-table-compact th, .gw-data-table.gw-table-compact td { padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.gw-data-table.gw-table-compact td input, .gw-data-table.gw-table-compact td select { min-height: 30px; }
.gw-table-toolbar [hidden], .gw-data-table [hidden] { display: none !important; }
@media (max-width: 600px) { .gw-table-tools { width: 100%; justify-content: flex-end; } }
/* A loading message never dims text or blocks a newer filter/sort. */
.gw-table-loading-message { min-height: 1.4em; margin: 0 0 .25rem; color: #175e91; }
.number-group-heading td { background: #e9f1f8; color: #294b67; padding: 12px 14px; border-top: 2px solid #cbdbe7; text-align: left; }
.number-source { display: block; margin-top: 4px; color: #64748b; font-size: 11px; font-weight: normal; overflow-wrap: normal; }
.gw-table-loading .table-wrap { border-top: 2px solid #1979b5; }
.gw-table-loading [data-selection-controls], .gw-table-loading [data-selection-download],
.gw-table-error [data-selection-controls], .gw-table-error [data-selection-download] { pointer-events: none; opacity: .65; }

/* Display numbering follows the visible order, independently of document IDs. */
.gw-data-table [data-column-key="row_number"], .gw-data-table [data-row-number] { width: 4rem; white-space: nowrap; font-variant-numeric: tabular-nums; color: #536174; }
/* Account-owned widths use the shared table controller, including dialogs. */
.gw-width-toolbar { display: flex; align-items: center; margin: 8px 0; }
.gw-width-edit { display: inline-flex; flex: 0 0 34px; align-items: center; justify-content: center; padding: 0 4px !important; margin: 0; min-width: 34px; width: 34px; height: 34px; font-size: 16px; vertical-align: middle; }
table.gw-width-layout { table-layout: fixed !important; min-width: 0 !important; max-width: none !important; }
table.gw-width-layout th, table.gw-width-layout td { min-width: 0 !important; overflow: hidden; }
table.gw-width-layout input, table.gw-width-layout select, table.gw-width-layout textarea { max-width: 100%; box-sizing: border-box; }
.gw-width-popover { position: fixed; z-index: 10050; box-sizing: border-box; width: min(320px, calc(100vw - 16px)); padding: 14px; border: 1px solid #bdcddd; border-radius: 8px; background: #fff; color: #183347; box-shadow: 0 8px 30px #10203035; }
.gw-width-popover label { display: block; font-size: 14px; }
.gw-width-popover { max-height: calc(100vh - 16px); overflow-y: auto; }
.gw-width-popover select { display: block; box-sizing: border-box; width: 100%; margin: 8px 0; }
.gw-width-popover input[type=number] { display: block; box-sizing: border-box; width: 100%; margin: 8px 0; }
.gw-width-popover input[type=range] { display: block; width: 100%; margin: 10px 0; }
.gw-width-popover button { margin-right: 6px; }
.gw-width-popover [role=alert] { color: #a52020; margin-top: 6px; font-size: 13px; }
.gw-width-status { display: block; font-size: 13px; color: #526678; }
.gw-width-status:empty { display: none; }

.excel-column-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:10px 20px; margin:12px 0; }
.excel-column-grid label { display:flex; align-items:flex-start; gap:8px; }
.excel-export-dialog { width:min(920px,94vw); max-height:90vh; overflow:auto; }
.excel-export-dialog fieldset { margin:14px 0; border:1px solid #cedae4; border-radius:8px; }
