/* Table framework (wt-*). Uses the console tokens from app.css, so light and dark follow the theme.
   Logical properties everywhere: cell content follows dir; the toolbar keeps its physical layout
   (tools on the left, page size / filters / search on the right) in LTR and RTL alike. */

.wt {
  --wt-pad-y: 9px; --wt-pad-x: 12px; --wt-gap: 4px; --wt-thumb: 34px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 100%;
}
.wt[data-density="compact"] { --wt-pad-y: 4px; --wt-pad-x: 10px; --wt-gap: 2px; --wt-thumb: 26px; }
.wt[data-density="relaxed"] { --wt-pad-y: 14px; --wt-pad-x: 14px; --wt-gap: 6px; --wt-thumb: 40px; }
.wt i[class*="fa-"] { line-height: 1; }

/* ---------- tabs ---------- */
.wt-tabs { align-items: stretch; }
.wt-tabs button i { font-size: 13px; opacity: .85; }
.wt-tabs button[aria-selected="true"] i { opacity: 1; }
.wt-tab-group {
  display: flex; align-items: center; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); padding-inline: 14px 4px; white-space: nowrap;
}
.wt-tab-group:first-child { padding-inline-start: 2px; }

/* ---------- card ---------- */
.wt-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 12px 6px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.wt-progress { position: absolute; inset: 0 0 auto 0; height: 2px; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; opacity: 0; transition: opacity .15s ease .12s; }
.wt.is-loading .wt-progress { opacity: 1; }
.wt-progress::before { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--accent); animation: wt-indet 1.1s ease-in-out infinite; }
@keyframes wt-indet { from { left: -35%; } to { left: 100%; } }

.wt-caption { display: flex; align-items: baseline; gap: 2px 12px; flex-wrap: wrap; }
.wt-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wt-title i { color: var(--muted); font-size: 15px; }
.wt-title h2 { font-size: 16px; }
.wt-hint-text { color: var(--muted); font-size: 12.5px; }

