/* TOPHIVE Design Lab / Benchmarks
   Canonical, viewport-constrained evidence comparison workspace.
   No dashboard KPI cards or fabricated A/B outcomes. */
:root {
  --bm-canvas:#f7f8f4;
  --bm-white:#fff;
  --bm-ink:#1d2721;
  --bm-muted:#758779;
  --bm-green:#315e44;
  --bm-line:#d9e4da;
  --bm-soft-line:#e8efe8;
  --bm-soft:#f3f7f2;
}
* {box-sizing:border-box}
body {margin:0;background:var(--bm-canvas);color:var(--bm-ink);font:14px/1.5 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input {font:inherit}
button {cursor:pointer}
button:focus-visible,a:focus-visible,input:focus-visible,[tabindex="0"]:focus-visible,summary:focus-visible {
  outline:2px solid #478566;outline-offset:2px;
}
[hidden] {display:none!important}
.bm-sr-only {position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.lab-benchmark-page > main.shell.benchmark-workspace-page,
main.shell.benchmark-workspace-page {
  width:100%;
  max-width:1240px;
  min-height:560px;
  height:calc(100dvh - 69px);
  display:flex;
  flex-direction:column;
  padding:0 18px 14px;
  margin:0 auto;
  background:transparent;
  color:var(--bm-ink);
}
body:not(.lab-benchmark-page) main.shell.benchmark-workspace-page {height:100dvh}
.benchmark-workspace-page > section + section {border-top:0}

/* A single workspace identity and a quiet, explicit evidence warning. */
.benchmark-workspace-page .bm-worktop {
  height:60px;
  min-height:60px;
  flex:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border-bottom:1px solid var(--bm-line);
}
.benchmark-workspace-page .bm-worktop h1 {
  margin:0;
  color:var(--bm-ink);
  font-size:24px;
  font-weight:770;
  letter-spacing:-.057em;
  line-height:1.14;
}
.bm-worktop h1 span {color:#8ba995}
.bm-worktop-right {display:flex;align-items:center;gap:22px;white-space:nowrap}
.bm-header-evidence {display:inline-flex;align-items:center;gap:7px;color:#6b7c70;font:650 11px ui-monospace,Menlo,monospace}
.bm-live-dot,.bm-green-dot {display:inline-block;flex:none;width:7px;height:7px;background:#83a78b;border-radius:50%}
.bm-return {display:flex;align-items:center;gap:8px;color:#718574;font-size:12px;font-weight:670;text-decoration:none}
.bm-return:hover {color:#366949}

/* Compact, canvas-style controls rather than padded dashboard pills. */
.bm-toolbar {
  position:relative;
  z-index:20;
  flex:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 0;
  border:0;
}
.bm-toolbar-left {display:flex;align-items:center;gap:8px;min-width:0;flex:1}
.bm-search {
  width:258px;
  max-width:100%;
  height:39px;
  display:flex;align-items:center;gap:9px;
  padding:0 11px;border:1px solid #d5e2d7;border-radius:8px;
  background:#fff;transition:border-color .15s,box-shadow .15s;
}
.bm-search:hover {border-color:#b6cbb9}
.bm-search:focus-within {border-color:#76a487;box-shadow:0 0 0 3px #e7f3e8}
.bm-search svg,.bm-filter-trigger svg,.bm-export svg {
  width:16px;height:16px;flex:none;fill:none;stroke:currentColor;
  stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}
.bm-search svg {color:#849a88}
.bm-search input {min-width:0;width:100%;flex:1;height:100%;border:0;outline:0;background:transparent;color:#27402f;font-size:12px}
.bm-search input:focus-visible {outline:none}
.bm-search input::placeholder {color:#92a096}
.bm-search kbd {flex:none;border:1px solid #dbe5dc;border-radius:4px;padding:1px 6px;color:#849887;font:11px ui-monospace,Menlo,monospace}
.bm-filter {position:relative;flex:none}
.bm-filter-trigger,.bm-export {
  height:39px;display:flex;align-items:center;justify-content:center;gap:8px;
  padding:0 11px;border:1px solid #d4e1d5;border-radius:8px;
  background:#fff;color:#566e5d;font-size:12px;font-weight:680;white-space:nowrap;
  transition:border-color .16s,background .16s,color .16s;
}
.bm-filter-trigger:hover,.bm-filter-trigger[aria-expanded="true"] {background:#f1f7f1;border-color:#a4c1ac;color:#315f43}
.bm-filter-trigger .bm-chevron {width:12px;height:12px;opacity:.7}
.bm-filter-dot {width:6px;height:6px;border-radius:50%;background:#5b9b70}
.bm-export {background:#243d30;border-color:#243d30;color:#fff;flex:none;padding:0 14px}
.bm-export:hover {background:#355a44;border-color:#355a44}
.bm-export svg {width:15px;height:15px}
.bm-clear {padding:5px;border:0;background:transparent;color:#48745a;white-space:nowrap;font-size:11px;font-weight:700}
.bm-clear:hover {text-decoration:underline;text-underline-offset:3px}
.bm-popover {
  position:absolute;top:calc(100% + 7px);left:0;z-index:90;
  width:248px;max-width:calc(100vw - 28px);padding:8px;
  background:#fff;border:1px solid #d7e3d9;border-radius:11px;
  box-shadow:0 15px 38px rgba(27,53,37,.14);
}
.bm-evidence-popover {width:285px}
.bm-popover-title {padding:8px 9px 11px;color:#83998a;font:760 10px ui-monospace,Menlo,monospace;text-transform:uppercase;letter-spacing:.09em}
.bm-options {display:grid;gap:2px;max-height:min(55dvh,320px);overflow:auto}
.bm-option {
  width:100%;min-height:36px;display:flex;align-items:center;gap:9px;
  padding:8px 10px;border:0;border-radius:7px;background:transparent;
  color:#415e4b;text-align:left;font-size:12px;font-weight:580;
}
.bm-option:hover {background:#f1f6f1}
.bm-option[aria-pressed="true"] {background:#eaf3eb;color:#285c40;font-weight:750}
.bm-option-meta {margin-left:auto;font:10px ui-monospace,Menlo,monospace;color:#90a395}
.bm-check {min-width:12px;color:#338154;text-align:right}

/* Inline master–detail workspace. No backdrop, overlay, or focus trap:
   opening the Inspector allocates a neighboring column, closing restores
   100% of the available data-grid width. */
.benchmark-workspace-page .bm-workspace {
  flex:1 1 auto;
  min-height:0;
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) 0px;
  column-gap:0;
  padding:0;
  transition:grid-template-columns .26s cubic-bezier(.2,.85,.25,1),
    column-gap .26s cubic-bezier(.2,.85,.25,1);
}
.benchmark-workspace-page .bm-workspace.has-inspector {
  grid-template-columns:minmax(0,1fr) 326px;
  column-gap:12px;
}
.bm-table-panel,.bm-inspector {
  min-width:0;min-height:0;height:100%;
  background:var(--bm-white);
  border:1px solid #d9e3d9;
  border-radius:10px;
  box-shadow:none;
  overflow:hidden;
}
.bm-table-panel {display:flex;flex-direction:column}
.bm-table-head {
  height:48px;flex:none;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:0 16px;border-bottom:1px solid var(--bm-soft-line);
}
.bm-table-heading {display:flex;align-items:center;gap:8px;font-size:13px;font-weight:780;letter-spacing:-.014em}
.bm-count {padding:2px 6px;border:1px solid #d9e7da;border-radius:5px;color:#60876b;font:700 10px ui-monospace,Menlo,monospace}
.bm-reviewed-stat {color:#839789;font:10px ui-monospace,Menlo,monospace;white-space:nowrap}
.bm-table-scroll {min-height:0;min-width:0;flex:1 1 auto;overflow:auto;scrollbar-width:thin;scrollbar-color:#cbd9ce transparent;overscroll-behavior:contain}
.benchmark-workspace-page table {width:100%;min-width:840px;table-layout:fixed;border-collapse:separate;border-spacing:0;text-align:left}
.benchmark-workspace-page th {
  position:sticky;top:0;z-index:3;height:39px;
  padding:0 11px;border-bottom:1px solid #e0e8e1;
  background:#f4f7f3;color:#819285;text-align:left;
  font:750 9px/1.3 ui-monospace,Menlo,monospace;text-transform:uppercase;letter-spacing:.075em;
}
.benchmark-workspace-page th.bm-col-select {width:38px}
.benchmark-workspace-page th.bm-col-template {width:22%}
.benchmark-workspace-page th.bm-col-on {width:23%}
.benchmark-workspace-page th.bm-col-off {width:23%}
.benchmark-workspace-page th.bm-col-verdict {width:17%}
.benchmark-workspace-page th.bm-col-evidence {width:15%}
.benchmark-workspace-page td {
  height:76px;padding:11px;border-bottom:1px solid #edf1ec;
  color:#586f60;font-size:11.5px;line-height:1.46;vertical-align:middle;
  overflow-wrap:break-word;
}
.benchmark-workspace-page tbody tr {cursor:pointer;transition:background .14s}
.benchmark-workspace-page tbody tr:hover {background:#f7faf7}
.benchmark-workspace-page tbody tr.selected {background:#ebf3ec}
.benchmark-workspace-page tbody tr.selected td:first-child {box-shadow:inset 3px 0 #5a9770}
.benchmark-workspace-page tbody tr:last-child td {border-bottom:0}
.bm-pick {
  width:22px;height:22px;display:grid;place-items:center;
  border:1px solid #d6e2d7;border-radius:5px;
  background:#fff;color:#7c9585;font-size:13px;
}
.benchmark-workspace-page tbody tr.selected .bm-pick {background:#3c7754;color:#fff;border-color:#3c7754}
.bm-name {display:block;font-size:12.5px;line-height:1.27;font-weight:760;letter-spacing:-.02em;color:#233128}
.bm-version {display:inline-block;margin-top:7px;color:#8ea291;font:10px ui-monospace,Menlo,monospace}
.bm-verdict {
  display:inline-flex;align-items:center;gap:6px;padding:5px 7px;
  border:1px solid #e1e9e1;border-radius:5px;background:#eef1ee;
  color:#677d6c;font:700 10px/1.15 ui-monospace,Menlo,monospace;white-space:nowrap;
}
.bm-verdict::before {content:"";width:5px;height:5px;border-radius:50%;background:#b6c6b8;flex:none}
.bm-verdict.off {color:#986342;background:#fbefe8;border-color:#f2e0d4}
.bm-verdict.off::before {background:#cf8c63}
.bm-verdict.mixed {color:#685c9c;background:#f1edfc;border-color:#e7e1f9}
.bm-verdict.mixed::before {background:#a294d1}
.bm-verdict.on {color:#2c7a4e;background:#e8f4ea;border-color:#d7e9db}
.bm-verdict.on::before {background:#6ba981}
.bm-evidence-label {color:#718677;font-size:11px}
.bm-table-foot {
  height:39px;flex:none;display:flex;align-items:center;justify-content:space-between;
  gap:12px;padding:0 14px;border-top:1px solid #e6eee7;
  color:#8a9c8c;font:10px ui-monospace,Menlo,monospace;
}
.bm-empty {padding:64px 15px;text-align:center;color:#849687}
.bm-empty strong {display:block;color:#2c4435;font-size:15px}
.bm-empty p {margin:7px 0 14px;font-size:12px}
.bm-secondary {padding:8px 12px;border:1px solid #d6e4d8;border-radius:7px;background:#fff;color:#356348;font-size:12px;font-weight:650}

/* Read-only evidence Inspector. No success coloring for unverified outcomes. */
.benchmark-workspace-page .bm-inspector {
  width:100%;
  height:100%;
  min-width:0;
  display:flex;
  flex-direction:column;
  visibility:hidden;
  opacity:0;
  pointer-events:none;
  transform:translateX(12px);
  transition:opacity .2s ease,transform .26s ease,visibility .26s;
}
.benchmark-workspace-page .bm-inspector.is-open {
  visibility:visible;
  opacity:1;
  pointer-events:auto;
  transform:translateX(0);
}
.bm-inspector-head {
  height:58px;flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:0 16px;border-bottom:1px solid var(--bm-soft-line);
}
.bm-inspector-head strong {display:block;font-size:12px;font-weight:790}
.bm-inspector-head small {display:block;margin-top:2px;font-size:10px;color:#8c9a8e}
.bm-icon-button {
  width:32px;
  height:32px;
  flex:0 0 32px;
  display:grid;
  place-items:center;
  padding:0;
  line-height:0;
  border:1px solid #d9e5da;
  border-radius:8px;
  background:#fff;
  color:#63806b;
}
.bm-icon-button svg {
  display:block;
  width:17px;
  height:17px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.bm-icon-button:hover {background:#f0f7f0;border-color:#b4cbb8;color:#315d43}
.bm-inspector-scroll {min-height:0;flex:1 1 auto;overflow:auto;scrollbar-width:thin;scrollbar-color:#cbd8ce transparent;overscroll-behavior:contain}
.bm-inspector-content {padding:16px}
.bm-inspector-meta {display:flex;align-items:center;justify-content:space-between;gap:7px}
.bm-inspector-meta>span:first-child {font:700 10px ui-monospace,Menlo,monospace;color:#8da18f}
.bm-inspector-content h2 {margin:13px 0 0;font-size:25px;line-height:1.11;letter-spacing:-.06em;font-weight:780;overflow-wrap:anywhere}
.bm-inspector-content .bm-version {margin-top:8px}
.bm-detail-list {margin:17px 0 0}
.bm-detail-list>div {padding:13px 0;border-top:1px solid #ecf1ec}
.bm-detail-list dt {font:760 9px/1.4 ui-monospace,Menlo,monospace;color:#91a092;letter-spacing:.08em;text-transform:uppercase}
.bm-detail-list dd {margin:6px 0 0;color:#3a5a45;font-size:12px;line-height:1.5}
.bm-evidence-context {margin-top:10px;padding:13px 14px;background:#f1f6f1;border-radius:8px}
.bm-context-label {display:block;color:#74907b;font:750 9px ui-monospace,Menlo,monospace;text-transform:uppercase;letter-spacing:.08em}
.bm-evidence-context p {margin:7px 0 0;color:#586e5d;font-size:11px;line-height:1.5}
.bm-copy {width:100%;height:36px;display:flex;align-items:center;justify-content:center;gap:7px;margin-top:12px;border:1px solid #d2e0d4;border-radius:7px;background:#fff;color:#40634b;font-size:11px;font-weight:730}
.bm-copy:hover {background:#f1f7f2}
.bm-method {margin:4px 16px 18px;border-top:1px solid #e5ebe5;padding:10px 0 0}
.bm-method summary {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 0;cursor:pointer;font-size:11px;font-weight:740;color:#4e7057;list-style:none}
.bm-method summary::-webkit-details-marker {display:none}
.bm-method summary span {font-size:16px;color:#8ba892;font-weight:400}
.bm-method[open] summary span {transform:rotate(45deg)}
.bm-method p {margin:7px 0 0;color:#748577;font-size:11px;line-height:1.65}
.bm-inspector-empty {padding:65px 18px 30px;text-align:center}
.bm-inspector-empty strong {font-size:15px}
.bm-inspector-empty p {font-size:12px;color:#8a9a8e}
.bm-toast {position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:130;padding:10px 15px;border-radius:8px;background:#243d30;color:#fff;font-size:12px;box-shadow:0 8px 23px #173e271f}

/* Narrow viewports cannot support a useful side-by-side data grid and a
   326px Inspector. Stack the Inspector below the table without a modal. */
@media(max-width:960px){
  .lab-benchmark-page > main.shell.benchmark-workspace-page,
  main.shell.benchmark-workspace-page {
    height:auto;
    min-height:calc(100dvh - 69px);
  }
  .benchmark-workspace-page .bm-workspace,
  .benchmark-workspace-page .bm-workspace.has-inspector {
    display:flex;
    flex-direction:column;
    flex:0 0 auto;
    height:auto;
    min-height:0;
    column-gap:0;
  }
  .benchmark-workspace-page .bm-table-panel {
    flex:none;
    height:clamp(360px,66dvh,600px);
  }
  .benchmark-workspace-page .bm-inspector {
    flex:none;
    width:100%;
    height:0;
    max-height:0;
    margin:0;
    border-width:0;
    overflow:hidden;
    transform:translateY(8px);
    transition:height .26s cubic-bezier(.2,.85,.25,1),
      opacity .2s ease,margin .26s ease,transform .26s ease,visibility .26s;
  }
  .benchmark-workspace-page .bm-inspector.is-open {
    height:min(68dvh,600px);
    max-height:600px;
    margin-top:12px;
    border-width:1px;
    transform:translateY(0);
  }
}
@media(max-width:730px){
  .lab-benchmark-page > main.shell.benchmark-workspace-page,
  main.shell.benchmark-workspace-page {height:auto;min-height:calc(100dvh - 69px);padding:0 12px 22px}
  .benchmark-workspace-page .bm-worktop {height:56px;min-height:56px}
  .benchmark-workspace-page .bm-worktop h1 {font-size:21px}
  .bm-header-evidence {display:none}
  .bm-return {font-size:11px}
  .bm-toolbar {position:relative;flex-wrap:wrap;padding:11px 0;gap:8px}
  .bm-toolbar-left {width:100%;flex:0 0 100%;flex-wrap:wrap;gap:7px}
  .bm-search {height:36px;width:calc(100% - 47px);flex:0 0 calc(100% - 47px)}
  .bm-filter-trigger {height:36px}
  .bm-export {position:absolute;top:11px;right:0;width:39px;height:36px;padding:0}
  .bm-export span {display:none}
  .benchmark-workspace-page .bm-workspace {height:auto;min-height:0}
  .bm-table-head {height:44px}
  .bm-reviewed-stat {font-size:9px}
  .bm-table-foot {height:36px}
}
@media(max-width:390px){
  .bm-reviewed-stat {display:none}
  .bm-filter-trigger {max-width:151px}
  #verdict-current,#evidence-current {display:block;max-width:106px;overflow:hidden;text-overflow:ellipsis}
}
@media(prefers-reduced-motion:reduce){
  .benchmark-workspace-page *, .benchmark-workspace-page *::before,
  .benchmark-workspace-page *::after {transition:none!important;animation:none!important}
}
