.attention-lab {
  --lab-ink: #30243a;
  --lab-muted: #6b566f;
  --lab-rule: #d9c7dd;
  --lab-paper: #fbf7fa;
  --lab-panel: #2b2133;
  --lab-serif: Georgia, "Times New Roman", serif;
  --lab-mono: "IBM Plex Mono", Consolas, monospace;
  background: #f7f2f6;
  color: var(--lab-ink);
}

.lab-skip {
  position: fixed;
  z-index: 4000;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  background: #fff;
  color: var(--lab-ink);
  transform: translateY(-200%);
}

.lab-skip:focus { transform: translateY(0); }

.lab-main {
  width: min(1250px, calc(100% - 48px));
  margin: clamp(105px, 8.5vw, 134px) auto 82px;
}

.lab-intro { max-width: 1050px; margin-bottom: clamp(24px, 4vw, 42px); }

.lab-intro .lab-path {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
  color: var(--lab-muted);
  font: .72rem/1.4 var(--lab-mono);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.lab-main a { color: inherit; text-decoration: underline; text-underline-offset: .25em; }
.lab-main a:hover { text-decoration-thickness: 2px; }

.lab-intro h1 {
  margin: 0;
  color: var(--lab-ink);
  font: 400 clamp(3rem, 7.3vw, 6.1rem)/.98 var(--lab-serif);
  letter-spacing: -.065em;
}

.lab-intro h1 em { color: #795885; font-weight: 400; }
.lab-intro > p:last-child {
  width: min(49ch, 100%);
  margin: 18px 0 0;
  color: var(--lab-muted);
  font-size: clamp(1rem, 2.2vw, 1.17rem);
  line-height: 1.65;
}

.lab-workbench[hidden],
.lab-share-fallback[hidden] { display: none; }

.lab-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr);
  border: 1px solid #4b3755;
  background: var(--lab-paper);
  box-shadow: 0 14px 40px #4925530a;
}

.lab-observation {
  min-width: 0;
  margin: 0;
  padding: clamp(15px, 2.4vw, 32px);
  background: var(--lab-panel);
  color: #fff3fa;
}

.lab-observation-head,
.lab-observation-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 17px;
}

