.tool-page[data-tool-slug="forensic-fiber-comparison-microscope"] :where(h1) {
  max-width: 900px;
  font-size: clamp(3rem, 7vw, 5.8rem);
  font-weight: 650;
  line-height: 0.92;
  letter-spacing: 0;
}

.fiber-lab {
  width: 100%;
  color: #17212b;
}

.fiber-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(280px, 0.64fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(244, 248, 245, 0.96), rgba(235, 242, 249, 0.94) 54%, rgba(248, 239, 244, 0.94));
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.fiber-ocular {
  position: relative;
  min-height: 408px;
  overflow: hidden;
  border-radius: 8px;
  background: #10171c;
  box-shadow: inset 0 0 0 12px rgba(10, 15, 20, 0.78), 0 18px 36px rgba(15, 23, 42, 0.13);
}

.fiber-ocular canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 408px;
}

.fiber-split {
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.36);
  transform: translateX(-1px);
}

.fiber-label,
.fiber-score {
  position: absolute;
  border-radius: 8px;
  background: rgba(10, 15, 20, 0.78);
  color: #f8fafc;
  font-weight: 800;
}

.fiber-label {
  top: 18px;
  max-width: 42%;
  padding: 8px 10px;
  font-size: 0.88rem;
  line-height: 1.15;
}

.fiber-label-left {
  left: 18px;
}

.fiber-label-right {
  right: 18px;
}

.fiber-score {
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 2px;
  min-width: 116px;
  padding: 10px 12px;
}

.fiber-score span,
.fiber-readouts span,
.fiber-field > span,
.fiber-slider span {
  font-size: 0.74rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fiber-score strong,
.fiber-slider strong,
.fiber-readouts strong {
  font-variant-numeric: tabular-nums;
}

.fiber-score strong {
  font-size: 1.8rem;
  line-height: 1;
}

.fiber-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fiber-field,
.fiber-slider,
.fiber-readouts,
.fiber-verdict {
  position: relative;
  margin: 0;
  padding: 15px 0;
  border-top: 0.5px solid rgba(15, 23, 42, 0.14);
}

.fiber-field:first-child {
  border-top: 0;
  padding-top: 0;
}

.fiber-field,
.fiber-slider {
  display: grid;
  gap: 7px;
}

.fiber-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.fiber-choice-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 45px;
  border: 0.5px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  padding: 0 12px 0 14px;
  color: #17212b;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(18px);
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 760;
  line-height: 1.15;
  text-align: left;
}

.fiber-builder-head {
  display: grid;
  gap: 3px;
  min-height: 45px;
  align-content: center;
  border: 0.5px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  padding: 0 14px;
  color: #17212b;
  background: rgba(255, 255, 255, 0.28);
}

.fiber-builder-head span {
  font-size: 0.96rem;
  font-weight: 760;
  line-height: 1.15;
}

.fiber-builder-head small,
.fiber-builder-group small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.1;
  text-transform: uppercase;
}

.fiber-builder-grid {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.fiber-builder-group {
  display: grid;
  gap: 6px;
}

.fiber-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fiber-pill-row button {
  min-height: 31px;
  border: 0.5px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  padding: 0 10px;
  color: #17212b;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.fiber-pill-row button:hover {
  transform: translateY(-1px);
}

.fiber-pill-row button[data-active="true"] {
  color: #f8fafc;
  background: #17212b;
}

.fiber-mini-slider {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: end;
}

.fiber-mini-slider span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.1;
  text-transform: uppercase;
}

.fiber-mini-slider strong {
  color: #17212b;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.fiber-mini-slider input {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  accent-color: #1d5f84;
}

.fiber-choice-trigger:focus-visible,
.fiber-choice-menu button:focus-visible {
  outline: 3px solid rgba(29, 95, 132, 0.24);
  outline-offset: 2px;
}

.fiber-choice-mark {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-left: 10px;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  opacity: 0.72;
  transform: translateY(-2px) rotate(45deg);
}

.fiber-choice-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% - 8px);
  right: 0;
  left: 0;
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 0.5px solid rgba(15, 23, 42, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.fiber-choice-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.fiber-choice-menu button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: #17212b;
  background: transparent;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 720;
  line-height: 1.15;
  text-align: left;
}

.fiber-choice-menu button:hover,
.fiber-choice-menu button[aria-selected="true"] {
  background: rgba(23, 33, 43, 0.08);
}

.fiber-slider {
  grid-template-columns: 1fr auto;
  align-items: end;
  column-gap: 12px;
  row-gap: 6px;
}

.fiber-slider strong {
  color: #17212b;
  font-size: 1.28rem;
  line-height: 1;
}

.fiber-slider input {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  accent-color: #1d5f84;
}

.fiber-readouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.fiber-readouts div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 0;
  border-top: 0.5px solid rgba(15, 23, 42, 0.12);
  color: #17212b;
}

.fiber-readouts strong {
  font-size: 1.06rem;
  overflow-wrap: anywhere;
}

.fiber-verdict {
  color: #17212b;
  overflow: hidden;
}

