/*
 * a11y.css - accessibility button + settings panel (pairs with a11y-boot.js and a11y.js).
 * What the settings do to the page lives in a11y-effects.css.
 * Panel text is sized in px on purpose: the "bigger text" setting scales html font-size up to 150%
 * and the panel must stay usable at 320px wide.
 * The tokens below may be overridden by the site (later :root rule).
 */

:root {
  --uwa-main: #1F5C59;
  --uwa-main-rgb: 31, 92, 89;
  --uwa-main-hover: #2B706C;
  --uwa-main-dark: #123F3D;
  --uwa-ink: #1D2B2A;
  --uwa-body: #EEF1F0;
  --uwa-switch-off: #23302F;
  --uwa-font: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ===================== Floating button ===================== */

.uwa-fab {
  position: fixed;
  left: 13px;
  bottom: 13px;
  z-index: 140;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--uwa-main);
  color: #fff;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .1s, background-color .1s;
}
.uwa-fab__icon {
  display: block;
  width: 26px;
  height: 26px;
  pointer-events: none;
}
.uwa-fab__hit {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
}
.uwa-fab__on {
  position: absolute;
  top: -4px;
  right: -4px;
  box-sizing: border-box;
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--uwa-main);
  border-radius: 50%;
  background: #fff;
  color: var(--uwa-main);
  pointer-events: none;
}
.uwa-fab__on svg {
  display: block;
  width: 10px;
  height: 10px;
}
html[data-uwa-on] .uwa-fab__on { display: flex; }

@media (hover: hover) {
  .uwa-fab:hover {
    transform: scale(1.1);
    background: var(--uwa-main-hover);
  }
}
.uwa-fab:focus:not(:focus-visible) { outline: none; }
.uwa-fab:focus-visible {
  outline: 2px solid var(--uwa-main-dark);
  outline-offset: -2px;
  box-shadow: 0 0 0 4px rgba(var(--uwa-main-rgb), .22);
}
.uwa-fab[aria-expanded="true"] { background: var(--uwa-main-hover); }

html[data-uwa-pos="right"] .uwa-fab {
  left: auto;
  right: 13px;
}
html[data-uwa-hidden] .uwa-fab,
html.no-js .uwa-fab { display: none; }

@media (prefers-reduced-motion: reduce) {
  .uwa-fab { transition: background-color .1s; }
  .uwa-fab:hover { transform: none; }
}
html[data-uwa-pause] .uwa-fab { transition: none; }
html[data-uwa-pause] .uwa-fab:hover { transform: none; }

@media print {
  .uwa-fab { display: none; }
}

/* ===================== Panel (dialog in the top layer) ===================== */

.uwa-panel {
  position: fixed;
  inset: 0 auto 0 0;
  box-sizing: border-box;
  width: min(355px, 100%);
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--uwa-main);
  color: var(--uwa-ink);
  box-shadow: 0 22px 110px rgba(180, 191, 208, .56);
  font: 400 14px/1.4 var(--uwa-font);
  letter-spacing: normal;
  word-spacing: normal;
  text-align: left;
  text-transform: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light;
  transform: none;
  transition: transform 280ms cubic-bezier(.2, .7, .2, 1);
}
.uwa-panel[open] {
  display: flex;
  flex-direction: column;
}
.uwa-panel::backdrop { background: transparent; }
html[data-uwa-pos="right"] .uwa-panel { inset: 0 0 0 auto; }

/* entrance: slide in from the button's side */
.uwa-panel.is-entering { transform: translateX(-100%); }
html[data-uwa-pos="right"] .uwa-panel.is-entering { transform: translateX(100%); }
@starting-style {
  .uwa-panel[open] { transform: translateX(-100%); }
  html[data-uwa-pos="right"] .uwa-panel[open] { transform: translateX(100%); }
}

@media (max-width: 360px) {
  .uwa-panel { width: 100%; }
}

.uwa-panel *,
.uwa-panel *::before,
.uwa-panel *::after { box-sizing: border-box; }
.uwa-panel [hidden] { display: none !important; }

/* neutralise site-wide button rules; placed before the component rules so those win at equal specificity */
.uwa-panel :where(button) {
  margin: 0;
  font-family: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
  text-transform: none;
  min-width: 0;
  min-height: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.uwa-panel :where(button:focus:not(:focus-visible)) { outline: none; }

/* ----- header ----- */
.uwa-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 63px;
  max-height: 63px;
  padding: 12px 20px;
}
.uwa-panel .uwa-title {
  min-width: 0;
  margin: 0;
  padding: 0;
  font: 500 15px/1.2 var(--uwa-font);
  letter-spacing: normal;
  text-transform: none;
  color: #fff;
}
.uwa-close {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .36);
  color: #fff;
  cursor: pointer;
  transition: background-color .15s;
}
.uwa-close svg {
  display: block;
  width: 12px;
  height: 12px;
}
@media (hover: hover) {
  .uwa-close:hover { background: rgba(0, 0, 0, .52); }
}
.uwa-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ----- scrolling body ----- */
.uwa-main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.uwa-main::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  height: 16px;
  border-radius: 16px 16px 0 0;
  box-shadow: inset 0 5px 6px -4px rgba(18, 38, 36, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.uwa-main.is-scrolled::before { opacity: 1; }
.uwa-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px;
  background: var(--uwa-body);
  border-radius: 16px 16px 0 0;
  scrollbar-width: none;
}
.uwa-body::-webkit-scrollbar { display: none; }