/* ---------- toolbar ---------- */
.wt-toolbar { direction: ltr; display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.wt-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.wt-tools-right { margin-left: auto; }
.wt-tools > :dir(rtl) { direction: rtl; }
.wt .btn i, .wt-pop .btn i, .wt-modal .btn i { font-size: 14px; }
.wt-tool { width: 34px; padding: 0; position: relative; }
.wt-tool:has(.wt-tool-text) { width: auto; padding: 0 10px; }
.wt-tool.is-on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.wt-tool.is-spinning i { animation: spin .8s linear infinite; }
.wt-tool-text { font-size: 12.5px; }
.wt-sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 3px; flex: none; }
.wt-size { gap: 8px; padding: 0 10px; min-width: 64px; font-variant-numeric: tabular-nums; }
.wt-size i { font-size: 12px; color: var(--muted); }
.wt-badge {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 650; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.wt-search { position: relative; display: flex; align-items: center; }
.wt-search-input { width: 270px; padding-inline: 32px 32px; }
.wt-search-input::-webkit-search-cancel-button { display: none; }
.wt-search-ico { position: absolute; inset-inline-start: 11px; color: var(--axis); font-size: 13px; pointer-events: none; }
.wt-kbd {
  position: absolute; inset-inline-end: 8px; font: 11px/16px var(--mono); padding: 0 5px; color: var(--muted);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; pointer-events: none; background: var(--surface);
}
.wt-search-input:focus ~ .wt-kbd { display: none; }
.wt-search-clear {
  position: absolute; inset-inline-end: 5px; width: 24px; height: 24px; border: 0; border-radius: 5px; background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.wt-search-clear:hover { background: var(--surface-3); color: var(--ink); }

/* ---------- chips & bulk bar ---------- */
.wt-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wt-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding-inline: 10px 3px; border-radius: 999px; max-width: 100%;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); font-size: 12.5px;
}
.wt-chip-k { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.wt-chip-k::after { content: ":"; }
.wt-chip-v { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.wt-chip-x {
  border: 0; background: transparent; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; color: var(--accent);
  display: grid; place-items: center; font-size: 11px; flex: none;
}
.wt-chip-x:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.wt-chip.is-invalid { background: var(--crit-soft); border-color: color-mix(in srgb, var(--crit) 40%, transparent); }
.wt-chip.is-invalid .wt-chip-x { color: var(--crit-ink); }
.wt-chip-clear { height: 28px; }

.wt-bulk {
  position: sticky; bottom: 12px; z-index: 4; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px 8px;
  border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); box-shadow: var(--shadow-lg); animation: rise .15s ease-out;
}
.wt-bulk-n { display: inline-flex; gap: 8px; align-items: center; font-weight: 650; padding: 0 6px; white-space: nowrap; }
.wt-bulk-n i { color: var(--accent); }
.wt-bulk .btn.sm { background: var(--surface); }
.wt-bulk .btn.ghost { background: transparent; }
.wt-bulk .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.wt-bulk .btn.primary:hover { background: var(--accent-hover); }
.wt-count {
  font-size: 11px; line-height: 17px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2);
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.wt-error .banner { align-items: center; }
.wt-error .banner > i { color: var(--crit-ink); font-size: 16px; }

/* ---------- grid ---------- */
/* position: relative makes the scroller the containing block of visually hidden (absolute) labels in cells,
   so they scroll with the table instead of widening the page on phones. */
.wt-scroll { position: relative; overflow-x: auto; margin: 0 -6px; padding: 0 6px; overscroll-behavior-x: contain; }
.wt.is-sticky .wt-scroll { max-height: max(360px, calc(100vh - 230px)); overflow-y: auto; }
.wt-table { width: 100%; border-collapse: separate; border-spacing: 0 var(--wt-gap); }
.wt-table th {
  text-align: start; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 9px var(--wt-pad-x);
  background: var(--surface-3); white-space: nowrap; vertical-align: middle;
}
.wt.is-sticky .wt-table thead th { position: sticky; top: var(--wt-gap); z-index: 2; box-shadow: 0 calc(-1 * var(--wt-gap) - 1px) 0 var(--surface); }
.wt-table th:first-child, .wt-table td:first-child { border-start-start-radius: 8px; border-end-start-radius: 8px; }
.wt-table th:last-child, .wt-table td:last-child { border-start-end-radius: 8px; border-end-end-radius: 8px; }
.wt-table td {
  padding: var(--wt-pad-y) var(--wt-pad-x); background: var(--surface-2); vertical-align: middle; white-space: nowrap;
  transition: background-color .12s ease;
}
.wt.is-wrap .wt-table td { white-space: normal; }
.wt.is-wrap .wt-table td.t-text { min-width: 160px; max-width: 440px; }
.wt-table tbody { transition: opacity .15s ease .12s; }
.wt.is-loading .wt-table tbody { opacity: .5; }
.wt-table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface-3)); }
.wt-table tbody tr.is-selected td { background: var(--accent-soft); }
.wt-table tbody tr:focus { outline: none; }
.wt-table tbody tr:focus-visible td { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface-2)); box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.wt-table tbody tr:focus-visible td:first-child { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent), inset 3px 0 0 var(--accent); }
.wt-table tbody tr:focus-visible td:first-child:dir(rtl) { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent), inset -3px 0 0 var(--accent); }
.wt-table.is-clickable tbody tr { cursor: pointer; }
.wt-table .al-start { text-align: start; }
.wt-table .al-end { text-align: end; }
.wt-table .al-center { text-align: center; }
.wt-table .wt-chk { width: 40px; padding-inline: 12px 4px; text-align: center; }
.wt-chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }

