:root {
  --z: 1;
  --z2: calc(-1 * var(--z));
}

.page-output ::selection {
  background-color: transparent;
}

.page-output ::-webkit-selection {
  background-color: transparent;
}

.zoom-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 30px;
  padding: 2px;
  border: 1px solid #c8d0c4;
  border-radius: 6px;
  background: #fff;
}

.zoom-button {
  width: 26px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #171717;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.zoom-button:hover {
  background: #f0f3ee;
}

.zoom-value {
  min-width: 46px;
  color: #445046;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.reader-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.aireflow-page .reader-tools {
  position: sticky;
  top: 8px;
  z-index: 20;
  justify-self: end;
  width: fit-content;
  margin: -10px 0 0 auto;
  padding: 2px;
  border-radius: 8px;
  background: rgba(244, 246, 243, .92);
  backdrop-filter: blur(8px);
}

.url-form {
  display: flex;
  gap: 8px;
  align-items: center;
  width: min(640px, 100%);
  margin: 0 auto;
}

.url-form input {
  min-width: 0;
  flex: 1;
  height: 36px;
  padding: 6px 10px;
  border: 1px solid #c8d0c4;
  border-radius: 6px;
  background: #fff;
  color: #171717;
  font: inherit;
  font-size: 13px;
}

.url-form input:focus {
  outline: 2px solid rgba(15, 118, 110, .24);
  outline-offset: 1px;
  border-color: #0f766e;
}

@media (max-width: 680px) {
  .aireflow-page .reader-tools {
    justify-content: flex-start;
    justify-self: start;
    margin-top: -4px;
  }
}

.word-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 0;
  row-gap: 2px;
  line-height: 0;
}

.aireflow-page .word-strip {
  padding: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.word-strip.reflowed {
  align-items: flex-start;
  line-height: 0;
}

.word-strip.preserve-spacing {
  align-items: flex-start;
  flex-wrap: wrap;
  column-gap: 0;
  row-gap: 2px;
  line-height: 0;
  white-space: normal;
  overflow: visible;
}

.text-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0;
  row-gap: 2px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.08;
}

.text-strip.preserve-spacing {
  align-items: baseline;
  column-gap: 0;
  row-gap: 2px;
}

.real-text-token {
  display: inline-block;
  position: relative;
  margin: 0;
  padding: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.04;
  white-space: pre;
  vertical-align: baseline;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.word-line-break {
  flex-basis: 100%;
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0;
}

.word-tile {
  display: inline-block;
  position: relative;
  margin: 0;
  padding: 0;
  font-family: Times, "Times New Roman", serif;
  font-size: var(--word-height, 12px);
  line-height: var(--word-height, 12px);
  vertical-align: baseline;
  overflow: visible;
  color: transparent;
  white-space: pre;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.word-tile-visual {
  position: absolute;
  left: 0;
  display: block;
  overflow: hidden;
  color: transparent;
  background-repeat: no-repeat;
  background-origin: border-box;
  background-clip: border-box;
  image-rendering: var(--word-image-rendering, auto);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.word-tile-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.aireflow-page .word-tile {
  margin-bottom: 4px;
}

.word-tile.is-selection-highlight::after {
  content: none;
}

.word-tile.is-stored-highlight::after {
  content: none;
}

.word-tile.is-selection-highlight {
  box-shadow: inset 0 0 256px 256px rgba(10, 132, 255, .28);
}

.word-tile.is-stored-highlight {
  box-shadow: inset 0 0 256px 256px rgba(255, 214, 10, .42);
}

.word-tile.is-selection-highlight .word-tile-visual::after {
  background: rgba(10, 132, 255, .28);
}

.word-tile.is-stored-highlight .word-tile-visual::after {
  background: rgba(255, 214, 10, .42);
}

.word-tile::selection {
  background: transparent !important;
  color: transparent !important;
}

.word-tile::-moz-selection {
  background: transparent !important;
  color: transparent !important;
}

.word-source-crop {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background-repeat: no-repeat;
  background-origin: border-box;
  background-clip: border-box;
  image-rendering: var(--word-image-rendering, auto);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.region-crop-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  line-height: 0;
}

.non-reflowable-region-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}

.non-reflowable-region-scroll .region-crop-frame,
.non-reflowable-region-scroll .region-crop {
  max-width: none;
}

.region-crop-frame .region-crop {
  display: block;
  box-sizing: border-box;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.region-text-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.region-text-token {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1;
}

.region-text-token .word-tile-text {
  font-family: Arial, sans-serif;
}

.word-tile-text {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 1;
  width: var(--word-width, 100%);
  height: var(--word-height, 100%);
  overflow: hidden;
  color: transparent;
  font: var(--word-height, 12px) Arial, sans-serif;
  line-height: var(--word-height, 12px);
  white-space: pre;
  cursor: text;
  pointer-events: auto;
  transform: scaleX(var(--word-text-scale, 1));
  transform-origin: left top;
  user-select: text;
  -webkit-user-select: text;
  -webkit-tap-highlight-color: transparent;
}

.word-tile-text::selection {
  background: transparent !important;
  color: transparent !important;
}

.word-tile-text::-moz-selection {
  background: transparent !important;
  color: transparent !important;
}

.word-tile-text::search-text,
.word-tile-text::target-text {
  background: color-mix(in srgb, Highlight 32%, transparent);
  color: transparent;
}
