:root {
  --font-scale: 1;
}

.is-high-contrast {
  --color-bg: #000000;
  --color-surface: #000000;
  --color-surface-soft: #000000;
  --color-text: #ffffff;
  --color-muted: #ffffff;
  --color-border: #ffffff;
  --color-primary: #ffff00;
  --color-primary-strong: #ffff00;
  --color-accent: #00ffff;
  --color-accent-soft: #000000;
  --color-focus: #00ffff;
  --shadow-soft: none;
}

.is-contrast-light {
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-soft: #f2f2f2;
  --color-text: #000000;
  --color-muted: #111111;
  --color-border: #000000;
  --color-primary: #003c8f;
  --color-primary-strong: #001f4d;
  --color-accent: #8a2d00;
  --color-accent-soft: #fff4cc;
  --color-focus: #c24100;
  --shadow-soft: none;
}

.is-contrast-yellow {
  --color-bg: #000000;
  --color-surface: #000000;
  --color-surface-soft: #111111;
  --color-text: #fff36d;
  --color-muted: #fff36d;
  --color-border: #fff36d;
  --color-primary: #fff36d;
  --color-primary-strong: #ffffff;
  --color-accent: #00e5ff;
  --color-accent-soft: #1a1a00;
  --color-focus: #00e5ff;
  --shadow-soft: none;
}

.is-contrast-blue {
  --color-bg: #001527;
  --color-surface: #00223d;
  --color-surface-soft: #07375d;
  --color-text: #eef9ff;
  --color-muted: #d4ecff;
  --color-border: #9ed7ff;
  --color-primary: #ffe95c;
  --color-primary-strong: #fff7a8;
  --color-accent: #ffb36b;
  --color-accent-soft: #173a4f;
  --color-focus: #ffea00;
  --shadow-soft: none;
}

html.has-contrast-mode body {
  background: var(--color-bg) !important;
  color: var(--color-text) !important;
}

.is-dyslexia-font {
  --dyslexia-font-stack: "Comic Sans MS", "Comic Sans", "Trebuchet MS", Verdana, Arial, sans-serif;
}

.is-dyslexia-font body,
.is-dyslexia-font input,
.is-dyslexia-font textarea,
.is-dyslexia-font select,
.is-dyslexia-font button {
  font-family: var(--dyslexia-font-stack) !important;
  letter-spacing: 0.04em !important;
  word-spacing: 0.16em !important;
  line-height: 1.75 !important;
}

.is-dyslexia-font p,
.is-dyslexia-font li,
.is-dyslexia-font dd,
.is-dyslexia-font blockquote {
  max-width: 68ch;
}

.uat-screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.uat-toolbar-wrap {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #03474a;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.uat-toolbar-wrap--bottom {
  position: fixed;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-bottom: 0;
}

.uat-floating {
  position: fixed;
  right: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 1000;
}

.admin-bar .uat-floating {
  bottom: clamp(0.75rem, 2vw, 1.5rem);
}

.uat-floating-toggle {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 3px solid #ffffff;
  background: #03474a;
  color: #ffffff;
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.uat-floating-toggle:hover,
.uat-floating-toggle[aria-expanded="true"] {
  background: #ffbf00;
  color: #000000;
}

.uat-panel[hidden] {
  display: none;
}

.uat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(calc(100vw - 1.5rem), 26rem);
  padding: 0.85rem;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #17211f);
  border: 2px solid var(--color-border, #c8d4d0);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.uat-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-weight: 900;
}

.uat-panel-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
}

.uat-panel-close:hover {
  background: var(--color-accent-soft, #fff1e8);
}

.uat-panel-close:focus-visible {
  outline: 4px solid var(--color-focus, #ffbf00);
  outline-offset: 2px;
}

.admin-bar .uat-toolbar-wrap {
  top: 32px;
}

.admin-bar .uat-toolbar-wrap--bottom {
  top: auto;
}

.uat-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
  width: min(100% - 2rem, 76rem);
  min-height: 3.4rem;
  margin-inline: auto;
  padding-block: 0.5rem;
}

.uat-toolbar--panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.uat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.45rem;
  border: 2px solid #ffffff;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
  border-radius: 4px;
}

.uat-toolbar--panel .uat-button {
  flex-direction: column;
  width: 100%;
  min-height: 4.7rem;
  padding: 0.55rem 0.4rem;
  border-color: var(--color-border, #c8d4d0);
  background: var(--color-surface-soft, #f7faf9);
  color: var(--color-text, #17211f);
}

.uat-button:hover {
  background: #ffffff;
  color: #03474a;
}

.uat-toolbar--panel .uat-button:hover {
  border-color: var(--color-primary, #075f63);
  background: var(--color-accent-soft, #fff1e8);
  color: var(--color-text, #17211f);
}

.uat-button[aria-pressed="true"] {
  background: #ffbf00;
  border-color: #ffbf00;
  color: #000000;
}

.uat-button:focus-visible,
.uat-floating-toggle:focus-visible,
.uat-sign-video-close:focus-visible {
  outline: 4px solid var(--color-focus, #ffbf00);
  outline-offset: 3px;
}

.uat-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.uat-button-read {
  gap: 0.35rem;
}

.uat-icon {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.uat-floating-toggle .uat-icon {
  width: 1.75rem;
  height: 1.75rem;
}

.uat-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.uat-icon svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.uat-text-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.uat-button-label,
.uat-button-read [data-uat-read-page-label] {
  display: inline-block;
  max-width: 100%;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.uat-has-open-modal {
  overflow: hidden;
}

.uat-sign-video-modal[hidden] {
  display: none;
}

.uat-sign-video-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.uat-sign-video-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.uat-sign-video-dialog {
  position: relative;
  width: min(100%, 58rem);
  max-height: min(88svh, 48rem);
  overflow: auto;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #17211f);
  border: 2px solid var(--color-border, #c8d4d0);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.uat-sign-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border, #c8d4d0);
}

.uat-sign-video-header h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.2;
}

.uat-sign-video-close {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid var(--color-primary, #075f63);
  background: var(--color-primary, #075f63);
  color: #ffffff;
  font: inherit;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
}

.uat-sign-video-close:hover {
  background: var(--color-primary-strong, #03474a);
}

.uat-sign-video-frame {
  aspect-ratio: 16 / 9;
  background: #000000;
}

.uat-sign-video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.is-contrast-yellow .uat-sign-video-close,
.is-contrast-blue .uat-sign-video-close {
  color: #000000;
}

@media (max-width: 782px) {
  .admin-bar .uat-toolbar-wrap {
    top: 46px;
  }
}

@media (max-width: 560px) {
  .uat-toolbar {
    width: min(100% - 1rem, 76rem);
    justify-content: flex-start;
  }

  .uat-floating {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .uat-floating-toggle {
    width: 3.5rem;
  }
}
