/* tabular review grid */
.tab-view { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; overflow: hidden; background: var(--bg); }
.tab-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.tab-sep { width: 1px; height: 20px; background: var(--border); }
.tab-grow { flex: 1; }
.tab-count { font-size: 11.5px; color: var(--muted-fg); }
.tab-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.tab-seg button { padding: 6px 12px; font-size: 12px; background: var(--card); border: 0; cursor: pointer; color: var(--muted-fg); }
.tab-seg button.on { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.tab-chip { padding: 5px 10px; font-size: 11.5px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--card); cursor: pointer; color: var(--fg); }
.tab-chip:hover:not(:disabled) { background: var(--muted); }
.tab-chip.on { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.tab-chip:disabled { opacity: .45; cursor: not-allowed; }
.tab-view button:focus-visible, .tab-cell:focus-visible, .tab-view input:focus-visible { outline: none; box-shadow: var(--ring); }

.tab-main { display: flex; flex: 1; min-height: 0; min-width: 0; }
.tab-scroll { flex: 1; min-width: 0; overflow: auto; position: relative; scroll-padding-left: 220px; scroll-padding-top: 44px; }
.tab-grid { --first: 220px; --colw: 212px; --gw: calc(var(--first) + var(--ncols) * var(--colw)); width: var(--gw); position: relative; }
.tab-row { display: grid; grid-template-columns: var(--first) repeat(var(--ncols), var(--colw)); width: var(--gw); }
.tab-body { position: relative; }
.tab-body .tab-row { position: absolute; left: 0; height: 56px; }
.tab-head { position: sticky; top: 0; z-index: 4; height: 44px; background: var(--muted); border-bottom: 1px solid var(--border-strong); }
.tab-hcell { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 4px 6px 4px 12px; border-right: 1px solid var(--border); background: var(--muted); min-width: 0; }
.tab-hcell.tab-first, .tab-cell.tab-first { position: sticky; left: 0; z-index: 3; box-shadow: 1px 0 0 var(--border-strong); }
.tab-head .tab-first { z-index: 5; }
.tab-htext { display: flex; flex-direction: column; min-width: 0; }
.tab-hlabel { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-kind { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.tab-sortbtn { background: none; border: 0; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.tab-menu { position: absolute; top: calc(100% + 2px); right: 4px; z-index: 20; width: 230px; background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.tab-rename { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted-fg); padding: 4px 6px; }
.tab-rename .input { padding: 5px 8px; font-size: 12px; }
.tab-mi { display: flex; align-items: center; gap: 6px; text-align: left; padding: 7px 8px; font-size: 12px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--fg); }
.tab-mi:hover { background: var(--muted); }
.tab-mi.danger { color: var(--bad); }
.tab-mi .icon { width: 14px; height: 14px; }

.tab-cell { position: relative; padding: 6px 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--card); display: flex; flex-direction: column; justify-content: space-between; gap: 2px; min-width: 0; cursor: pointer; }
.tab-cell:hover { background: var(--primary-50); }
.tab-cell.tab-first { background: var(--card); cursor: default; justify-content: center; }
.tab-grouprow { background: var(--secondary-50); height: 56px; }
.tab-group { position: sticky; left: 0; grid-column: 1 / -1; align-self: center; width: max-content; padding: 0 12px; font-weight: 600; font-size: 12.5px; color: var(--secondary); }
.tab-body .tab-grouprow { border-bottom: 1px solid var(--border); display: flex; }
.tab-val { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-weight: 500; }
.tab-cell.is-miss .tab-val { color: var(--faint); font-weight: 400; }
.tab-meta { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted-fg); min-height: 16px; }
.tab-conf { position: relative; display: inline-flex; align-items: center; width: 54px; height: 15px; border-radius: 7px; background: var(--muted); border: 1px solid var(--border-strong); overflow: hidden; }
.tab-conf i { position: absolute; inset: 0 auto 0 0; }
.tab-conf b { position: relative; font-size: 9.5px; font-weight: 600; padding-left: 5px; color: var(--fg); }
.tab-conf.hi i { background: var(--ok-bg); }
.tab-conf.mid i { background: var(--warn-bg); }
.tab-conf.lo { width: auto; padding: 0 6px; color: var(--bad); background: var(--bad-bg); font-size: 9.5px; }
.tab-conf.lo i { background: var(--bad-bg); }
.tab-warn { color: var(--warn); font-weight: 600; text-transform: uppercase; font-size: 9px; letter-spacing: .05em; }
.tab-pb { font-size: 9.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--card); border: 1px solid currentColor; }
.tab-why { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--card); font-size: 10px; cursor: pointer; color: var(--muted-fg); line-height: 1; }
.tab-why:hover { background: var(--primary-50); color: var(--primary); }
.tab-cell.is-diff { background: var(--warn-bg); box-shadow: inset 3px 0 0 var(--warn); }
.tab-cell.pb-preferred { background: var(--ok-bg); color: var(--ok); }
.tab-cell.pb-fallback { background: var(--warn-bg); color: var(--warn); }
.tab-cell.pb-walkaway { background: var(--bad-bg); color: var(--bad); }
.tab-cell.pb-off { outline: 1px dashed var(--border-strong); outline-offset: -3px; }
.tab-cell[class*="pb-"] .tab-val { color: var(--fg); }
.tab-cell.is-flag::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.tab-cell.is-sel { outline: 2px solid var(--primary); outline-offset: -2px; z-index: 1; }
.tab-row.is-selrow .tab-cell.tab-first { background: var(--primary-50); }
.is-pending { gap: 8px; justify-content: center; }
.tab-shimmer { display: block; height: 10px; border-radius: 5px; width: 85%; background: linear-gradient(90deg, var(--muted) 25%, var(--primary-50) 50%, var(--muted) 75%); background-size: 200% 100%; animation: tab-sh 1.1s linear infinite; }
.tab-shimmer.short { width: 45%; }
@keyframes tab-sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .tab-shimmer { animation: none; } }