.wt-sort { border: 0; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.wt-sort:hover { color: var(--ink); }
.wt-sort-ico { font-size: 11px; opacity: .45; }
.wt-table th.is-sorted { color: var(--accent); }
.wt-table th.is-sorted .wt-sort-ico { opacity: 1; }

/* cells */
.wt-media { display: inline-flex; align-items: center; gap: 10px; min-width: 0; vertical-align: middle; text-align: start; }
.wt-media .wt-main { font-weight: 600; }
.wt-stack { display: inline-flex; flex-direction: column; min-width: 0; vertical-align: middle; line-height: 1.3; }
.al-end .wt-stack { align-items: flex-end; }
.wt-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.wt-null { color: var(--axis); }
.wt-link { color: var(--accent); }
.wt-time { white-space: nowrap; }
.wt-thumb {
  width: var(--wt-thumb); height: var(--wt-thumb); border-radius: 8px; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  font-size: 12px; font-weight: 650; color: #fff; background: var(--s1); vertical-align: middle;
}
.wt-thumb.round { border-radius: 50%; }
.wt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wt-thumb.is-zoomable { border: 0; padding: 0; cursor: zoom-in; font: inherit; }
.wt-thumb.is-zoomable:hover { box-shadow: 0 0 0 2px var(--accent); }
.wt-thumb.av1 { background: var(--s2); } .wt-thumb.av2 { background: var(--s3); } .wt-thumb.av3 { background: var(--s7); }
.wt-thumb.av4 { background: var(--s5); } .wt-thumb.av5 { background: var(--s6); }
.wt-tags { display: inline-flex; gap: 4px; flex-wrap: nowrap; }
.wt.is-wrap .wt-tags { flex-wrap: wrap; }
/* A tag with an icon shows the icon in the tone instead of the dot (see .badge in app.css). */
.wt-tag.has-icon::before { display: none; }
.wt-tag { gap: 5px; padding-inline: 7px 8px; }
.wt-tag i { font-size: 11.5px; color: var(--tone); width: 1.05em; text-align: center; }
.wt-tag.warn i { color: color-mix(in srgb, var(--warn) 75%, var(--ink)); }
.wt-tag.plain i { color: var(--muted); }

/* ---------- quick-filter tabs (one select filter as tabs, with facet counts) ---------- */
.wt-quick { margin: -2px -12px 0; padding: 0 8px; }
.wt-quick button { padding: 8px 10px; font-size: 13px; }
.wt-quick button.is-zero { color: var(--muted); }
.wt-quick button.is-zero .n { opacity: .7; }
.wt-quick button[aria-selected="true"] .n { background: var(--accent-soft); color: var(--accent); }
.wt-quick-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--axis); }
.wt-quick-dot.good { background: var(--good); } .wt-quick-dot.info { background: var(--accent); }
.wt-quick-dot.warn { background: color-mix(in srgb, var(--warn) 85%, var(--ink)); } .wt-quick-dot.serious { background: var(--serious); }
.wt-quick-dot.crit { background: var(--crit); } .wt-quick-dot.violet { background: var(--s7); }
.wt-quick-dot.plain { background: var(--line-strong); }
.wt-bool { display: inline-flex; font-size: 15px; vertical-align: middle; }
.wt-bool.yes { color: var(--good); }
.wt-bool.no { color: var(--axis); }

/* inline edit */
.wt-table td.is-editable { position: relative; padding-inline-end: calc(var(--wt-pad-x) + 22px); }
.wt-edit-btn {
  position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border: 0; border-radius: 6px;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); color: var(--ink-2); opacity: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 11px; transition: opacity .12s;
}
.wt-table tr:hover .wt-edit-btn, .wt-table tr:focus-within .wt-edit-btn, .wt-edit-btn:focus-visible { opacity: 1; }
.wt-edit-btn:hover { color: var(--accent); }
@media (hover: none) { .wt-edit-btn { opacity: .75; } }
.wt-table td.is-editing { padding-block: 3px; padding-inline-end: 6px; }
.wt-editor { display: flex; gap: 2px; align-items: center; position: relative; }
.wt-editor .input, .wt-editor .select { flex: 1; min-width: 110px; }
.wt-editor-err {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 4; background: var(--crit); color: #fff; font-size: 12px;
  padding: 4px 9px; border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow-lg);
}
.wt .input.sm, .wt .select.sm, .wt-pop .input.sm { height: 30px; font-size: 13px; padding: 0 8px; }
.wt .btn.icon.sm, .wt-pop .btn.icon.sm, .wt-modal .btn.icon.sm { width: 28px; padding: 0; }

