/* ── Attribute table ──────────────────────────────────────────────────────────
   Docked along the bottom of the map. A table is read AGAINST the map — you select a row to see
   where it is — so a modal covering the map would defeat it. Sits above the map chrome but below
   the service browser and the tour, which are modal by intent. */
#attr-table-panel{
  display:none;position:fixed;left:var(--sw);right:0;bottom:0;z-index:2500;height:46vh;min-height:240px;
  flex-direction:column;background:var(--navy);border-top:1px solid var(--divider);
  box-shadow:0 -14px 40px rgba(6,12,20,.5)}
body:has(#sidebar.collapsed) #attr-table-panel{left:0}
#attr-table-panel.visible{display:flex;transition:left .25s ease;animation:attrUp .2s cubic-bezier(.2,.8,.2,1) both}
@keyframes attrUp{from{transform:translateY(14px);opacity:0}to{transform:none;opacity:1}}
.attr-hdr{display:flex;align-items:center;gap:var(--s3);padding:var(--s3) var(--s5);
  border-bottom:1px solid var(--divider);flex-shrink:0}
.attr-title{font-size:var(--t-base);font-weight:600;color:var(--text);flex-shrink:0;
  max-width:38%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* The count and field tally sit next to the name rather than under it: they qualify the title,
   and a second line would push the grid down for information you read once. */
.attr-status{flex:1;min-width:0;font-size:var(--t-2xs);color:var(--text-faint);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attr-x{flex-shrink:0;background:none;border:none;color:var(--text-faint);cursor:pointer;
  font-size:var(--t-base);line-height:1;padding:4px}
.attr-x:hover{color:var(--text)}
.attr-grid{flex:1 1 auto;min-height:0;overflow:hidden}
.attr-empty{padding:var(--s6) var(--s5);color:var(--text-faint);font-size:var(--t-sm);line-height:1.5}

/* Esri's FeatureTable ships light-themed AND renders its grid inside a vaadin-grid shadow root,
   so ordinary th/td selectors cannot reach the cells. Two routes are needed and both are used:
   ::part() crosses the shadow boundary for chrome (row/cell backgrounds, borders), while the
   cell TEXT lives in slotted <vaadin-grid-cell-content> in the light DOM and is styled directly. */
.esri-feature-table,.esri-feature-table__container,.esri-grid,.esri-grid__content{
  background:var(--navy)!important;color:var(--text-muted)!important;font-family:var(--font)!important}
#attr-table-grid vaadin-grid{background:var(--navy)!important;font-family:var(--font)!important;
  height:100%!important;border:none!important}
#attr-table-grid vaadin-grid-cell-content{font-family:var(--font)!important;font-size:var(--t-sm)!important;
  color:var(--text-muted)!important}
/* Header cells: same uppercase micro-label treatment as every other column head in the app. */
#attr-table-grid vaadin-grid::part(header-cell){background:var(--navy-dark)!important;
  border-color:var(--divider)!important}
/* Header TEXT cannot be reached through ::part() — the part is in the shadow tree and the text
   is slotted light-DOM content, so it is not a descendant of the part. Esri wraps each header in
   .esri-field-column__header-content, which sits in the light DOM and is the reliable hook. */
#attr-table-grid .esri-field-column__header-content{
  color:var(--text-faint)!important;font-size:var(--t-2xs)!important;font-weight:700!important;
  text-transform:uppercase!important;letter-spacing:.05em!important}
#attr-table-grid vaadin-grid::part(body-cell){background:var(--navy)!important;
  border-color:var(--divider)!important}
#attr-table-grid vaadin-grid::part(row):hover>[part~=body-cell]{background:var(--surface-tint)!important}
#attr-table-grid vaadin-grid::part(selected-row-cell){background:var(--teal-dim)!important}
#attr-table-grid vaadin-grid::part(selected-row-cell) vaadin-grid-cell-content{color:var(--text)!important}
.esri-feature-table__pagination,.esri-feature-table__footer,.esri-feature-table__menu{
  background:var(--navy-dark)!important;border-color:var(--divider)!important;color:var(--text-faint)!important}
.esri-feature-table .esri-button,.esri-feature-table .esri-widget--button{
  background:var(--navy-mid)!important;color:var(--text-muted)!important;border-color:var(--divider)!important}
.esri-feature-table .esri-button:hover,.esri-feature-table .esri-widget--button:hover{
  color:var(--teal)!important;border-color:var(--teal)!important}
#attr-table-grid input[type=checkbox],#attr-table-grid vaadin-checkbox{accent-color:var(--teal)}

/* Resize handle. A 7px strip along the top edge with a visible grip — the panel height is a
   guess about the screen, and 46vh is wrong for anyone reading one wide row or skimming forty. */
.attr-resize{position:absolute;top:0;left:0;right:0;height:7px;cursor:ns-resize;z-index:2;
  display:flex;align-items:center;justify-content:center;touch-action:none}
.attr-resize::after{content:'';width:38px;height:3px;border-radius:2px;background:var(--divider);
  transition:background .15s}
.attr-resize:hover::after{background:var(--teal)}
/* The height transition is suspended mid-drag or the panel lags a frame behind the pointer. */
#attr-table-panel.resizing{transition:none}
#attr-table-panel.resizing .attr-grid{pointer-events:none}

/* Toolbar: search, extent toggle, zoom. Its own row under the title — crowding them onto the
   title line squeezed the layer name, which is the one thing you must be able to read. */
.attr-tools{display:flex;align-items:center;gap:var(--s3);padding:0 var(--s5) var(--s3);
  border-bottom:1px solid var(--divider);flex-shrink:0;flex-wrap:wrap}
.attr-search{flex:1 1 200px;min-width:140px;max-width:340px;background:var(--navy-dark);
  border:1px solid var(--divider);border-radius:4px;padding:5px var(--s3);color:var(--text);
  font-family:var(--font);font-size:var(--t-xs);outline:none;transition:border-color .15s}
.attr-search:focus{border-color:var(--teal)}
.attr-search::placeholder{color:var(--text-faint)}
.attr-search:disabled{opacity:.5;cursor:not-allowed}
.attr-toggle{display:flex;align-items:center;gap:6px;font-size:var(--t-2xs);color:var(--text-muted);
  cursor:pointer;user-select:none;white-space:nowrap}
.attr-toggle input{accent-color:var(--teal);cursor:pointer;margin:0}
.attr-btn{background:var(--navy-mid);border:1px solid var(--divider);border-radius:4px;
  color:var(--text-muted);font-family:var(--font);font-size:var(--t-2xs);padding:5px var(--s3);
  cursor:pointer;white-space:nowrap;transition:color .15s,border-color .15s,opacity .15s}
.attr-btn:hover:not(:disabled){color:var(--teal);border-color:var(--teal)}
.attr-btn:disabled{opacity:.4;cursor:not-allowed}
