/* Diamond Testing Bench. One bench on the always-black stage, in the manner of the gem tools: the tests in one glass
   panel on top (two named groups of pills), the three stones side by side under it, each with its name and its
   reading, then the note of the test (what it is, what it tells you), the lamp of the short-wave test, and Reset
   and Copy link. From 760px the three stones sit in one row, sized to the window height (--rest is everything else)
   so the bench stays in view while you change tests. Below 760px each stone sits beside its reading, one under
   another. Color appears only in the stones and the spectra, where it is light. The table and the disclaimer under
   the bench follow the theme. */

.wrap.page-hero.tb-hero{padding-top:28px;padding-bottom:22px}

/* ---------- the bench ---------- */
.tb-bench{padding:6px 0 26px;color-scheme:dark}
.tb :focus-visible{outline:2px solid currentColor;outline-offset:2px}
.tb-bench :focus-visible{outline:2px solid #fff;outline-offset:2px;box-shadow:0 0 0 5px #000}
.tb-grid{--rest:470px;display:grid;grid-template-columns:minmax(0,1fr);gap:14px;justify-items:center}
.tb-grid>*{min-width:0;width:100%}

/* ---------- the tests ---------- */
.tb-tests{border-radius:var(--r-panel);padding:12px 16px 14px;margin:0;display:grid;grid-template-columns:auto auto;
  justify-content:center;gap:10px 28px;max-width:1100px}
.tb-tests>*{position:relative}
.tb-group{border:0;margin:0;padding:0;min-width:0}
.tb-group legend{padding:0 0 7px;font-size:.875rem;font-weight:560;color:#fff}
.tb-pills{display:flex;flex-wrap:wrap;gap:6px}
.tb-pill{position:relative;cursor:pointer}
.tb-pill input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.tb-pill span{display:inline-flex;align-items:center;min-height:44px;padding:8px 15px;border-radius:var(--r-pill);
  border:1px solid rgba(255,255,255,.42);background:rgba(0,0,0,.35);color:#fff;font-size:.875rem;font-weight:550;
  white-space:nowrap;transition:background .15s,color .15s,border-color .15s}
.tb-pill:hover span{background:rgba(255,255,255,.14)}
.tb-pill input:checked+span{background:#fff;color:#000;border-color:#fff}
.tb-pill input:focus-visible+span{outline:2px solid #fff;outline-offset:2px;box-shadow:0 0 0 5px #000}

/* ---------- the stones ---------- */
.tb-stones{display:grid;gap:12px 16px;justify-content:center;
  grid-template-columns:repeat(3,min(calc((100% - 32px) / 3),max(200px,calc(100vh - var(--rest)))));
  grid-template-columns:repeat(3,min(calc((100% - 32px) / 3),max(200px,calc(100svh - var(--rest)))))}
.tb-stone{margin:0;min-width:0}
.tb-stage{position:relative;aspect-ratio:1;width:100%;background:#000;border:1px solid rgba(255,255,255,.14);border-radius:var(--r-panel);overflow:hidden}
.tb-cv,.tb-chart{position:absolute;inset:0;width:100%;height:100%;display:block}
.tb-cv{transition:transform .9s cubic-bezier(.3,.7,.3,1),clip-path .3s}
.tb-chart{display:none;font-family:inherit}
.tb-bench[data-mode="chart"] .tb-chart{display:block}
.tb-bench[data-mode="chart"] .tb-cv{visibility:hidden}
/* the loupe: a round field, like the lens */
.tb-bench[data-mode="loupe"] .tb-cv{clip-path:circle(46% at 50% 50%)}
.tb-bench[data-mode="loupe"] .tb-stage::after{content:"";position:absolute;inset:4%;border-radius:50%;border:1px solid rgba(255,255,255,.3);pointer-events:none}

/* a result on the stone itself (thermal pen, magnet, screening device) */
.tb-badge{display:none;position:absolute;left:50%;bottom:8%;transform:translateX(-50%);padding:6px 15px;border-radius:var(--r-pill);
  background:#F3F3F3;color:#121212;font-size:.875rem;font-weight:620;white-space:nowrap;box-shadow:0 2px 10px rgba(0,0,0,.5)}
.tb-bench[data-badge="thermal"] .tb-badge,.tb-bench[data-badge="screen"] .tb-badge,.tb-bench[data-badge="magnet"] .tb-badge{display:block}
/* the magnet at each stone's right; the HPHT stone moves toward it */
.tb-magnet{display:none;position:absolute;right:4%;top:36%;width:7%;height:28%;border-radius:6px;background:#5E5E5E;box-shadow:inset 0 0 0 1px rgba(255,255,255,.35)}
.tb-bench[data-badge="magnet"] .tb-magnet{display:block}
.tb-bench[data-badge="magnet"] #tb-fig-h .tb-cv{transform:translateX(7%) rotate(4deg)}
/* the girdle under magnification: the stone smaller, its girdle band under it */
.tb-girdle{display:none;position:absolute;left:6%;right:6%;bottom:9%;height:15%;border-radius:4px;
  background:linear-gradient(#3a3a3a,#2a2a2a 45%,#1d1d1d);box-shadow:inset 0 1px 0 rgba(255,255,255,.18),inset 0 -1px 0 rgba(0,0,0,.6);
  color:#E6E6E6;font-size:.6875rem;font-weight:500;letter-spacing:.12em;text-align:center;line-height:1;
  align-items:center;justify-content:center;white-space:nowrap;overflow:hidden}
.tb-bench[data-badge="girdle"] .tb-girdle{display:flex}
.tb-bench[data-badge="girdle"] .tb-cv{transform:translateY(-10%) scale(.68)}

/* without WebGL2: a short message in place of the stone (the spectra still draw) */
.tb-nogl-msg{display:none;position:absolute;inset:0;margin:0;place-items:center;padding:12px;text-align:center;font-size:.8125rem;color:#C9C9C9}
.tb-nogl .tb-nogl-msg{display:grid}
.tb-nogl[data-mode="chart"] .tb-nogl-msg{display:none}

/* the name and the reading under each stone */
.tb-cap{display:flex;flex-direction:column;gap:4px;margin:10px 4px 0;font-size:.8125rem;line-height:1.4;color:#A3A3A3}
.tb-name b{color:#fff;font-weight:600;font-size:.875rem}
.tb-name span{display:block}
.tb-read{color:#fff;font-size:.9375rem;font-weight:560;line-height:1.35;min-height:2.7em}

/* spectra */
.tb-ch-title{fill:#fff;font-size:12px;font-weight:620}
.tb-ch-axis{stroke:#8C8C8C;stroke-width:1}
.tb-ch-tick,.tb-ch-name,.tb-ch-note{fill:#C9C9C9;font-size:10px;text-anchor:middle}
.tb-ch-line{fill:none;stroke:#fff;stroke-width:1.4;stroke-linejoin:round}
.tb-ch-peak{fill:#fff;font-size:10.5px;font-weight:600;text-anchor:middle;paint-order:stroke;stroke:#000;stroke-width:3px;stroke-linejoin:round}

/* ---------- under the stones ---------- */
.tb-under{display:flex;flex-direction:column;align-items:center;gap:12px}
.tb-note{max-width:84ch;text-align:center}
.tb-note-h{margin:0 0 4px;font-size:1rem;font-weight:600;letter-spacing:-.005em;color:#fff}
.tb-note p{margin:0;font-size:.875rem;line-height:1.5;color:#C9C9C9}
.tb-note .tb-tells{margin-top:4px;color:#E6E6E6}
.tb-lamp{display:flex;align-items:center;gap:10px 12px;flex-wrap:wrap;justify-content:center}
.tb-lamp[hidden]{display:none}
.tb-opt-l{font-size:.875rem;font-weight:560;color:#fff}
.tb-seg{margin-left:0;background:#111;border-color:rgba(255,255,255,.14)}
.tb-seg button{min-height:36px;padding:7px 16px}
.tb-seg .thumb{opacity:0}
.tb-seg.ready .thumb{opacity:1}
.tb-seg:not(.ready) button[aria-pressed="true"]{background:#fff;color:#000}   /* until the thumb is placed */
.tb-lamp-time{font-size:.8125rem;color:#C9C9C9;min-width:17ch}
.tb-acts{position:relative;display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:center}
.tb-sm{padding:9px 16px;min-height:44px;font-size:.875rem}
.tb-status{font-size:.8125rem;color:#C9C9C9;margin:0;overflow-wrap:anywhere}
.tb-status:empty{position:absolute}
.tb-noscript{color:#fff;font-size:.875rem;margin:0;text-align:center}

/* ---------- below the bench: follows the theme ---------- */
.tb-after{padding-top:30px;padding-bottom:72px}
.tb-after h2{font-size:1.25rem;line-height:1.25;font-weight:600;letter-spacing:-.01em;margin:0 0 4px}
.tb-tw table{min-width:860px}
.tb-tw th[scope=row]{font-weight:600;background:none}
.tb-tw th[scope=row] a{color:inherit}
.tb-tw tr.tb-grp th{font-size:.8125rem;font-weight:600;color:var(--muted);background:var(--surface)}
.tb-tw tr:last-child th{border-bottom:0}
.tb-tw tr.tb-on th,.tb-tw tr.tb-on td{background:var(--surface)}
.tb-shown{font-weight:400;color:var(--muted);white-space:nowrap}
.tb-off{display:block;margin-top:4px;color:var(--muted)}
.tb-disclaimer{font-size:.8125rem;line-height:1.45;color:var(--muted);max-width:80ch}

/* ---------- breakpoints ---------- */
@media (max-width:1099.98px){
  .tb-tests{grid-template-columns:minmax(0,1fr);justify-items:center;gap:10px}
  .tb-group legend{text-align:center;width:100%}
  .tb-pills{justify-content:center}
  .tb-grid{--rest:560px}
}
/* below 760px: each stone beside its reading, one under another */
@media (max-width:759.98px){
  .tb-grid{gap:14px}
  .tb-tests{padding:12px 12px 14px}
  .tb-pill span{padding:8px 13px}
  .tb-stones{grid-template-columns:minmax(0,1fr);gap:12px}
  .tb-stone{display:grid;grid-template-columns:minmax(120px,44%) minmax(0,1fr);gap:14px;align-items:center}
  .tb-stage{border-radius:var(--r-inner)}
  .tb-cap{margin:0}
  .tb-read{min-height:0}
  .tb-girdle{font-size:.5rem;letter-spacing:.06em}
  .tb-badge{font-size:.75rem;padding:4px 10px}
}
@media (max-width:899.98px){
  /* the table as one card a test: each reading under its stone's name, so nothing scrolls sideways */
  .tb-tw{overflow:visible;border:0;border-radius:0}
  .tb-tw table{min-width:0;display:block}
  .tb-tw thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .tb-tw tbody{display:block}
  .tb-tw tr{display:block;border:1px solid var(--line);border-radius:var(--r-inner);margin:0 0 10px;overflow:hidden}
  .tb-tw tr.tb-grp{border:0;border-radius:0;margin:18px 0 8px}
  .tb-tw tr.tb-grp th{background:none;padding:0;font-size:.875rem}
  .tb-tw th,.tb-tw td{display:block;padding:8px 12px;border-bottom:0}
  .tb-tw th[scope=row]{padding-top:12px;font-size:1rem}
  .tb-tw td:last-child{padding-bottom:12px}
  .tb-tw td::before{content:attr(data-label);display:block;font-size:.75rem;font-weight:600;color:var(--muted)}
}
@media (max-width:339.98px){
  .tb-stone{grid-template-columns:minmax(0,1fr);gap:8px}
  .tb-stage{max-width:260px;margin:0 auto}
}
@media (prefers-reduced-motion:reduce){
  .tb *,.tb *::before,.tb *::after{transition-duration:0s!important;animation-duration:0s!important}
}
@media (forced-colors:active){
  .tb-stage{forced-color-adjust:none;background:#000;border-color:CanvasText}
  .tb-tests{border:1px solid CanvasText}
  .tb-pill span{border-color:ButtonText}
  .tb-pill input:checked+span{background:Highlight;color:HighlightText;border-color:Highlight;forced-color-adjust:none}
  .tb-sm{border:1px solid ButtonText}
}
