/* Pico <-> Tabulator bridge: Pico custom properties flip with data-theme,
   so every rule below is correct in BOTH light and dark. */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 10; }
.skip:focus { left: 1rem; padding: .5rem 1rem; background: var(--pico-background-color); border: 2px solid var(--pico-primary); }
:focus-visible { outline: 3px solid var(--pico-primary); outline-offset: 2px; }

.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.toolbar > * { margin: 0; }
.toolbar button { width: auto; margin: 0; padding: .4rem .9rem; }
.toolbar label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.toolbar select { width: auto; margin: 0; padding: .35rem 2rem .35rem .6rem; }
#cols { position: relative; margin: 0; }
#cols summary { margin: 0; cursor: pointer; }
#cols fieldset { position: absolute; z-index: 5; min-width: 16rem; max-height: 60vh; overflow: auto;
  padding: .75rem 1rem; background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius);
  box-shadow: var(--pico-card-box-shadow); }
#cols label { display: flex; gap: .5rem; align-items: center; margin: .15rem 0; }

.statusline { display: flex; gap: .6rem; align-items: center; color: var(--pico-muted-color); }
.badge { border: 2px solid currentColor; border-radius: var(--pico-border-radius);
  padding: 0 .5rem; font-weight: 700; letter-spacing: .04em; color: var(--pico-color); }
.banner { border: 2px solid var(--pico-color); border-left-width: .6rem;
  border-radius: var(--pico-border-radius); padding: .6rem 1rem; margin: .5rem 0 1rem;
  background: var(--pico-card-background-color); color: var(--pico-color); }

.skeleton { height: 2.2rem; margin: .45rem 0; border-radius: var(--pico-border-radius);
  background: var(--pico-muted-border-color); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Tabulator theme bridge */
.tabulator { background: var(--pico-background-color); color: var(--pico-color);
  border: 1px solid var(--pico-muted-border-color); font-size: .9rem; }
.tabulator .tabulator-header { background: var(--pico-card-background-color);
  color: var(--pico-color); border-bottom: 1px solid var(--pico-muted-border-color); }
.tabulator .tabulator-header .tabulator-col { background: var(--pico-card-background-color);
  color: var(--pico-color); border-right: 1px solid var(--pico-muted-border-color); }
.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover { background: var(--pico-primary-focus); }
.tabulator .tabulator-header input, .tabulator .tabulator-header select {
  background: var(--pico-form-element-background-color); color: var(--pico-form-element-color);
  border: 1px solid var(--pico-form-element-border-color); border-radius: var(--pico-border-radius); }
.tabulator .tabulator-tableholder .tabulator-table { background: var(--pico-background-color); color: var(--pico-color); }
.tabulator-row { background: var(--pico-background-color); color: var(--pico-color);
  border-bottom: 1px solid var(--pico-muted-border-color); }
.tabulator-row.tabulator-row-even { background: var(--pico-table-row-stripped-background-color); }
.tabulator-row:hover, .tabulator-row.tabulator-selected {
  background: color-mix(in srgb, var(--pico-primary) 14%, var(--pico-background-color)); }
.tabulator-row .tabulator-cell { border-right: 1px solid var(--pico-muted-border-color); }
.tabulator .tabulator-footer { background: var(--pico-card-background-color);
  color: var(--pico-color); border-top: 1px solid var(--pico-muted-border-color); }
.tabulator .tabulator-footer .tabulator-page { background: var(--pico-form-element-background-color);
  color: var(--pico-form-element-color); border: 1px solid var(--pico-form-element-border-color); }
.tabulator .tabulator-footer .tabulator-page.active { background: var(--pico-primary);
  color: var(--pico-primary-inverse); border-color: var(--pico-primary); }
.tabulator .tabulator-footer .tabulator-page:disabled { opacity: .5; }
.tabulator-group { background: var(--pico-card-background-color); color: var(--pico-color);
  border-bottom: 1px solid var(--pico-muted-border-color); border-top: 1px solid var(--pico-muted-border-color); }
.tabulator .tabulator-placeholder span { color: var(--pico-muted-color); }
.tabulator a, .fallback a { color: var(--pico-primary); }

.fallback { width: 100%; border-collapse: collapse; font-size: .85rem; }
.fallback th, .fallback td { border: 1px solid var(--pico-muted-border-color); padding: .35rem .5rem; text-align: left; }
.fallback thead th { background: var(--pico-card-background-color); }
footer small { color: var(--pico-muted-color); }