/* ----- 1. oversized-widget switch ----- */
.uwa-xl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0 0 12px;
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--uwa-ink);
  font: 500 14px/18px var(--uwa-font);
  text-align: left;
  cursor: pointer;
}
.uwa-switch {
  position: relative;
  flex: none;
  width: 45px;
  height: 24px;
  border-radius: 22px;
  background: var(--uwa-switch-off);
  overflow: hidden;
}
.uwa-switch::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--uwa-main);
  transform: translateX(-100%);
  transition: transform .15s;
}
.uwa-switch__knob {
  position: absolute;
  top: 1px;
  left: 2px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: var(--uwa-switch-off);
  transition: transform .15s, color .15s;
}
.uwa-switch__knob svg {
  display: block;
  width: 10px;
  height: 10px;
}
.uwa-switch__knob .uwa-switch__v { display: none; }
.uwa-xl[aria-checked="true"] .uwa-switch::before { transform: none; }
.uwa-xl[aria-checked="true"] .uwa-switch__knob {
  transform: translateX(19px);
  color: var(--uwa-main);
}
.uwa-xl[aria-checked="true"] .uwa-switch__x { display: none; }
.uwa-xl[aria-checked="true"] .uwa-switch__v { display: block; }
.uwa-xl:focus-visible { outline: none; }
.uwa-xl:focus-visible .uwa-switch {
  outline: 2px solid var(--uwa-main);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(var(--uwa-main-rgb), .22);
}

/* ----- 2. feature tiles ----- */
.uwa-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding-bottom: 15px;
}
.uwa-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 114px;
  padding: 5px 10px;
  border: 2px solid #fff;
  border-radius: 12px;
  background: #fff;
  color: #000;
  font: 600 14px/1.25 var(--uwa-font);
  letter-spacing: -.01em;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.uwa-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin: 17px 0 7px;
}
.uwa-tile__icon svg {
  display: block;
  width: 32px;
  height: 32px;
}
.uwa-tile__name {
  display: block;
  max-width: 100%;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}
.uwa-tile__steps {
  display: flex;
  gap: 5px;
  width: 100%;
  height: 3px;
  padding: 0 2px;
  opacity: 0;
  transition: opacity .15s;
}
.uwa-tile__steps span {
  flex: 1 1 0;
  height: 3px;
  border-radius: 10px;
  background: rgba(var(--uwa-main-rgb), .3);
}
.uwa-tile__steps span.is-done { background: var(--uwa-main); }
.uwa-tile__check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(var(--uwa-main-rgb), .88);
  color: #fff;
}
.uwa-tile__check svg {
  display: block;
  width: 10px;
  height: 10px;
}
@media (hover: hover) {
  .uwa-tile:hover { border-color: var(--uwa-main); }
}
.uwa-tile.is-on {
  border-color: var(--uwa-main);
  box-shadow: 0 0 0 5px rgba(var(--uwa-main-rgb), .1);
  color: var(--uwa-main);
}
.uwa-tile.is-on .uwa-tile__steps { opacity: 1; }
.uwa-tile.is-on .uwa-tile__check { display: flex; }
.uwa-tile:focus-visible {
  outline: 2px solid var(--uwa-main);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(var(--uwa-main-rgb), .22);
}

