:root {
  --nsa-text-scale: 100%;
  --nsa-accent: #0b5f5b;
  --nsa-accent-dark: #083f3c;
  --nsa-surface: #ffffff;
  --nsa-text: #17212b;
  --nsa-muted: #5d6874;
  --nsa-border: #d6dde3;
  --nsa-focus: #ffbf47;
  --nsa-shadow: 0 18px 50px rgba(0, 0, 0, .20);
}

html.nsa-font-scale-active { font-size: var(--nsa-text-scale) !important; }

.nsa-a11y,
.nsa-a11y * { box-sizing: border-box; }

.nsa-a11y {
  position: fixed;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2147483000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.35;
}

.nsa-a11y--right { right: max(18px, env(safe-area-inset-right)); }
.nsa-a11y--left { left: max(18px, env(safe-area-inset-left)); }

.nsa-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--nsa-accent);
  color: #fff;
  box-shadow: var(--nsa-shadow);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.nsa-launcher:hover { background: var(--nsa-accent-dark); }
.nsa-launcher:focus-visible,
.nsa-a11y button:focus-visible {
  outline: 4px solid var(--nsa-focus) !important;
  outline-offset: 3px !important;
}

.nsa-launcher__icon { display: grid; place-items: center; }

.nsa-panel {
  position: absolute;
  bottom: 64px;
  width: min(390px, calc(100vw - 28px));
  max-height: min(650px, calc(100vh - 110px));
  overflow: auto;
  background: var(--nsa-surface);
  color: var(--nsa-text);
  border: 1px solid var(--nsa-border);
  border-radius: 22px;
  box-shadow: var(--nsa-shadow);
}

.nsa-a11y--right .nsa-panel { right: 0; }
.nsa-a11y--left .nsa-panel { left: 0; }
.nsa-panel[hidden] { display: none !important; }

.nsa-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--nsa-border);
}

.nsa-panel__header strong { display: block; font-size: 1.12rem; }
.nsa-panel__header p { margin: 5px 0 0; color: var(--nsa-muted); font-size: .86rem; }

.nsa-icon-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--nsa-border);
  border-radius: 12px;
  background: #fff;
  color: var(--nsa-text);
  cursor: pointer;
  font: 700 26px/1 Arial, sans-serif;
}

.nsa-panel__body { padding: 16px 20px 20px; }
.nsa-text-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.nsa-tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.nsa-tool {
  min-height: 86px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--nsa-border);
  border-radius: 14px;
  background: #fff;
  color: var(--nsa-text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.nsa-tool:hover { border-color: var(--nsa-accent); background: #f2f8f7; }
.nsa-tool.is-active,
.nsa-tool[aria-pressed="true"] { border-color: var(--nsa-accent); background: #e7f4f2; box-shadow: inset 0 0 0 1px var(--nsa-accent); }
.nsa-tool__icon { font-size: 1.25rem; font-weight: 800; color: var(--nsa-accent); }
.nsa-tool--half { min-height: 74px; }

.nsa-reset {
  width: 100%;
  margin-top: 12px;
  min-height: 46px;
  padding: 10px 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--nsa-border);
  border-radius: 12px;
  background: #f7f9fa;
  color: var(--nsa-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nsa-notice { margin: 12px 0 0; color: var(--nsa-muted); font-size: .75rem; }

/* User-selected presentation helpers. */
html.nsa-underline-links body a:not(.nsa-launcher):not(.nsa-tool):not(.nsa-reset):not(.nsa-icon-button) {
  text-decoration: underline !important;
  text-decoration-thickness: .11em !important;
  text-underline-offset: .18em !important;
}

html.nsa-readable-font body,
html.nsa-readable-font body *:not(code):not(pre):not(kbd):not(samp) {
  font-family: Arial, Verdana, Helvetica, sans-serif !important;
}

html.nsa-text-spacing body {
  line-height: 1.8 !important;
  letter-spacing: .08em !important;
  word-spacing: .14em !important;
}
html.nsa-text-spacing p { margin-bottom: 1.5em !important; }

html.nsa-grayscale body { filter: grayscale(1) !important; }
html.nsa-grayscale .nsa-a11y { filter: grayscale(0) !important; }

html.nsa-high-contrast body { background: #000 !important; color: #fff !important; }
html.nsa-high-contrast body :where(main, section, article, header, footer, nav, aside, div, li) {
  border-color: #fff !important;
}
html.nsa-high-contrast body :where(h1,h2,h3,h4,h5,h6,p,span,small,strong,em,label,li,dd,dt,time) {
  color: #fff !important;
}
html.nsa-high-contrast body a { color: #ffea00 !important; }
html.nsa-high-contrast body :where(button,input,select,textarea) {
  color: #fff !important;
  background: #000 !important;
  border-color: #fff !important;
}
html.nsa-high-contrast body img { outline: 1px solid #fff; }
html.nsa-high-contrast .nsa-a11y,
html.nsa-high-contrast .nsa-a11y * { filter: none !important; }
html.nsa-high-contrast .nsa-panel,
html.nsa-high-contrast .nsa-panel * { color: #111 !important; }
html.nsa-high-contrast .nsa-panel { background: #fff !important; border-color: #111 !important; }
html.nsa-high-contrast .nsa-panel button { background: #fff !important; color: #111 !important; border-color: #555 !important; }
html.nsa-high-contrast .nsa-panel .nsa-tool.is-active,
html.nsa-high-contrast .nsa-panel .nsa-tool[aria-pressed="true"] { background: #ffea00 !important; color: #000 !important; }
html.nsa-high-contrast .nsa-launcher { background: #ffea00 !important; color: #000 !important; border-color: #000 !important; }

html.nsa-reduce-motion { scroll-behavior: auto !important; }
html.nsa-reduce-motion *,
html.nsa-reduce-motion *::before,
html.nsa-reduce-motion *::after {
  animation-duration: .01ms !important;
  animation-delay: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
  transition-delay: 0ms !important;
  scroll-behavior: auto !important;
}
html.nsa-reduce-motion .reveal { opacity: 1 !important; transform: none !important; }

html.nsa-strong-focus body :focus-visible {
  outline: 4px solid var(--nsa-focus) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #111 !important;
}

@media (prefers-reduced-motion: reduce) {
  .nsa-a11y *, .nsa-a11y *::before, .nsa-a11y *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 600px) {
  .nsa-a11y { bottom: max(12px, env(safe-area-inset-bottom)); }
  .nsa-a11y--right { right: 12px; }
  .nsa-a11y--left { left: 12px; }
  .nsa-launcher { width: 52px; height: 52px; padding: 0; justify-content: center; }
  .nsa-launcher__label { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
  .nsa-panel { bottom: 62px; max-height: calc(100vh - 90px); }
}

@media print {
  .nsa-a11y { display: none !important; }
}