/* row actions */
.wt-table .wt-act { width: 1%; text-align: end; padding-inline: 6px 8px; }
.wt-row-actions { display: inline-flex; gap: 2px; vertical-align: middle; }
.wt-icon-btn {
  width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); cursor: pointer;
  display: inline-grid; place-items: center; font-size: 14px; vertical-align: middle;
}
.wt-icon-btn:hover, .wt-icon-btn[aria-expanded="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.wt-icon-btn.danger:hover { color: var(--crit-ink); background: var(--crit-soft); }
.wt-icon-btn:disabled { visibility: hidden; }
.wt[data-density="compact"] .wt-icon-btn { width: 26px; height: 26px; }

/* removal */
.wt-table tr.wt-out td { opacity: 0; transition: opacity .25s ease, background-color .25s ease; background: var(--crit-soft); }
.wt-table tr.wt-collapse td { padding-block: 0; line-height: 0; transition: padding .16s ease; background: transparent; }

/* states */
.wt-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 30px 16px 36px; color: var(--muted); }
.wt-empty-ico { font-size: 46px; color: var(--accent); --fa-secondary-opacity: .28; margin-bottom: 8px; }
.wt-empty b { color: var(--ink); font-size: 15px; }
.wt-empty .btn { margin-top: 10px; }
.wt-wait { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 16px; color: var(--muted); animation: wt-appear .2s ease .25s both; }
.wt-wait i { font-size: 20px; color: var(--accent); }
@keyframes wt-appear { from { opacity: 0; } }

/* footer */
.wt-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding-top: 2px; font-size: 12.5px; color: var(--ink-2); }
.wt-readout { display: flex; gap: 2px 6px; flex-wrap: wrap; align-items: baseline; }
.wt-readout b { color: var(--ink); font-weight: 650; }
.wt-dot { color: var(--axis); }
.wt-pager { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.wt-page {
  min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2);
  font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; display: inline-grid; place-items: center;
}
.wt-page:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.wt-page.is-current { background: var(--surface-3); color: var(--ink); }
.wt-page:disabled { opacity: .35; cursor: default; }
.wt-gap { padding: 0 4px; color: var(--axis); }
.wt-page-of { display: none; padding: 0 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wt-goto { width: 78px; margin-inline-start: 8px; }
.wt :dir(rtl) .wt-flip, .wt-flip:dir(rtl) { transform: scaleX(-1); }

/* ---------- floating hint ---------- */
.wt-hint {
  position: fixed; z-index: 80; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap; max-width: calc(100vw - 12px); box-shadow: var(--shadow-lg);
  animation: wt-fade .08s ease-out;
}
.wt-hint::after {
  content: ""; position: absolute; left: var(--wt-hint-x, 50%); top: 100%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink);
}
.wt-hint.below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--ink); }
@keyframes wt-fade { from { opacity: 0; } }

/* ---------- popovers & menus ---------- */
.wt-pop {
  position: fixed; z-index: 50; min-width: 180px; max-width: calc(100vw - 16px); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; overflow: auto;
  animation: wt-pop .1s ease-out; font-size: 13.5px;
}
.wt-pop:focus { outline: none; }
@keyframes wt-pop { from { opacity: 0; transform: translateY(-3px); } }
.wt-pop-wide { width: 380px; padding: 0; }
.wt-pop-filters { width: 410px; }
.wt-pop.is-sheet {
  left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; max-height: 86vh; border-radius: 14px 14px 0 0;
  animation: wt-sheet .18s ease-out; padding-bottom: env(safe-area-inset-bottom);
}
@keyframes wt-sheet { from { transform: translateY(24px); opacity: .6; } }
.wt-menu { display: flex; flex-direction: column; min-width: 180px; }
.wt-menu-item {
  display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: start; padding: 8px 10px;
  border-radius: 7px; font: inherit; color: var(--ink); cursor: pointer; white-space: nowrap;
}
.wt-menu-item:hover, .wt-menu-item:focus-visible { background: var(--surface-2); outline: none; color: var(--accent); }
.wt-menu-item.danger { color: var(--crit-ink); }
.wt-menu-item.danger:hover, .wt-menu-item.danger:focus-visible { background: var(--crit-soft); color: var(--crit-ink); }
.wt-menu-item[aria-checked="true"] { font-weight: 650; }
.wt-menu-item:disabled { color: var(--muted); cursor: default; background: transparent; }
.wt-menu-ico { width: 1.25em; flex: none; }
.wt-menu-label { flex: 1; }
.wt-menu-check { color: var(--accent); }
.wt-menu-meta { color: var(--muted); font-size: 12px; }
.wt-menu-h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px 4px; }
.wt-menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }

