/* Shared display tokens. Every UI palette uses text and shape as well as hue. */
:root {
  --a11y-bg: #f8f7f2;
  --a11y-surface: #ffffff;
  --a11y-surface-alt: #eeefe8;
  --a11y-text: #1d2b25;
  --a11y-muted: #4e6055;
  --a11y-border: #74877a;
  --a11y-accent: #b71c2c;
  --a11y-on-accent: #ffffff;
  --a11y-success: #19663d;
  --a11y-warning: #795100;
  --a11y-info: #155980;
  --a11y-danger: #a5221c;
  --a11y-historical: #655080;
  --a11y-success-soft: #e7f2e9;
  --a11y-warning-soft: #f7edda;
  --a11y-info-soft: #e6eff7;
  --a11y-danger-soft: #fbe8e7;
  --a11y-historical-soft: #eee7f6;
  color-scheme: light;
}
html[data-theme="dark"] {
  --a11y-bg: #111814;
  --a11y-surface: #1c2721;
  --a11y-surface-alt: #25332c;
  --a11y-text: #eef4ef;
  --a11y-muted: #b7c5bc;
  --a11y-border: #81988a;
  --a11y-accent: #ff8b96;
  --a11y-on-accent: #171b18;
  --a11y-success: #89dcaa;
  --a11y-warning: #f0c26a;
  --a11y-info: #90caf1;
  --a11y-danger: #ffa79e;
  --a11y-historical: #ccb4ed;
  --a11y-success-soft: #1b3829;
  --a11y-warning-soft: #3a301d;
  --a11y-info-soft: #1b3444;
  --a11y-danger-soft: #402626;
  --a11y-historical-soft: #322b41;
  color-scheme: dark;
}
/* Red/green alternatives use blue, ochre and violet, with labeled/patterned states. */
html[data-color-vision="protan"] {
  --a11y-accent: #145589;
  --a11y-success: #145589;
  --a11y-warning: #785000;
  --a11y-info: #394d72;
  --a11y-danger: #764100;
  --a11y-historical: #5e4a7d;
  --a11y-success-soft: #e3edf7;
  --a11y-warning-soft: #f6ebd3;
  --a11y-info-soft: #e9edf5;
  --a11y-danger-soft: #f4e8d8;
  --a11y-historical-soft: #ede8f4;
}
html[data-color-vision="deutan"] {
  --a11y-accent: #124f80;
  --a11y-success: #165c86;
  --a11y-warning: #775000;
  --a11y-info: #3e5088;
  --a11y-danger: #813d08;
  --a11y-historical: #66446f;
  --a11y-success-soft: #e4eff6;
  --a11y-warning-soft: #f5edda;
  --a11y-info-soft: #e8ecf8;
  --a11y-danger-soft: #f7e7d9;
  --a11y-historical-soft: #f1e7f2;
}
/* Blue/yellow alternatives use teal and rose rather than blue/yellow status pairs. */
html[data-color-vision="tritan"] {
  --a11y-accent: #94334d;
  --a11y-success: #12605b;
  --a11y-warning: #72444f;
  --a11y-info: #24565b;
  --a11y-danger: #94334d;
  --a11y-historical: #614953;
  --a11y-success-soft: #e1efeb;
  --a11y-warning-soft: #f4e7ec;
  --a11y-info-soft: #e3eeef;
  --a11y-danger-soft: #f6e4ea;
  --a11y-historical-soft: #eee7ed;
}
html[data-theme="dark"][data-color-vision="protan"] {
  --a11y-accent: #92c8ff;
  --a11y-success: #92c8ff;
  --a11y-warning: #f2cf82;
  --a11y-info: #b1c7f3;
  --a11y-danger: #f3b873;
  --a11y-historical: #d0bbef;
  --a11y-success-soft: #20354b;
  --a11y-warning-soft: #3a311f;
  --a11y-info-soft: #293347;
  --a11y-danger-soft: #3e2e1f;
  --a11y-historical-soft: #322b40;
}
html[data-theme="dark"][data-color-vision="deutan"] {
  --a11y-accent: #9bcfff;
  --a11y-success: #91cde8;
  --a11y-warning: #ead08f;
  --a11y-info: #bccbff;
  --a11y-danger: #f1b37e;
  --a11y-historical: #deb8e4;
  --a11y-success-soft: #1e3541;
  --a11y-warning-soft: #383220;
  --a11y-info-soft: #2a3247;
  --a11y-danger-soft: #3c2d21;
  --a11y-historical-soft: #3a293d;
}
html[data-theme="dark"][data-color-vision="tritan"] {
  --a11y-accent: #ffabc1;
  --a11y-success: #91d7ce;
  --a11y-warning: #e8b4c5;
  --a11y-info: #a5ced3;
  --a11y-danger: #ffabc1;
  --a11y-historical: #dac3ce;
  --a11y-success-soft: #193731;
  --a11y-warning-soft: #3d2c34;
  --a11y-info-soft: #23363a;
  --a11y-danger-soft: #412933;
  --a11y-historical-soft: #352d33;
}
html[data-color-vision="mono"] {
  --a11y-bg: #f6f6f6;
  --a11y-surface: #ffffff;
  --a11y-surface-alt: #e9e9e9;
  --a11y-text: #171717;
  --a11y-muted: #505050;
  --a11y-border: #707070;
  --a11y-accent: #242424;
  --a11y-success: #303030;
  --a11y-warning: #494949;
  --a11y-info: #252525;
  --a11y-danger: #171717;
  --a11y-historical: #555555;
  --a11y-success-soft: #ededed;
  --a11y-warning-soft: #e7e7e7;
  --a11y-info-soft: #f0f0f0;
  --a11y-danger-soft: #e5e5e5;
  --a11y-historical-soft: #efefef;
}
html[data-theme="dark"][data-color-vision="mono"] {
  --a11y-bg: #121212;
  --a11y-surface: #222222;
  --a11y-surface-alt: #303030;
  --a11y-text: #f5f5f5;
  --a11y-muted: #c5c5c5;
  --a11y-border: #999999;
  --a11y-accent: #eeeeee;
  --a11y-success: #dedede;
  --a11y-warning: #d0d0d0;
  --a11y-info: #f0f0f0;
  --a11y-danger: #ffffff;
  --a11y-historical: #cccccc;
  --a11y-success-soft: #2a2a2a;
  --a11y-warning-soft: #303030;
  --a11y-info-soft: #242424;
  --a11y-danger-soft: #353535;
  --a11y-historical-soft: #2d2d2d;
}
html[data-contrast="more"] {
  --a11y-bg: #ffffff;
  --a11y-surface: #ffffff;
  --a11y-surface-alt: #f1f1f1;
  --a11y-text: #000000;
  --a11y-muted: #292929;
  --a11y-border: #242424;
}
html[data-theme="dark"][data-contrast="more"] {
  --a11y-bg: #000000;
  --a11y-surface: #090909;
  --a11y-surface-alt: #151515;
  --a11y-text: #ffffff;
  --a11y-muted: #f0f0f0;
  --a11y-border: #ffffff;
}