/* ----- 3. reset ----- */
.uwa-reset {
  position: relative;
  display: block;
  width: 100%;
  padding: 13px 20px 13px 34px;
  border: 2px solid var(--uwa-main);
  border-radius: 10px;
  background: var(--uwa-main);
  color: #fff;
  font: 600 14px/1.2 var(--uwa-font);
  text-align: center;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.uwa-reset svg {
  position: absolute;
  top: 50%;
  left: 10px;
  display: block;
  width: 22px;
  height: 22px;
  margin-top: -11px;
}
.uwa-reset span { display: block; }
@media (hover: hover) {
  .uwa-reset:hover {
    background: var(--uwa-main-hover);
    border-color: var(--uwa-main-hover);
  }
}
.uwa-reset:focus-visible {
  outline: 2px solid var(--uwa-main);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(var(--uwa-main-rgb), .22);
}

/* ----- 4. move / hide ----- */
.uwa-move { margin-top: 14px; }
.uwa-move__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--uwa-ink);
  font: 600 14px/1.3 var(--uwa-font);
  text-align: left;
  cursor: pointer;
}
.uwa-move__gear {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--uwa-main);
  color: #fff;
}
.uwa-move__gear svg {
  display: block;
  width: 16px;
  height: 16px;
}
.uwa-move__label { min-width: 0; }
.uwa-move__chev {
  flex: none;
  display: block;
  width: 10px;
  height: 10px;
  transition: transform .15s;
}
.uwa-move__toggle[aria-expanded="true"] .uwa-move__chev { transform: rotate(90deg); }
.uwa-move__toggle:focus-visible {
  outline: 2px solid var(--uwa-main);
  outline-offset: 3px;
}
.uwa-move__body { margin-top: 8px; }
.uwa-card {
  padding: 20px;
  border-radius: 12px;
  background: #fff;
}
.uwa-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 0;
  border-top: 1px solid #D9DDE3;
  color: var(--uwa-ink);
  font: 500 14px/1.3 var(--uwa-font);
  cursor: pointer;
}
.uwa-radio:last-child { border-bottom: 1px solid #D9DDE3; }
.uwa-radio input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--uwa-main);
  cursor: pointer;
}
.uwa-radio input:focus-visible {
  outline: 2px solid var(--uwa-main);
  outline-offset: 2px;
}
.uwa-radios--sub .uwa-radio { padding-left: 28px; }
.uwa-radios--sub .uwa-radio:first-child { border-top: 0; }
.uwa-hide__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.uwa-btn {
  flex: 1 1 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 2px solid var(--uwa-main);
  border-radius: 10px;
  font: 600 14px/1.2 var(--uwa-font);
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.uwa-btn--fill {
  background: var(--uwa-main);
  color: #fff;
}
.uwa-btn--line {
  background: #fff;
  color: var(--uwa-main);
}
@media (hover: hover) {
  .uwa-btn--fill:hover {
    background: var(--uwa-main-hover);
    border-color: var(--uwa-main-hover);
  }
  .uwa-btn--line:hover { background: rgba(var(--uwa-main-rgb), .08); }
}
.uwa-btn:focus-visible {
  outline: 2px solid var(--uwa-main);
  outline-offset: 3px;
}
.uwa-panel .uwa-note {
  margin: 12px 0 0;
  padding: 0;
  color: #4E505A;
  font: 400 13px/1.45 var(--uwa-font);
}

/* ----- 5. footer ----- */
.uwa-foot {
  flex: none;
  padding: 12px 20px;
  border-top: 2px solid var(--uwa-body);
  background: #fff;
  color: #4E505A;
  font: 400 13px/1.4 var(--uwa-font);
}

/* ----- toast (visual only; the live region announces it) ----- */
.uwa-toast {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 16px;
  z-index: 2;
  width: max-content;
  max-width: calc(100% - 40px);
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 12px;
  background: #0A0910;
  color: #fff;
  font: 500 14px/1.35 var(--uwa-font);
  text-align: center;
  box-shadow: 0 8px 24px rgba(10, 9, 16, .25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s, transform .2s, visibility 0s .2s;
}
.uwa-toast.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .2s, transform .2s;
}

/* ----- oversized widget ----- */
.uwa-panel.is-xl .uwa-title { font-size: 16px; }
.uwa-panel.is-xl .uwa-tile { min-height: 154px; }
.uwa-panel.is-xl .uwa-tile__name { font-size: 18px; }
.uwa-panel.is-xl .uwa-tile__icon { height: 42px; }
.uwa-panel.is-xl .uwa-tile__icon svg {
  width: 42px;
  height: 42px;
}
.uwa-panel.is-xl .uwa-switch {
  width: 47px;
  height: 28px;
}
.uwa-panel.is-xl .uwa-switch__knob {
  top: 2px;
  width: 24px;
  height: 24px;
}

/* ----- visually hidden live region (in <body>, inside the dialog while it is open) ----- */
.uwa-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* ----- no motion ----- */
@media (prefers-reduced-motion: reduce) {
  .uwa-panel,
  .uwa-panel *,
  .uwa-panel *::before,
  .uwa-panel *::after { transition: none !important; }
}
html[data-uwa-pause] .uwa-panel,
html[data-uwa-pause] .uwa-panel *,
html[data-uwa-pause] .uwa-panel *::before,
html[data-uwa-pause] .uwa-panel *::after { transition: none !important; }

/* ----- Windows high contrast ----- */
@media (forced-colors: active) {
  .uwa-fab { border: 2px solid ButtonText; }
  .uwa-tile.is-on {
    outline: 3px solid Highlight;
    outline-offset: -6px;
  }
  .uwa-switch { border: 1px solid ButtonText; }
}
