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

html { font-size: calc(100% * var(--wna-font-scale)); }

.wna-root {
  position: fixed;
  bottom: 20px;
  z-index: 999999;
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  direction: ltr;
}
.wna-position-left { left: 20px; }
.wna-position-right { right: 20px; }

.wna-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #005fcc;
  color: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.wna-trigger:hover { background: #004da6; }
.wna-trigger:focus-visible,
.wna-panel button:focus-visible,
.wna-panel a:focus-visible {
  outline: 3px solid #ffbf47 !important;
  outline-offset: 3px !important;
}
.wna-trigger-icon { font-size: 22px; line-height: 1; }

.wna-panel {
  display: none;
  position: absolute;
  bottom: 60px;
  width: min(340px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 100px));
  overflow: auto;
  padding: 18px;
  border: 1px solid #b8b8b8;
  border-radius: 16px;
  background: #fff;
  color: #151515;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
.wna-position-left .wna-panel { left: 0; }
.wna-position-right .wna-panel { right: 0; }
.wna-panel.is-open { display: block; }

.wna-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.wna-panel-header h2 { margin: 0; color: #151515; font-size: 21px; line-height: 1.25; }
.wna-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #ececec;
  color: #111;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.wna-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wna-controls button,
.wna-reset {
  min-height: 72px;
  border: 2px solid #d4d4d4;
  border-radius: 10px;
  background: #f7f7f7;
  color: #111;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.wna-controls button:hover,
.wna-reset:hover { border-color: #005fcc; background: #edf5ff; }
.wna-controls button[aria-pressed="true"] { border-color: #005fcc; background: #005fcc; color: #fff; }
.wna-controls button > span { display: block; font-size: 14px; }
.wna-font-controls { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 10px; }
.wna-font-controls button { font-size: 24px; }
.wna-font-controls button span { margin-top: 2px; font-size: 13px; }
.wna-reset { width: 100%; min-height: 46px; margin-top: 12px; }
.wna-statement { display: block; margin-top: 14px; color: #004fAD; font-weight: 700; text-align: center; text-decoration: underline; }
.wna-note { margin: 12px 0 0; color: #555; font-size: 13px; text-align: center; }

html.wna-high-contrast,
html.wna-high-contrast body {
  background: #000 !important;
  color: #fff !important;
}
html.wna-high-contrast body *:not(.wna-root):not(.wna-root *) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
}
html.wna-high-contrast body a:not(.wna-root a) { color: #ffeb3b !important; text-decoration: underline !important; }
html.wna-high-contrast body img { outline: 2px solid #fff; }

html.wna-grayscale body > *:not(.wna-root) { filter: grayscale(100%); }
html.wna-highlight-links body a:not(.wna-root a) {
  text-decoration: underline !important;
  text-decoration-thickness: 3px !important;
  text-underline-offset: 3px !important;
  outline: 2px solid currentColor !important;
  outline-offset: 2px !important;
}
html.wna-readable-font body,
html.wna-readable-font body *:not(.wna-root):not(.wna-root *) {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: normal !important;
  word-spacing: .08em !important;
}
html.wna-stop-motion,
html.wna-stop-motion *:not(.wna-root):not(.wna-root *) {
  scroll-behavior: auto !important;
  animation: none !important;
  transition: none !important;
}
html.wna-stop-motion .ap-reveal { opacity: 1 !important; transform: none !important; }
html.wna-large-cursor body,
html.wna-large-cursor body * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath d='M3 2l23 21-10 2-5 9z' fill='white' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 3 2, auto !important; }

@media (max-width: 520px) {
  .wna-root { bottom: 12px; }
  .wna-position-left { left: 12px; }
  .wna-position-right { right: 12px; }
  .wna-trigger-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .wna-trigger { width: 52px; height: 52px; justify-content: center; padding: 0; }
  .wna-panel { bottom: 62px; width: min(340px, calc(100vw - 24px)); }
}

@media print {
  .wna-root { display: none !important; }
}