/* The native dialog traps focus, supports Escape, and leaves page zoom available. */
.display-trigger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 44px; min-height: 44px; padding: 9px; border: 1px solid currentColor;
  border-radius: 5px; color: inherit; background: transparent; font: inherit;
  font-size: 12px; font-weight: 650; cursor: pointer; flex-shrink: 0;
}
.display-trigger[hidden] { display: none; }
.display-trigger svg { display: block; flex-shrink: 0; }
.display-trigger:hover { outline: 1px solid currentColor; outline-offset: 2px; }
.site-header__inner > .display-trigger { margin-left: auto; color: #ffffff; }
.display-dialog {
  width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 32px);
  margin: auto; padding: 28px; overflow: auto; border: 1px solid var(--a11y-border);
  border-radius: 12px; background: var(--a11y-surface); color: var(--a11y-text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.6; box-shadow: 0 20px 80px #0005;
  text-align: left; letter-spacing: normal;
}
.display-dialog::backdrop { background: #0009; }
.display-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.display-dialog .display-kicker { color: var(--a11y-muted); font-size: 10px; font-weight: 750; letter-spacing: .09em; margin: 0 0 8px; }
.display-dialog h2 { color: var(--a11y-text); font-size: 23px; font-weight: 700; line-height: 1.25; letter-spacing: -.03em; margin: 0 0 16px; }
.display-dialog p { color: var(--a11y-muted); font-size: 13px; line-height: 1.6; margin: 0 0 20px; }
.display-dialog button { font-family: inherit; cursor: pointer; }
.display-close { flex-shrink: 0; width: 40px; height: 40px; border: 1px solid var(--a11y-border); border-radius: 6px; background: var(--a11y-surface); color: var(--a11y-text); font-size: 26px; line-height: 1; }
.display-form { display: grid; gap: 20px; }
.display-theme-options { border: 0; padding: 0; margin: 0; min-width: 0; }
.display-theme-options legend, .display-field > label { color: var(--a11y-text); font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 9px; display: block; }
.display-theme-options > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.display-theme-options label { display: flex; gap: 7px; align-items: center; justify-content: center; min-height: 44px; padding: 10px 6px; border: 1px solid var(--a11y-border); border-radius: 6px; background: var(--a11y-surface-alt); color: var(--a11y-text); font-size: 12px; font-weight: 600; cursor: pointer; }
.display-theme-options label:has(:checked) { background: var(--a11y-accent); color: var(--a11y-on-accent); border-color: var(--a11y-accent); box-shadow: 0 0 0 2px var(--a11y-surface), 0 0 0 3px var(--a11y-accent); }
.display-dialog input[type="radio"], .display-dialog input[type="checkbox"] { width: 18px; height: 18px; margin: 0; padding: 0; flex-shrink: 0; accent-color: var(--a11y-accent); }
.display-theme-options label:has(:checked) input { accent-color: var(--a11y-on-accent); }
.display-dialog .display-field select { display: block; width: 100%; min-height: 46px; padding: 11px 32px 11px 12px; border: 1px solid var(--a11y-border); border-radius: 6px; background: var(--a11y-surface); color: var(--a11y-text); font-family: inherit; font-size: 13px; }
.display-field p { margin: 8px 0 0; font-size: 12px; }
.display-check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.display-check input { margin-top: 4px!important; }
.display-check strong { display: block; color: var(--a11y-text); font-size: 14px; font-weight: 650; }
.display-check small { display: block; color: var(--a11y-muted); font-size: 12px; margin-top: 3px; }
.display-dialog .display-keyboard-tip { font-size: 12px; margin: 0; }
.display-dialog .display-status { font-size: 12px; margin: 0; min-height: 19px; }
.display-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.display-reset, .display-done { padding: 11px 17px; min-height: 44px; border: 1px solid var(--a11y-border); border-radius: 6px; font-size: 13px; font-weight: 650; }
.display-reset { background: var(--a11y-surface); color: var(--a11y-text); }
.display-done { background: var(--a11y-accent); color: var(--a11y-on-accent); border-color: var(--a11y-accent); }
.display-dialog :focus-visible, .display-trigger:focus-visible { outline: 3px solid var(--a11y-accent); outline-offset: 4px; }
html[data-links="underline"] a:not(.button, .school-button) { text-decoration-line: underline; text-decoration-thickness: .1em; text-underline-offset: .18em; }
html[data-contrast="more"] :focus-visible { outline-width: 4px; outline-style: double; outline-offset: 4px; }
html[data-motion="reduce"] { scroll-behavior: auto!important; }
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after { animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; scroll-behavior: auto!important; }
@media(prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto!important; }
  *, *::before, *::after { animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; scroll-behavior: auto!important; }
}
@media(max-width: 800px) {
  .display-trigger > span { display: none; }
  .site-header__inner--dual { grid-template-columns: minmax(0, 1fr) auto auto; }
  .site-header__inner--dual > .display-trigger { grid-column: 2; grid-row: 1; margin: 0; }
  .site-header__inner--dual > .account-menu { grid-column: 3; grid-row: 1; }
  .display-dialog { padding: 22px; }
  .display-dialog h2 { font-size: 21px; }
}
@media(forced-colors: active) {
  .display-dialog, .display-trigger, .display-close, .display-reset, .display-done, .display-theme-options label { forced-color-adjust: auto; border-color: ButtonText; }
  .display-theme-options label:has(:checked) { outline: 2px solid Highlight; }
}
@media print { .display-trigger, .display-dialog { display: none!important; } }
