/* Centred in the footer bar, clear of the visibility control on its left and
   the credit on its right, and centred on the bar's own 20px height. */
.table-query-pager {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1;
    max-width: calc(100% - 240px); white-space: nowrap;
}
.table-query-pager[hidden] { display: none; }
.table-query-pager span { color: #58616d; }
[data-theme="dark"] .table-query-pager span { color: #b4bac3; }

.grid-value-list {
    box-sizing: border-box;
    height: 100%;
    padding: 3px 5px;
    overflow: auto;
    white-space: nowrap;
    border: 1px solid #dee2e6;
    font: 400 12px Arial, Helvetica, sans-serif;
    color: #212529;
}
.grid-value-list span { cursor: pointer; }
.grid-value-list.expanded { white-space: normal; overflow-wrap: anywhere; line-height: 14px; }
.grid-value-list.expanded span { display: block; }
.grid-value-list span:hover { text-decoration: underline; }
[data-theme="dark"] .grid-value-list { color: #e0e0e0; border-color: #444; }

/* The query waiting signal: a pulse travelling an edge between three nodes,
   the same shape the Selection Area and the grid are made of. One SVG drawn by
   table-grid.js, sized here -- small inside the pager's status, large over a
   grid that has no rows yet. */
.query-pulse-signal { display: block; overflow: visible; }
.query-pulse-track { stroke: currentColor; stroke-width: 1.5; opacity: .22; }
.query-pulse-beam {
    stroke: var(--accent-blue);
    stroke-width: 2.2;
    stroke-linecap: round;
    /* 14 + 38 is the 52-unit edge, so exactly one dash crosses it per cycle. */
    stroke-dasharray: 14 38;
    animation: query-pulse-beam 1.4s linear infinite;
}
.query-pulse-node, .query-pulse-halo {
    transform-box: fill-box;
    transform-origin: center;
}
.query-pulse-node {
    fill: var(--accent-blue);
    animation: query-pulse-node 1.4s ease-in-out infinite;
}
.query-pulse-halo {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 1.2;
    animation: query-pulse-halo 1.4s ease-out infinite;
}
/* Each node answers a beat after the one before it, so the signal reads as
   travelling rather than blinking. */
.query-pulse-signal [data-step="1"] { animation-delay: .22s; }
.query-pulse-signal [data-step="2"] { animation-delay: .44s; }
@keyframes query-pulse-beam { from { stroke-dashoffset: 14; } to { stroke-dashoffset: -38; } }
@keyframes query-pulse-node {
    0%, 100% { transform: scale(.62); fill-opacity: .3; }
    45% { transform: scale(1); fill-opacity: 1; }
}
@keyframes query-pulse-halo {
    0% { transform: scale(.6); opacity: .5; }
    70%, 100% { transform: scale(2.4); opacity: 0; }
}

.table-query-pager .query-pulse-signal { width: 52px; height: 17px; }

/* The grid's own scroll box is the containing block for the overlay. */
.view-content { position: relative; }
.query-pulse-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    /* A query is not a modal: the signal reads over whatever is beneath it and
       never takes a click. */
    pointer-events: none;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(2px);
    color: #58616d;
}
.query-pulse-overlay[hidden] { display: none; }
.query-pulse-overlay .query-pulse-signal { width: 156px; height: 52px; }
/* Read aloud, never drawn: the pulse is what the screen says. */
.query-pulse-caption {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

[data-theme="dark"] .table-query-pager .query-pulse-signal,
[data-theme="dark"] .query-pulse-overlay { color: #b4bac3; }
[data-theme="dark"] .query-pulse-overlay { background: rgba(30, 30, 30, .72); }

/* Keep the signal alive without moving anything. */
@media (prefers-reduced-motion: reduce) {
    .query-pulse-beam, .query-pulse-node, .query-pulse-halo { animation: none; }
    .query-pulse-halo { opacity: 0; }
    .query-pulse-node { fill-opacity: .85; }
    .query-pulse-signal { animation: query-pulse-breathe 2.4s ease-in-out infinite; }
    @keyframes query-pulse-breathe { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
}