/* panels (settings, filters) */
.wt-panel { display: flex; flex-direction: column; min-height: 0; }
.wt-panel h3 { font-size: 13.5px; }
.wt-panel-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.wt-panel-sec { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.wt-panel-sec.stack { flex-direction: column; align-items: flex-start; gap: 8px; }
.wt-panel-f { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.wt-cols { list-style: none; margin: 0; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 1px; }
.wt-col { display: flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 7px; border: 1px dashed transparent; }
.wt-col:hover { background: var(--surface-2); }
.wt-col .check { min-width: 0; padding: 4px 0; }
.wt-col.is-off .check span { color: var(--muted); }
.wt-col.is-drag { opacity: .4; }
.wt-col.is-over { border-color: var(--accent); background: var(--accent-soft); }
.wt-grip { cursor: grab; color: var(--axis); padding: 0 4px; font-size: 13px; }

.wt-filter-list { display: flex; flex-direction: column; padding: 0 14px 6px; }
.wt-filter { border: 0; margin: 0; padding: 10px 0 12px; border-top: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; gap: 0; }
.wt-filter:first-child { border-top: 0; }
.wt-filter legend { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 8px; float: left; width: 100%; }
.wt-filter legend i { color: var(--muted); }
.wt-filter legend + * { clear: both; }
.wt-filter.invalid .input { border-color: var(--crit); }
.wt-filter .err { color: var(--crit-ink); font-size: 12px; margin-top: 6px; }
.wt-filter .seg { align-self: flex-start; }
.wt-select { display: flex; flex-direction: column; gap: 6px; }
.wt-options { display: flex; flex-direction: column; gap: 1px; max-height: 220px; overflow: auto; }
.wt-option { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.wt-option:hover { background: var(--surface-2); }
.wt-option input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.wt-range { display: flex; align-items: center; gap: 6px; }
.wt-range .input { flex: 1; min-width: 0; width: 100%; }
.wt-range-cur { font-size: 12px; color: var(--muted); font-weight: 600; }
.wt-presets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.wt-filter .hint { font-size: 12px; color: var(--muted); }
.wt-filter-note { margin: 0; padding: 0 14px 10px; }

/* modals */
/* Table form dialogs open in the middle of the screen, like the panel's form dialogs (app.css). */
.wt-modal { width: min(520px, calc(100vw - 32px)); top: 50%; transform: translate(-50%, -50%); max-height: 82vh; max-height: 82dvh; padding: 0; gap: 0; display: flex; flex-direction: column; }
.wt-modal-h { display: flex; align-items: center; gap: 8px; padding: 16px 18px 8px; }
.wt-modal-title { font-size: 16px; flex: 1; }
.wt-modal-b { padding: 4px 18px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.wt-modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.wt-confirm { width: min(440px, calc(100vw - 32px)); }
.wt-print-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 230px; overflow: auto; }
.wt-print-cols .check span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-label { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.wt-modal .seg button { display: inline-flex; gap: 6px; align-items: center; }
.wt-failures { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.wt-failures li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; flex-wrap: wrap; }
.wt-failures i { color: var(--crit); }
.wt-meter { height: 8px; }
.wt-meter > div { width: 0; transition: width .2s ease; }
.btn.danger.solid { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.danger.solid:hover { background: var(--crit-ink); }
.wt-drawer .form .check { padding: 4px 0; }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  .wt-card { padding: 10px 10px 6px; }
  .wt-quick { margin-inline: -10px; padding: 0 6px; }
  .wt-tools-right { margin-left: 0; width: 100%; }
  .wt-search { flex: 1; min-width: 0; }
  .wt-search-input { width: 100%; }
  .wt-kbd { display: none; }
  .wt-page:not(.wt-nav), .wt-gap, .wt-goto { display: none; }
  .wt-page-of { display: inline; }
  .wt-foot { justify-content: center; }
  .wt.is-sticky .wt-scroll { max-height: none; overflow-y: visible; }
  .wt.is-sticky .wt-table thead th { position: static; box-shadow: none; }
  .wt-print-cols { grid-template-columns: minmax(0, 1fr); }
  .wt-chip-v { max-width: 170px; }
  .wt-hint-text { display: none; }
}