.lab-observation-head { margin-bottom: 14px; }
.lab-observation-head h2 { color: #fff3fa; font: 400 clamp(1.24rem, 2.4vw, 1.85rem)/1.15 var(--lab-serif); }
.lab-observation-head a { color: #f6dcee; font-size: .78rem; white-space: nowrap; }

.lab-stage {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #ac89aa;
  padding: 0;
  background: #58444c;
  cursor: crosshair;
}

.lab-stage img,
.lab-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.lab-stage img { object-fit: cover; object-position: center 75%; }
.lab-cursor {
  display: none;
  position: absolute;
  left: var(--point-x, 50%);
  top: var(--point-y, 50%);
  translate: -50% -50%;
  width: 18px;
  height: 18px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #352640;
  pointer-events: none;
}

.lab-stage:focus-visible .lab-cursor { display: block; }
.lab-observation-foot { align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.lab-point-info { flex: 1 1 225px; color: #edcfe5; font-size: .8rem; line-height: 1.6; }
.lab-point-info p { margin: 0; font: inherit; }
.lab-point-info #lab-point-count { color: #edcbe4; font: .73rem/1.5 var(--lab-mono); }

.lab-point-actions,
.lab-tool-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.lab-point-actions button,
.lab-weight-heading button,
.lab-tool-actions button {
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--lab-rule);
  border-radius: 3px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: .79rem;
}

.lab-point-actions button { border-color: #8b7296; }
.lab-point-actions button:enabled:hover { background: #51385c; }
.lab-weight-heading button:hover,
.lab-tool-actions button:enabled:hover { background: #eadeef; }
.lab-point-actions button:disabled { opacity: .55; cursor: default; }

.lab-controls { min-width: 0; padding: clamp(18px, 3.2vw, 40px); }
.lab-control-head { margin-top: 13px; }
.lab-control-head label,
.lab-control-slider label { display: block; font-size: .92rem; font-weight: 650; }

.lab-control-head select {
  width: 100%;
  min-height: 44px;
  padding: 7px 30px 7px 10px;
  margin-top: 7px;
  border: 1px solid var(--lab-rule);
  border-radius: 3px;
  color: var(--lab-ink);
  background: #fffafc;
  font: inherit;
  font-size: .86rem;
}

.lab-control-slider { margin: 0 0 16px; }
.lab-control-slider > div, .lab-control-slider p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.lab-control-slider output { color: #694977; font: .9rem/1.4 var(--lab-mono); }
.lab-control-slider .lab-weight-heading { align-items: center; justify-content: flex-start; }
.lab-weight-heading button { margin-left: auto; color: #553961; background: #fffafc; white-space: nowrap; }

.lab-control-slider input {
  display: block;
  width: 100%;
  height: 34px;
  margin: 0;
  accent-color: #886296;
  cursor: pointer;
}

.lab-control-slider p { color: var(--lab-muted); font-size: .75rem; }
.lab-scores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #f4ebf4;
  border: 1px solid var(--lab-rule);
}

.lab-scores > div { padding: clamp(10px, 1.7vw, 19px); }
.lab-scores > div + div { border-left: 1px solid var(--lab-rule); }
.lab-scores strong { display: block; font: .72rem/1.35 var(--lab-mono); }
.lab-scores output {
  display: block;
  margin: 5px 0 3px;
  color: #553661;
  font: 400 clamp(1.65rem, 3vw, 2.75rem)/1 var(--lab-serif);
  font-variant-numeric: tabular-nums;
}

.lab-scores p { color: var(--lab-muted); font-size: .76rem; line-height: 1.4; }
.lab-scores .lab-score-change { margin-top: 8px; font: .69rem/1.4 var(--lab-mono); }
.lab-score-change[data-direction="up"] { color: #315c51; }
.lab-score-change[data-direction="down"] { color: #88405e; }
.lab-comparison {
  margin-top: 9px;
  color: var(--lab-muted);
  font-size: .8rem;
}
.lab-layers { display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: 12px; }
.lab-layers label, .lab-layer-fixed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 35px;
  color: #624e6b;
  font-size: .78rem;
}

.lab-layers input { margin: 0 1px 0 0; accent-color: #795388; }
.lab-layers label { cursor: pointer; }
.lab-layers span[class^="lab-legend-"] { width: 9px; height: 9px; border-radius: 50%; }
.lab-legend-heat { background: #c45881; }
.lab-legend-ref { border: 1px solid #2c787f; }
.lab-legend-fix { background: #fff6ea; border: 1px solid #403049; }

.lab-tool-actions { margin-top: 9px; }
.lab-tool-actions #lab-share { color: #fff9ff; background: #553961; border-color: #553961; }
.lab-tool-actions #lab-share:hover { background: #694674; }
.lab-status { min-height: 1.4em; margin-top: 6px; color: var(--lab-muted); font-size: .79rem; }
.lab-share-fallback { display: grid; gap: 4px; margin-top: 10px; font-size: .8rem; }
.lab-share-fallback input { min-width: 0; width: 100%; padding: 8px; font: inherit; }

.lab-main :focus-visible { outline: 2px solid #874e97; outline-offset: 3px; }
.lab-observation :focus-visible { outline-color: #ffd9ee; }

.lab-evidence {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  gap: 20px 42px;
  align-items: center;
  margin-top: clamp(28px, 6vw, 65px);
  padding: clamp(18px, 3.6vw, 36px);
  border: 1px solid var(--lab-rule);
  background: var(--lab-paper);
}

.lab-evidence h2 {
  margin-bottom: 10px;
  color: var(--lab-ink);
  font: 400 clamp(1.7rem, 3vw, 2.6rem)/1.08 var(--lab-serif);
  letter-spacing: -.025em;
}

.lab-evidence p, .lab-method p, .lab-noscript { color: var(--lab-muted); line-height: 1.65; }
.lab-evidence a { display: inline-block; margin-top: 12px; font-size: .88rem; }
.lab-evidence table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.lab-evidence caption { margin-bottom: 6px; text-align: left; color: var(--lab-muted); font-size: .78rem; }
.lab-evidence th, .lab-evidence td { padding: 8px 4px; text-align: right; border-bottom: 1px solid #e1d4e4; }
.lab-evidence th:first-child { text-align: left; }
.lab-evidence td { font-variant-numeric: tabular-nums; }
.lab-method { margin-top: 18px; padding: 10px 0; border-bottom: 1px solid var(--lab-rule); }
.lab-method summary { width: fit-content; padding: 9px 0; cursor: pointer; font-weight: 600; }
.lab-method p { max-width: 76ch; margin: 5px 0 15px; font-size: .9rem; }

@media (max-width: 850px) {
  .lab-workbench { grid-template-columns: 1fr; }
  .lab-intro h1 { font-size: clamp(3.1rem, 11vw, 5rem); }
}

@media (max-width: 600px) {
  .lab-main { width: calc(100% - 28px); margin-top: 96px; }
  .lab-intro { margin-bottom: 19px; }
  .lab-intro h1 { font-size: clamp(2.15rem, 9.5vw, 3.55rem); }
  .lab-intro > p:last-child { margin-top: 10px; font-size: .95rem; line-height: 1.45; }
  .lab-intro .lab-path { margin-bottom: 10px; }
  .lab-evidence { grid-template-columns: 1fr; }
  .lab-observation { padding: 12px; }
  .lab-observation-head { margin-bottom: 8px; }
  .lab-observation-head h2 { font-size: 1.12rem; }
  .lab-observation-foot { gap: 5px 8px; align-items: center; margin-top: 6px; }
  .lab-point-info { flex-basis: 108px; font-size: .76rem; }
  .lab-key-help { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .lab-point-actions button { padding-inline: 8px; }
  .lab-controls { padding: 13px; }
  .lab-control-slider { margin-bottom: 9px; }
  .lab-control-slider .lab-weight-heading { gap: 8px; }
  .lab-control-slider label { font-size: .85rem; }
  .lab-weight-heading button { min-height: 38px; padding-inline: 8px; }
  .lab-control-slider input { height: 28px; }
  .lab-scores > div { padding: 8px; }
  .lab-scores .lab-score-change { margin-top: 5px; }
}

@media (max-width: 350px) {
  .lab-observation-head { flex-wrap: wrap; }
  .lab-scores strong { overflow-wrap: anywhere; }
}
