/* TN Accessibility — user-controlled helpers inspired by mature accessibility widgets.
   The widget stays outside visual filters so users can always restore the default view. */
.a11y-fab {
  position: fixed;
  left: 14px;
  bottom: 86px;
  z-index: 320;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(212,167,88,.72);
  border-radius: 50%;
  background: #14161a;
  color: #d4a758;
  box-shadow: 0 12px 28px rgba(0,0,0,.24);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  font-size: 16px;
}
.a11y-fab:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(0,0,0,.3); }
.a11y-fab svg { width: 25px; height: 25px; display: block; }
.a11y-fab[aria-expanded="true"] { background: #c8a24b; color: #14161a; }

.a11y-panel {
  position: fixed;
  left: 16px;
  bottom: 144px;
  z-index: 321;
  width: min(390px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 172px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  border: 1px solid #dfe2e5;
  border-radius: 18px;
  background: #fff;
  color: #1b1e22;
  box-shadow: 0 22px 60px rgba(0,0,0,.26);
  font-family: "Commissioner", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
.a11y-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.a11y-panel__head h2 { margin: 0; color: #14161a; font-size: 1.28rem; line-height: 1.25; }
.a11y-kicker { margin: 0 0 4px; color: #8c671c; font-size: .68rem; font-weight: 800; letter-spacing: .13em; }
.a11y-intro { margin: 0 0 17px; color: #60666e; font-size: .86rem; line-height: 1.55; }
.a11y-close {
  width: 36px; height: 36px; flex: 0 0 36px; border: 0; border-radius: 50%;
  background: #f2f3f4; color: #14161a; font: inherit; font-size: 1.25rem; cursor: pointer;
}
.a11y-close:hover { background: #e7e9eb; }

.a11y-section { margin: 0 0 14px; }
.a11y-section__label { margin-bottom: 8px; color: #333840; font-size: .76rem; font-weight: 750; letter-spacing: .02em; }
.a11y-profiles { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.a11y-profiles button,
.a11y-font-controls button,
.a11y-option,
.a11y-reset {
  border: 1px solid #dfe2e5;
  background: #fff;
  color: #272b30;
  font: inherit;
  cursor: pointer;
}
.a11y-profiles button {
  min-height: 46px; padding: 8px 7px; border-radius: 10px; font-size: .72rem; font-weight: 700; line-height: 1.25;
}
.a11y-profiles button:hover, .a11y-profiles button:focus-visible { border-color: #aa8537; background: #fbf7ed; }

.a11y-font-controls { display: grid; grid-template-columns: 54px 1fr 54px; align-items: center; gap: 8px; }
.a11y-font-controls button { min-height: 42px; border-radius: 10px; font-weight: 800; }
.a11y-font-controls button:disabled { opacity: .35; cursor: not-allowed; }
.a11y-font-controls output { min-height: 42px; display: grid; place-items: center; border-radius: 10px; background: #f5f6f7; font-size: .88rem; font-weight: 800; }

.a11y-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.a11y-option {
  min-height: 54px; display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: 11px; text-align: left; line-height: 1.25; font-size: .79rem; font-weight: 650;
}
.a11y-option:hover { border-color: #b9bec4; background: #fafbfb; }
.a11y-option[aria-pressed="true"] { border-color: #b4882d; background: #fbf5e7; color: #65470d; }
.a11y-option__icon { display: inline-grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px; border-radius: 8px; background: #eff1f3; color: #31353a; font-weight: 850; }
.a11y-option[aria-pressed="true"] .a11y-option__icon { background: rgba(200,162,75,.2); color: #65470d; }
.a11y-option__icon--text { font-size: .7rem; }

.a11y-panel__foot { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-top: 15px; padding-top: 14px; border-top: 1px solid #eceef0; }
.a11y-reset { min-height: 39px; padding: 8px 12px; border-radius: 10px; font-size: .78rem; font-weight: 700; }
.a11y-reset:hover { border-color: #aeb3b9; }
.a11y-status { min-height: 1em; color: #687078; font-size: .7rem; text-align: right; line-height: 1.35; }

/* Text scale */
html[data-a11y-font="112"] { font-size: 17.92px; }
html[data-a11y-font="125"] { font-size: 20px; }
html[data-a11y-font="137"] { font-size: 21.92px; }

/* Visual filters are rendered by a pointer-transparent viewport layer.
   This avoids applying CSS filter to body/main, which would break fixed-position UI. */
.a11y-visual-filter {
  position: fixed; inset: 0; z-index: 318; display: none; pointer-events: none;
}
html.a11y-contrast .a11y-visual-filter { display: block; -webkit-backdrop-filter: contrast(1.38); backdrop-filter: contrast(1.38); }
html.a11y-grayscale .a11y-visual-filter { display: block; -webkit-backdrop-filter: grayscale(1); backdrop-filter: grayscale(1); }
html.a11y-contrast.a11y-grayscale .a11y-visual-filter { -webkit-backdrop-filter: grayscale(1) contrast(1.38); backdrop-filter: grayscale(1) contrast(1.38); }

html.a11y-line-height main p,
html.a11y-line-height main li,
html.a11y-line-height main label,
html.a11y-line-height main button,
html.a11y-line-height main input,
html.a11y-line-height main select,
html.a11y-line-height main textarea { line-height: 1.85 !important; }

html.a11y-text-spacing main,
html.a11y-text-spacing .site-header,
html.a11y-text-spacing .site-footer { letter-spacing: .045em !important; word-spacing: .08em !important; }

html.a11y-links main a:not(.btn),
html.a11y-links .site-footer a,
html.a11y-links .main-nav > a { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 4px !important; }

html.a11y-readable-font body,
html.a11y-readable-font button,
html.a11y-readable-font input,
html.a11y-readable-font select,
html.a11y-readable-font textarea { font-family: Arial, Helvetica, Verdana, sans-serif !important; }

html.a11y-large-cursor body,
html.a11y-large-cursor a,
html.a11y-large-cursor button,
html.a11y-large-cursor input,
html.a11y-large-cursor select,
html.a11y-large-cursor textarea,
html.a11y-large-cursor summary,
html.a11y-large-cursor label { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M7 4v34l9-9 7 15 7-4-7-14h13z' fill='white' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 7 4, auto !important; }

html.a11y-reduce-motion { scroll-behavior: auto !important; }
html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }

html.a11y-focus a:focus-visible,
html.a11y-focus button:focus-visible,
html.a11y-focus input:focus-visible,
html.a11y-focus select:focus-visible,
html.a11y-focus textarea:focus-visible,
html.a11y-focus summary:focus-visible { outline: 4px solid #ffcc00 !important; outline-offset: 4px !important; box-shadow: 0 0 0 2px #000 !important; }

html.a11y-hide-images main img,
html.a11y-hide-images main picture,
html.a11y-hide-images main video { opacity: 0 !important; }
html.a11y-hide-images main [style*="background-image"] { background-image: none !important; }

.a11y-reading-guide {
  position: fixed; left: 0; right: 0; z-index: 319; height: 3px; pointer-events: none;
  background: #ffcf33; box-shadow: 0 -10px 20px rgba(255,207,51,.1), 0 10px 20px rgba(255,207,51,.1);
  transform: translateY(-50%);
}

@media (max-width: 600px) {
  .a11y-fab { left: 12px; bottom: 70px; width: 44px; height: 44px; }
  .a11y-panel { left: 12px; bottom: 122px; width: calc(100vw - 24px); max-height: calc(100vh - 142px); padding: 16px; border-radius: 15px; }
  .a11y-profiles { grid-template-columns: 1fr; }
  .a11y-options { grid-template-columns: minmax(0, 1fr); }
  .a11y-option { min-height: 48px; }
  .a11y-panel__foot { align-items: flex-start; flex-direction: column; }
  .a11y-status { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .a11y-fab { transition: none; }
}