.fiber-verdict-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.fiber-verdict-head span {
  color: #17212b;
  font-size: 0.78rem;
  font-weight: 880;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fiber-verdict-head strong {
  font-size: 1.42rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.fiber-verdict-meter {
  position: relative;
  height: 5px;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
}

.fiber-verdict-meter span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: #7c3aed;
  transition: width 420ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 180ms ease;
}

.fiber-verdict p {
  margin: 0;
  font-size: clamp(1.16rem, 1.7vw, 1.42rem);
  font-weight: 680;
  line-height: 1.18;
}

.fiber-verdict[data-verdict="strong"] .fiber-verdict-head span,
.fiber-verdict[data-verdict="strong"] .fiber-verdict-head strong {
  color: #166534;
}

.fiber-verdict[data-verdict="strong"] .fiber-verdict-meter span {
  background: #16a34a;
}

.fiber-verdict[data-verdict="partial"] .fiber-verdict-head span,
.fiber-verdict[data-verdict="partial"] .fiber-verdict-head strong {
  color: #854d0e;
}

.fiber-verdict[data-verdict="partial"] .fiber-verdict-meter span {
  background: #d97706;
}

.fiber-verdict[data-verdict="different"] .fiber-verdict-head span,
.fiber-verdict[data-verdict="different"] .fiber-verdict-head strong {
  color: #9f1239;
}

.fiber-verdict[data-verdict="different"] .fiber-verdict-meter span {
  background: #e11d48;
}

.fiber-verdict.is-updating {
  animation: fiber-verdict-settle 360ms ease both;
}

.fiber-verdict.is-updating p {
  animation: fiber-verdict-copy 420ms ease both;
}

.fiber-chart {
  grid-column: 1 / -1;
  min-height: 260px;
  padding: 18px 0 4px;
  border-top: 0.5px solid rgba(15, 23, 42, 0.14);
  background: transparent;
}

.fiber-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.fiber-chart path[stroke] {
  animation: fiber-chart-draw 520ms ease both;
  stroke-dashoffset: 0;
}

.fiber-disclaimer {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 0 0;
  border-top: 0.5px solid rgba(15, 23, 42, 0.14);
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.55;
}

.theme-dark .fiber-lab {
  color: #e5edf2;
}

.theme-dark .fiber-ocular {
  box-shadow: inset 0 0 0 12px rgba(10, 15, 20, 0.82), 0 18px 38px rgba(0, 0, 0, 0.34);
}

.theme-dark .fiber-stage {
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(17, 25, 30, 0.96), rgba(24, 38, 49, 0.94) 54%, rgba(39, 28, 40, 0.94));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
}

.theme-dark .fiber-field,
.theme-dark .fiber-slider,
.theme-dark .fiber-readouts,
.theme-dark .fiber-verdict,
.theme-dark .fiber-chart,
.theme-dark .fiber-disclaimer {
  border-color: rgba(255, 255, 255, 0.13);
}

.theme-dark .fiber-choice-trigger,
.theme-dark .fiber-choice-menu,
.theme-dark .fiber-builder-head {
  border-color: rgba(255, 255, 255, 0.13);
  color: #f8fafc;
  background: rgba(15, 23, 32, 0.48);
}

.theme-dark .fiber-builder-head small,
.theme-dark .fiber-builder-group small,
.theme-dark .fiber-mini-slider span {
  color: #b8c5cf;
}

.theme-dark .fiber-pill-row button {
  border-color: rgba(255, 255, 255, 0.13);
  color: #f8fafc;
  background: rgba(15, 23, 32, 0.46);
}

.theme-dark .fiber-pill-row button[data-active="true"] {
  color: #17212b;
  background: #f8fafc;
}

.theme-dark .fiber-mini-slider strong {
  color: #f8fafc;
}

.theme-dark .fiber-choice-menu {
  background: rgba(15, 23, 32, 0.7);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

.theme-dark .fiber-choice-menu button {
  color: #f8fafc;
}

.theme-dark .fiber-choice-menu button:hover,
.theme-dark .fiber-choice-menu button[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.theme-dark .fiber-slider strong,
.theme-dark .fiber-readouts div,
.theme-dark .fiber-verdict,
.theme-dark .fiber-verdict-head span {
  color: #f8fafc;
}

.theme-dark .fiber-verdict-meter {
  background: rgba(255, 255, 255, 0.13);
}

.theme-dark .fiber-verdict[data-verdict="strong"] .fiber-verdict-head span,
.theme-dark .fiber-verdict[data-verdict="strong"] .fiber-verdict-head strong {
  color: #86efac;
}

.theme-dark .fiber-verdict[data-verdict="partial"] .fiber-verdict-head span,
.theme-dark .fiber-verdict[data-verdict="partial"] .fiber-verdict-head strong {
  color: #fbbf24;
}

.theme-dark .fiber-verdict[data-verdict="different"] .fiber-verdict-head span,
.theme-dark .fiber-verdict[data-verdict="different"] .fiber-verdict-head strong {
  color: #fb7185;
}

@keyframes fiber-verdict-settle {
  0% {
    transform: translateY(4px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes fiber-verdict-copy {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fiber-chart-draw {
  0% {
    opacity: 0.45;
    stroke-dasharray: 12 18;
  }
  100% {
    opacity: 1;
    stroke-dasharray: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fiber-verdict.is-updating,
  .fiber-verdict.is-updating p,
  .fiber-chart path[stroke],
  .fiber-verdict-meter span {
    animation: none;
    transition: none;
  }
}

.theme-dark .fiber-label,
.theme-dark .fiber-score {
  background: rgba(0, 0, 0, 0.58);
}

.theme-dark .fiber-disclaimer {
  color: #b8c5cf;
}

@media (max-width: 860px) {
  .fiber-stage {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .fiber-ocular,
  .fiber-ocular canvas {
    min-height: 320px;
  }

  .fiber-readouts {
    grid-template-columns: 1fr;
  }
}