.tab-rowtitle { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; font-weight: 600; }
.tab-rt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-type, .tab-num { font-family: var(--font-mono); font-size: 10.5px; color: var(--primary); flex: none; }
.tab-rowacts { display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.tab-status { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 999px; background: var(--muted); color: var(--muted-fg); margin-right: 2px; }
.tab-status.st-signed { background: var(--ok-bg); color: var(--ok); }
.tab-status.st-review { background: var(--warn-bg); color: var(--warn); }
.tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.tab-dot.s-edited { background: var(--st-edited); } .tab-dot.s-pending { background: var(--st-pending); }
.tab-dot.s-flagged, .tab-dot.s-conflict { background: var(--st-flagged); } .tab-dot.s-comment { background: var(--st-comment); }

.tab-pop { position: absolute; top: calc(100% - 4px); left: 8px; z-index: 30; width: 270px; max-width: 80vw; background: var(--card); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 12px; cursor: default; font-weight: 400; }
.tab-pop.up { top: auto; bottom: calc(100% - 4px); }
.tab-pop p { margin: 4px 0; color: var(--muted-fg); }
.tab-pop .tab-src { font-family: var(--font-mono); font-size: 10.5px; }
.tab-pop blockquote, .tab-snip { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--primary-100); background: var(--primary-50); font-size: 12px; line-height: 1.45; border-radius: 0 6px 6px 0; }

.tab-detail { width: 340px; flex: none; overflow: auto; background: var(--card); border-left: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.tab-dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tab-dcol { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); font-weight: 600; }
.tab-drow { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.tab-dval { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.tab-dval.is-miss { color: var(--faint); }
.tab-dconf { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted-fg); }
.tab-dconf .tab-conf { width: 120px; }
.tab-detail h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-fg); margin: 4px 0 0; }
.tab-dhow { font-size: 12.5px; color: var(--muted-fg); margin: 0; }
.tab-dpb { padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.tab-dpb small { color: var(--muted-fg); }
.tab-dpb.pb-preferred { background: var(--ok-bg); } .tab-dpb.pb-fallback { background: var(--warn-bg); } .tab-dpb.pb-walkaway { background: var(--bad-bg); } .tab-dpb.pb-off { background: var(--muted); }
.tab-full { font-size: 12px; } .tab-full summary { cursor: pointer; color: var(--primary); } .tab-full p { color: var(--muted-fg); line-height: 1.5; }
.tab-dacts { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }

.tab-empty { margin: auto; max-width: 480px; }
.tab-empty-ic .icon { width: 36px; height: 36px; stroke: var(--primary); fill: none; }
.tab-empty h3 { font-size: 16px; color: var(--fg); margin: 8px 0; }
.tab-empty-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.tab-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab-note { margin: 0; padding: 6px 16px; font-size: 11px; color: var(--faint); border-top: 1px solid var(--border); background: var(--card); }

@media (max-width: 900px) {
  .tab-view { flex: none; }
  .tab-main { flex-direction: column; }
  .tab-scroll { flex: none; height: 68vh; max-height: 68vh; }
  .tab-detail { width: auto; max-height: none; border-left: 0; border-top: 1px solid var(--border); }
  .tab-toolbar { padding: 8px 12px; flex-wrap: nowrap; overflow-x: auto; }
  .tab-toolbar > * { flex: none; }
  .tab-grid { --first: 150px; --colw: 180px; }
  .tab-scroll { scroll-padding-left: 150px; }
  .tab-rowacts .btn:nth-child(3) { display: none; }
  .tab-note { display: none; }
}
