@charset "UTF-8";
/* Accessibility widget (floating trigger + panel). Global, class-scoped: rendered once in _Layout.cshtml
   for every authenticated screen, so it survives #ms-content swaps without re-initializing.

   Toggle rows are the app's own .ms-toggle-card--bare switch (app.scss) — this file only styles what is
   specific to the widget: the trigger, the panel chrome, the icon badges and the font-size/line-height/
   letter-spacing steppers. */
/* WCAG 1.4.3 (Contrast Minimum, AA): --ms-text-muted / Bootstrap's --bs-secondary-color (#718096 on
   white) measures ~4.02:1 in the LIGHT theme — under the 4.5:1 small text needs. It's an app-wide token
   (used well beyond this widget), so a replacement is defined HERE instead of touched globally — this
   widget's own small text (the panel subtitle, stepper values, "Restablecer ajustes", every switch's
   .form-text description — 11 of those alone, and the "listar enlaces" overlay, which is NOT a
   descendant of .ms-a11y: js/accessibility.js appends it straight to <body>) needed to actually pass,
   without changing how any other screen in the app looks. Defined on html rather than scoped to .ms-a11y
   so that overlay can reach it too — harmless: a custom property does nothing anywhere it isn't
   explicitly consumed with var(), and only this file's own rules do. Dark theme's muted (#9ca3af on
   #1D3248, ~5.17:1) already clears AA on its own, so it's left as the same token there. */
html {
  --ms-a11y-muted: color-mix(in srgb, var(--ms-text-muted) 55%, var(--ms-text) 45%);
  /* The widget draws its own hairlines instead of borrowing --ms-border. That token is tuned to be
     nearly invisible at rest — right for a card sitting IN the page, wrong for a panel floating OVER
     it, which has to state its own edges and the lines between its sections. Mixed from the text
     colour so it follows the theme instead of being a second literal to keep in sync. */
  --ms-a11y-border: color-mix(in srgb, var(--ms-text) 20%, transparent);
  --ms-a11y-panel-surface: var(--ms-surface);
  --ms-a11y-panel-shadow: var(--ms-shadow-modal);
}

html[data-bs-theme=dark],
html.dark {
  --ms-a11y-muted: var(--ms-text-muted);
  /* At night --ms-border is #1f2937, which against the brand-derived dark surface is a line you
     cannot see: the panel and its sections lost their edges entirely. Drawn with light instead. */
  --ms-a11y-border: color-mix(in srgb, #ffffff 24%, transparent);
  /* A shadow separates nothing on a dark background — there is no light left to take away. So the
     panel is LIFTED off the page by tone: its own surface sits above the one its sections use, which
     is what makes it read as floating rather than as a hole cut in the screen. */
  --ms-a11y-panel-surface: color-mix(in srgb, #ffffff 8%, var(--ms-surface));
  --ms-a11y-panel-shadow: 0 1.5rem 3rem -0.75rem rgb(0 0 0 / .7),
                          0 0 0 1px color-mix(in srgb, #ffffff 12%, transparent);
}

/* Shared floating button: accessibility and mobile student actions use the same geometry and motion.
   Accessibility overrides the default side and remains draggable; its panel follows the trigger. */
.ms-floating-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 1081;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 3.25rem;
  height: 3.25rem;
  border: 0;
  border-radius: var(--ms-radius-pill);
  background: var(--ms-floating-trigger-color, var(--brand-color, var(--ms-primaryColor)));
  color: #fff;
  box-shadow: var(--ms-shadow-dropdown);
  cursor: pointer;
  touch-action: manipulation;
}
.ms-floating-trigger[hidden] {
  display: none;
}
.ms-floating-trigger {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, background-color 0.15s ease;
  /* Entrance: a springy pop with a little wobble, so a first-time reader notices a new control
     landing on the screen instead of just appearing. */
  animation: ms-a11y-pop-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ms-floating-trigger .material-symbols-outlined {
  font-size: 26px;
}
.ms-floating-trigger {
  /* ::before — LANDING ring: expands out from the button and fades, once, right after it lands on
     the screen. A "something just arrived here" cue, like a notification badge, gone for good once
     it's played. */
}
.ms-floating-trigger::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ms-floating-trigger-color, var(--brand-color, var(--ms-primaryColor)));
  pointer-events: none;
  animation: ms-a11y-ring-out 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}
.ms-floating-trigger {
  /* ::after — HOVER ring: a small pulse that only exists while the pointer is over the button, an
     invitation to click rather than an announcement — noticeably tighter and quieter than the landing
     ring above (::before), and it repeats for as long as the hover lasts instead of playing once. */
}
.ms-floating-trigger::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 2px solid var(--ms-floating-trigger-color, var(--brand-color, var(--ms-primaryColor)));
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}
.ms-floating-trigger:hover {
  background: color-mix(in srgb, var(--ms-floating-trigger-color, var(--brand-color, var(--ms-primaryColor))) 84%, #000 16%);
  transform: translateY(-3px) scale(1.06);
  box-shadow: var(--ms-shadow-modal);
}
.ms-floating-trigger:hover::after {
  animation: ms-a11y-hover-ring 1.3s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.ms-floating-trigger:active {
  background: color-mix(in srgb, var(--ms-floating-trigger-color, var(--brand-color, var(--ms-primaryColor))) 70%, #000 30%);
  transform: translateY(-1px) scale(0.9);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.1s ease;
  /* The invitation stops once the invitation has been accepted. */
}
.ms-floating-trigger:active::after {
  animation: none;
  opacity: 0;
}
.ms-floating-trigger:focus-visible {
  outline: 2px solid var(--ms-terciaryColor);
  outline-offset: 2px;
}
.ms-floating-trigger.is-dragging {
  cursor: grabbing;
  transition: none;
  animation: none;
}
.ms-floating-trigger.is-dragging::before, .ms-floating-trigger.is-dragging::after {
  display: none;
}

.ms-a11y-trigger {
  left: 1.25rem;
  right: auto;
  cursor: grab;
  touch-action: none;
}

.ms-actions-trigger {
  --ms-floating-trigger-color: var(--ms-primary);
  display: none;
}
@media (max-width: 991.98px) {
  .ms-actions-trigger {
    display: flex;
  }
}
.ms-actions-trigger[hidden] {
  display: none;
}
.ms-actions-trigger[aria-expanded=true] .material-symbols-outlined {
  transform: rotate(45deg);
}

@keyframes ms-a11y-pop-in {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-18deg) translateY(20px);
  }
  55% {
    opacity: 1;
    transform: scale(1.14) rotate(5deg) translateY(-5px);
  }
  78% {
    transform: scale(0.94) rotate(-2deg) translateY(1px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg) translateY(0);
  }
}
@keyframes ms-a11y-ring-out {
  from {
    opacity: 0.45;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.9);
  }
}
@keyframes ms-a11y-hover-ring {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ms-floating-trigger {
    animation: none;
  }
  .ms-floating-trigger::before {
    animation: none;
    display: none;
  }
  .ms-floating-trigger:hover::after {
    animation: none;
    opacity: 0.35;
  }
}
.ms-a11y-panel {
  position: fixed;
  z-index: 1080;
  right: 1.25rem;
  bottom: 5.25rem;
  width: min(24rem, 100vw - 2.5rem);
  max-height: min(38rem, 100vh - 6rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--ms-text);
  /* Open/close: scales and fades from the corner it grows out of (near the trigger, bottom-left by
     default) instead of just popping in/out — js/accessibility.js toggles .is-visible one frame after
     clearing [hidden] (open) and removes it before re-adding [hidden] once the transition ends (close),
     so both directions actually play. */
  transform-origin: bottom right;
  opacity: 0;
  transform: scale(0.9) translateY(10px);
  transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.ms-a11y-panel[hidden] {
  display: none;
}
.ms-a11y-panel.is-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.ms-a11y-panel-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--ms-a11y-panel-surface);
  border: 1px solid var(--ms-a11y-border);
  border-radius: var(--ms-radius-lg);
  box-shadow: var(--ms-a11y-panel-shadow);
}

.ms-a11y-dismiss {
  flex-shrink: 0;
  align-self: flex-end;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ms-danger);
  font-size: 0.78rem;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.ms-a11y-dismiss:focus-visible {
  outline: 2px solid var(--ms-terciaryColor);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ms-a11y-panel {
    transition: none;
  }
}
/* --- Header: icon badge + title/subtitle, like a single-page section header ------------------- */
.ms-a11y-panel-header {
  flex-shrink: 0; /* chrome, never squeezed by an overflowing body — see .ms-a11y-section */
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--ms-a11y-border);
  /* A soft brand wash instead of a flat divider line: signals "this is the panel's identity",
     not just another row. */
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-color, var(--ms-primaryColor)) 6%, var(--ms-a11y-panel-surface)), var(--ms-a11y-panel-surface));
}

.ms-a11y-panel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--ms-radius-pill);
  background: color-mix(in srgb, var(--brand-color, var(--ms-primaryColor)) 14%, var(--ms-surface));
  color: var(--brand-color, var(--ms-primaryColor));
}
.ms-a11y-panel-icon .material-symbols-outlined {
  font-size: 22px;
}

.ms-a11y-panel-heading {
  flex: 1 1 auto;
  min-width: 0;
}

.ms-a11y-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.ms-a11y-panel-subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--ms-a11y-muted);
}

.ms-a11y-panel-header-actions {
  flex: 0 0 auto;
}

.ms-a11y-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: var(--ms-radius);
  background: transparent;
  color: var(--ms-text-muted);
  cursor: pointer;
}
.ms-a11y-close .material-symbols-outlined {
  font-size: 20px;
}
.ms-a11y-close:hover {
  background: var(--ms-table-hover);
  color: var(--ms-text);
}
.ms-a11y-close {
  /* Inset, not outset: this button sits close to the panel's rounded top-right corner, and the panel
     itself clips with overflow:hidden — an outward outline risked being cut off right where it needs
     to be most visible (WCAG 2.4.7). Same reasoning as .ms-a11y-section-trigger below. */
}
.ms-a11y-close:focus-visible {
  outline: 2px solid var(--ms-terciaryColor);
  outline-offset: -2px;
}

/* --- Body: sections, each with its own icon-led header ------------------------------------------ */
.ms-a11y-panel-body {
  /* .ms-a11y-panel is display:flex, and a flex item's default min-height is AUTO — it refuses to
     shrink below its own content's natural size no matter what the parent's max-height/overflow say.
     That meant once an open section pushed the total content past the panel's cap, THIS never actually
     got squeezed down to where its own overflow-y:auto would kick in — the PARENT's overflow:hidden
     hard-clipped the bottom of the panel instead, with no scrollbar anywhere. min-height: 0 lets this
     actually shrink to the space it's given, which is what makes its own scrolling engage at all. */
  min-height: 0;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  /* Stop wheel/touch scroll from chaining into the page behind once this reaches ITS OWN top/bottom
     edge — the primary defense; js/accessibility.js adds a wheel guard on the whole panel as a
     fallback for the "no overflow at all" case this alone doesn't cover in every engine. */
  overscroll-behavior: contain;
  /* Thin, brand-tinted scrollbar — the app's own recipe (account-profile__permission-list,
     profile.scss) instead of the OS default slab, which read as too heavy for a small popover. */
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--brand-color, var(--ms-primaryColor)) 35%, transparent) transparent;
}

.ms-a11y-panel-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.ms-a11y-panel-body::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--brand-color, var(--ms-primaryColor)) 5%, transparent);
  border-radius: 4px;
}

.ms-a11y-panel-body::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand-color, var(--ms-primaryColor)) 40%, transparent);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.ms-a11y-panel-body::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--brand-color, var(--ms-primaryColor)) 60%, transparent);
}

/* --- Accordion: js/accessibility.js measures real content and animates a pixel height ---------------
   Two CSS-only techniques were tried and dropped here: ::details-content/interpolate-size (what "Acceso
   al panel" in Mi perfil uses, profile.scss) animates height:auto directly and, on a box whose last row
   wraps to two lines, kept the interpolated height just short of that — the description spilled out
   under the section's rounded border. grid-template-rows 0fr→1fr avoided that but, inside this panel's
   flex-column body, froze every CLOSED section at whatever height it last had open — the flex item's
   intrinsic sizing kept fighting the grid track's animated one. A measured pixel height sidesteps both:
   there is no intrinsic-size negotiation, the JS just sets the number it already knows is correct. */
.ms-a11y-section {
  /* .ms-a11y-panel-body is a flex column, and a flex item's default flex-shrink:1 lets the LAYOUT
     compress it below its own content's size whenever the stack doesn't fit the available space —
     which is exactly what was happening: with an open section's real content taller than the panel's
     remaining room, flexbox squeezed every section (open one included) rather than ever letting
     panel-body's own overflow-y:auto engage, so there was nothing to scroll TO — the content had
     already been silently shrunk to fit instead of overflowing. flex-shrink:0 makes every section keep
     its true content height no matter what; once that stack is taller than panel-body's box, THAT is
     what finally makes panel-body's scrollbar do its job. Collapsed sections still shrink to nothing —
     that's driven by .ms-a11y-section-content's own explicit height, not by this. */
  flex-shrink: 0;
  /* The outline is an INSET SHADOW, not a border, and the header below it is transparent — the two
     halves of the same fix. A 1px border on a box that also carries `overflow: hidden` and a radius
     gets eaten on the STRAIGHT sides: the rounded clip's own antialiasing lands on the very pixel
     the border occupies, and the trigger's opaque background finished the job, so the trace only
     survived on the corner arcs — the sections read as four little brackets instead of a card, in
     both themes. An inset shadow is painted from the padding box inwards, where nothing clips it,
     and it follows the same radius, so all four sides are drawn at full strength. */
  box-shadow: inset 0 0 0 1px var(--ms-a11y-border);
  border-radius: var(--ms-radius-lg);
  background: var(--ms-surface);
  overflow: hidden;
}

/* The clipping/animating element is SEPARATE from the content it clips (below): the content carries
   every row's flex/gap/icon layout, and animating `height` directly ON it forced the browser to re-run
   that whole layout on every frame — visible as adjacent rows' text briefly overlapping mid-transition.
   This wrapper has no layout of its own beyond a single child, so animating its height is cheap: the
   content inside is computed ONCE and simply revealed/hidden by the growing/shrinking clip window, never
   re-measured or repositioned while that happens. */
.ms-a11y-section-collapse {
  height: 0;
  overflow: hidden;
  transition: height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .ms-a11y-section-collapse {
    transition: none;
  }
}
/* --- Header: the WHOLE row is the disclosure button ---------------------------------------------- */
.ms-a11y-section-title {
  margin: 0;
}

.ms-a11y-section-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 0;
  /* Transparent, so the section's own surface and its inset outline show through: an opaque
     background here was painting over the outline of the box it sits in. The hover is therefore a
     TINT (translucent) rather than a colour of its own — the same tone --ms-table-hover mixes, but
     over whatever is underneath instead of replacing it. */
  background: transparent;
  color: var(--ms-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ms-a11y-section-trigger:hover {
  background: color-mix(in srgb, var(--ms-text) 5%, transparent);
}
.ms-a11y-section-trigger:focus-visible {
  outline: 2px solid var(--ms-terciaryColor);
  outline-offset: -2px;
}

.ms-a11y-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: var(--ms-radius);
  background: var(--ms-table-hover);
  color: var(--ms-text-muted);
}
.ms-a11y-section-icon .material-symbols-outlined {
  font-size: 17px;
}

.ms-a11y-section-label {
  flex: 1 1 auto;
  font-size: 0.82rem;
  font-weight: 600;
}

.ms-a11y-section-chevron {
  flex: 0 0 auto;
  font-size: 20px;
  color: var(--ms-text-muted);
  transition: transform 0.18s ease;
}

.ms-a11y-section--open .ms-a11y-section-icon {
  background: color-mix(in srgb, var(--brand-color, var(--ms-primaryColor)) 14%, var(--ms-surface));
  color: var(--brand-color, var(--ms-primaryColor));
}
.ms-a11y-section--open .ms-a11y-section-chevron {
  transform: rotate(180deg);
}

/* Unconditional padding/border here is safe NOW — unlike when this element was also the one animating
   height:0 (box-sizing:border-box never lets a box render shorter than its own padding, which was the
   "sliver" every closed card kept showing no matter what height said). This element no longer controls
   its own visibility at all: .ms-a11y-section-collapse above does, by clipping it at height:0 from the
   OUTSIDE, so this can just be its natural, always-the-same size. */
.ms-a11y-section-content {
  padding: 0.7rem 0.85rem 0.85rem;
  border-top: 1px solid var(--ms-a11y-border);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* --- Steppers: their own card row, same visual weight as a toggle card ------------------------- */
.ms-a11y-steppers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ms-a11y-stepper-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--ms-a11y-border);
  border-radius: var(--ms-radius-lg);
  background: var(--ms-surface);
}

.ms-a11y-stepper-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}
.ms-a11y-stepper-label .material-symbols-outlined {
  font-size: 18px;
  color: var(--ms-text-muted);
}

.ms-a11y-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 0.35rem;
}

.ms-a11y-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid var(--ms-a11y-border);
  border-radius: var(--ms-radius-sm);
  background: var(--ms-surface);
  color: var(--ms-text);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ms-a11y-step:hover {
  background: var(--ms-table-hover);
  border-color: var(--brand-color, var(--ms-primaryColor));
}
.ms-a11y-step:focus-visible {
  outline: 2px solid var(--ms-terciaryColor);
  outline-offset: 2px;
}
.ms-a11y-step:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ms-a11y-step-value {
  min-width: 1.4rem;
  text-align: center;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--ms-a11y-muted);
}

/* --- Toggle rows: riding on .ms-toggle-card--bare (app.scss), only the icon+title line is ours --- */
.ms-a11y-toggle-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ms-a11y-toggle-title .material-symbols-outlined {
  font-size: 18px;
  color: var(--ms-text-muted);
}

.ms-a11y-section .ms-toggle-card--bare {
  /* .ms-toggle-card defaults its accent to brand orange (app.scss) — a colour this widget's own accent
     (the section icons/chevrons, brand blue) doesn't use anywhere else, so a checked switch read as an
     unrelated colour system. Overriding the custom property is the sanctioned way to retint one
     (app.scss's own --success variant works the same way). */
  --ms-toggle-accent: var(--brand-color, var(--ms-primaryColor));
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--ms-a11y-border);
  border-radius: 0;
}
.ms-a11y-section .ms-toggle-card--bare:last-child {
  border-bottom: 0;
}

/* --- Perfiles: mutually exclusive, Readabler-style — only one applies at a time (js/accessibility.js
   unchecks/reverts any other one the moment a reader turns one on, and disables the rest while it's
   active). Nothing to style here beyond what .ms-toggle-card already does on its own: the checked card's
   accent switch (app.scss) and the greyed-out/not-allowed look for the three sitting out, which comes
   free from app.scss's own .ms-toggle-card:has(.form-check-input:disabled) rule. A checked card's
   description stays exactly what it is at rest — an earlier version swapped in a longer paragraph on
   check, which read as the switch's own title/description changing, not just its state. --- */
/* Every switch's description line (.ms-toggle-card__description, app.scss) is Bootstrap's own
   .form-text, which colors itself with --bs-secondary-color — the SAME under-contrast token as
   --ms-text-muted (see the WCAG 1.4.3 note at the top of this file). Re-declared here, scoped to this
   widget only: 11 of these across the panel made it the single biggest chunk of failing text. */
.ms-a11y .form-text {
  color: var(--ms-a11y-muted);
}

/* --- Footer: the reset action, set apart from the feature list ---------------------------------- */
.ms-a11y-panel-footer {
  flex-shrink: 0; /* chrome, never squeezed by an overflowing body — see .ms-a11y-section */
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--ms-a11y-border);
}

/* Rides on the app's own .ms-button--secondary (mn-button, buttons.scss) for its actual look — this
   only adds what's specific to sitting alone in the panel footer: full width, no extra margin. */
.ms-a11y-reset {
  width: 100%;
  justify-content: center;
}

@media (max-width: 575.98px) {
  .ms-a11y {
    right: 0.75rem;
    bottom: 0.75rem;
  }
  .ms-a11y-panel {
    right: -0.75rem;
    width: calc(100vw - 1.5rem);
  }
}
/* ===================================================================================================
   Feature effects — what each control in the panel actually does (js/accessibility.js toggles these
   classes/custom properties on <html>). Scoped to .ms-shell (topbar+sidebar+#ms-content) rather than
   <html> itself wherever that's meaningful, so the accessibility widget's OWN chrome — rendered outside
   .ms-shell on purpose (_Layout.cshtml) — is never grayscaled/inverted/contrast-shifted into
   unreadability by the very controls that turn those effects on.
   =================================================================================================== */
/* --- Readability: text size / line height / letter spacing --------------------------------------
   `zoom` on .ms-shell (topbar + sidebar + #ms-content — the whole authenticated app, everything BUT
   this widget's own panel, which _Layout.cshtml renders as .ms-shell's sibling on purpose), not a root
   font-size scale. This app's typography is a MIX of rem (most of app.scss/singles.scss) and hard px
   (cloudminerva.scss, ported as-is from the original React dashboard — variables.scss says so
   explicitly). A root font-size change only ever reached the rem half: the dashboard's map card, KPI
   tiles and chart — all px-sized — never moved, which is what "the text size control doesn't actually
   change most of the screen" was. `zoom` sidesteps unit politics entirely — it scales rendered pixels,
   exactly like the browser's own zoom, so px and rem content grow together. Scoping it to .ms-shell
   rather than html means the widget's own panel stays at its normal, always-usable size regardless of
   what a reader sets here — everything a reader is meant to read or navigate scales; the control panel
   for scaling it does not need to scale itself. */
.ms-shell {
  zoom: var(--ms-a11y-font-scale, 1);
}

/* line-height: still the broad-force approach — a plain inherited declaration only ever reached text
   with no line-height of its own, and most components DO declare one (buttons, badges, uppercase
   labels…). WCAG 1.4.12 (Text Spacing) exists precisely because a real text-spacing control has to win
   over a component's own styling, not politely ask for it — so this is `!important`, on every element,
   the same trade real "increase text spacing" tools make. Material Symbols is excluded: those glyphs are
   picked by a font LIGATURE on plain text ("close", "search"…), and messing with their line box risks the
   same kind of rendering trouble letter-spacing had on them (below). Gated behind its own class
   (js/accessibility.js) so this only activates once the control is actually away from 0. */
html.ms-a11y-fx-line .ms-shell :where(*):not(.material-symbols-outlined) {
  line-height: calc(1.5 + var(--ms-a11y-line-add, 0)) !important;
}

/* letter-spacing: NOT the same broad-force approach any more. A flat !important value replaced every
   element's OWN tracking outright instead of adding to it — a plain paragraph (spacing 0) grew correctly,
   but an uppercase label already tracked out to 0.16–0.3em (kickers, section titles, table headers — ~110
   spots across the app) got FORCED DOWN to this control's much smaller flat value, reading as suddenly
   cramped the moment the control turned on. The real fix lives at the source: every letter-spacing
   declaration in the app (app.scss, cloudminerva.scss, personlist.scss, singles.scss, tables.scss,
   topbar.scss, login.scss, profile.scss, security.scss, sidebar.scss, twofactor.scss, builder.scss,
   fill.scss, _global-search.scss, _mixins.scss, variables.scss) now reads
   `calc(<its own original value> + var(--ms-a11y-letter-add, 0em))` — each element grows from ITS OWN
   starting point, and at rest (control untouched, the var is unset) every one of those calc()s resolves
   back to exactly its original value, so nothing anywhere looks different. What's left here is just the
   fallback for the (majority of) elements that never declared their own letter-spacing to begin with —
   which plain inheritance already reaches correctly, no !important needed. */
.ms-shell {
  letter-spacing: var(--ms-a11y-letter-add, 0);
}

/* The dashboard's KPI numbers (.cm-counter-value & 3 siblings, font-variant-numeric: tabular-nums,
   cloudminerva.scss) went through two theories before this one. First, that Chromium was silently
   dropping the tabular-figure feature once letter-spacing went non-zero — re-asserting it !important
   didn't help. Then, that the glyphs themselves render narrower — but isolating a SINGLE element with
   Range-based per-character measurement (immune to any layout side effects) showed the visible gap
   between "1" and "0" completely unchanged, while the element's own advance width still grew correctly.
   What actually produced the earlier "shrinks to 66px" reading was the KPI value's flex-column SIBLING —
   the label above it (.cm-counter-label) — which, under the OLD flat-override bug this file no longer
   has, was forced NARROWER than its own 0.16em tracking; since flex column children stretch to the
   widest one by default, the value's box shrank along with its sibling, not because of anything happening
   to the value itself. With every declaration now additive from its own base (including these four,
   rewritten as calc(0em + var(...)) same as everywhere else), that side effect is gone: nothing here
   needs a special exception. */
/* --- Fuente para dislexia: a legible SYSTEM stack, not a dedicated dyslexia typeface — see the
   js/accessibility.js header comment for why.

   .ms-shell alone only ever reached the topbar/sidebar: the dashboard's own root wrapper (.cm-shell,
   cloudminerva.scss) declares its OWN explicit font-family (system-ui, and again on two of its own
   variants) — an explicit value always wins over an ancestor's, so nothing under it ever saw the
   inherited change. .cm-shell needs its own override, same reasoning every other "component declares its
   own value" case in this file has run into (letter-spacing, the topbar's vw widths). !important because
   .ms-theme .cm-shell and html:not(.dark) .cm-shell.cm-shell--plain both carry their own font-family too,
   at a specificity this would otherwise have to out-guess. */
html.ms-a11y-fx-dyslexia .ms-shell,
html.ms-a11y-fx-dyslexia .ms-shell .cm-shell {
  font-family: Verdana, Tahoma, "Trebuchet MS", Arial, sans-serif !important;
}

/* --- Zoom-safety: the topbar's search box + tenant-name clamp are sized in `vw` (topbar.scss), which
   keeps resolving against the REAL browser viewport under `zoom` — everything else in the topbar's grid
   shrinks in step with the zoom, those two didn't, and the search box overran the "Ayuda"/actions column
   beside it. Swapped to plain rem here, active only while zoom is (js/accessibility.js). Nothing changes
   for a reader who hasn't touched "Tamaño del texto" — the class isn't present, this whole block is inert. */
html.ms-a11y-fx-zoom .ms-topbar-brand-tenant {
  max-width: 10rem;
}

html.ms-a11y-fx-zoom .ms-topbar-center {
  width: 17rem;
}
html.ms-a11y-fx-zoom .ms-topbar-center:focus-within, html.ms-a11y-fx-zoom .ms-topbar-center.is-open {
  width: 24rem;
}

/* --- Resaltar títulos --------------------------------------------------------------------------- */
html.ms-a11y-fx-headings #ms-content :is(h1, h2, h3, h4, h5, h6) {
  outline: 2px dashed var(--brand-color, var(--ms-primaryColor));
  outline-offset: 3px;
  background: color-mix(in srgb, var(--brand-color, var(--ms-primaryColor)) 8%, transparent);
}

/* --- Resaltar enlaces ---------------------------------------------------------------------------- */
html.ms-a11y-fx-links .ms-shell a {
  background: color-mix(in srgb, var(--brand-color, var(--ms-primaryColor)) 14%, transparent) !important;
  color: var(--brand-color, var(--ms-primaryColor)) !important;
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 2px !important;
}

/* --- Alto contraste / Blanco y negro / Invertir colores --------------------------------------------
   Composed into ONE filter value in JS (any combination of the three has to render TOGETHER, and CSS
   filter doesn't compose across separate rules — the last one to match simply wins outright).
   Applied to `.ms-main` (topbar + #ms-content) and the widget's own fixed pieces individually, NOT to
   `.ms-shell`/`body`/`<html>` — every shared-ancestor option broke something when tried live:
   - Putting `filter` on ANY ancestor makes that ancestor the CSS containing block for every
     `position: fixed` descendant (same rule as `transform`) — confirmed live on `body`: with the a11y
     panel open (`bottom`/`left` in px, computed against the viewport), toggling a filter on mid-open
     re-anchored it against `body`'s full scrollable-document box instead, and the panel jumped off
     screen. The same page-vs-viewport mismatch would silently turn every `position: fixed` element
     into something that scrolls away with the page instead of staying put, for as long as any filter
     here is active.
   - `.ms-sb` (the sidebar, also `position: fixed`) turns out not to visually repaint under a `filter`
     colour transform AT ALL, on this one element specifically, regardless of whether that filter comes
     from an ancestor or is set directly on it — see the dedicated override and its comment below.
   Filtering each fixed element directly (not through an ancestor) avoids the containing-block problem:
   a filter on an element does not change that element's OWN containing block, only its descendants'. */
.ms-main,
.ms-floating-trigger,
[data-ms-mobile-actions]:popover-open,
.ms-a11y-panel,
.ms-a11y-linklist {
  filter: var(--ms-a11y-shell-filter, none);
}

/* The sidebar's colour override for these three modes is set as DIRECT inline styles in
   accessibility.js, not here as a class-gated rule — read that comment (next to where
   `sidebarEl.style...` is set) for the full story. Short version: `filter` never repaints this one
   composited fixed element's colours at all (blur does; colour transforms don't), and the `box-shadow`
   fallback that DOES work when set as a direct style mutation on the element stops working the moment
   it's wired through a stylesheet rule keyed off a class toggle instead — even a class toggled on the
   sidebar element itself, not just an ancestor. Nothing here to gate on: this comment exists so the
   next person doesn't "simplify" the sidebar's colours back into CSS and silently reintroduce the bug. */
/* Alto contraste's own `contrast()` filter (composed in JS, above) AMPLIFIES colour that's already
   there — it can't draw an outline from nothing. Nearly every card/field border in the app shares one
   token (--ms-border, variables.scss) sitting close to white to begin with (a deliberately subtle
   divider at rest) — `contrast(1.9)` pushes values FURTHER from mid-grey in whichever direction they
   already lean, so a near-white border gets pushed even closer to white instead of darkening, and every
   card/field boundary across the app silently disappeared under this mode — confirmed live on an acta's
   "Datos" card and its read-only fields, both losing their outline entirely. Giving --ms-border a real,
   simple mid-tone here (not itself the final colour — just far enough from white that the SAME filter's
   own darkening actually has something to amplify) is what makes the filter's contrast boost work FOR
   borders instead of against them. Scoped to .ms-main, same reasoning as the filter selector two rules
   up: reaches every card/field across the app through the one shared token, without touching the
   widget's own chrome. */
html.ms-a11y-fx-contrast .ms-main {
  --ms-border: #7c8ba1;
}

/* Media gets a counter-invert layered ON TOP of the root filter above (not instead of it) — without
   this a photo would render as its own photographic negative under "Invertir colores", while
   contrast/grayscale (the other two, when also on) still need to reach it normally. */
img,
video,
svg,
iframe {
  filter: var(--ms-a11y-media-filter, none);
}

/* --- Cursor grande: a black arrow with a white outline so it reads on any background, roughly 2x the
   OS default. Inline SVG data URI — no asset file, no network request. --- */
html.ms-a11y-fx-cursor,
html.ms-a11y-fx-cursor * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><path d="M6 2 L6 34 L14 26 L19.5 37 L24.5 34.5 L19 24 L30 24 Z" fill="black" stroke="white" stroke-width="2.5" stroke-linejoin="round"/></svg>') 6 2, auto !important;
}

/* --- Pausar animaciones: CSS animations/transitions app-wide. Cannot reach canvas/JS-driven motion
   (the weather map's wind field, chart.js redraws) — those aren't CSS to begin with.
   Excludes the widget's own chrome (#ms-a11y: the trigger + panel), same reasoning `filter` above
   already applies to it — this setting is loaded and applied from localStorage BEFORE the trigger's
   one-time landing animation (ms-a11y-pop-in, entrance only, not decorative) gets a chance to run, so
   `animation-play-state: paused` froze it on its very first frame (opacity 0, scale .3) — permanently,
   since a paused animation never advances on its own. That left the reader who turned this ON unable
   to ever see or reach the trigger again to turn it back off. The rest of the app's decorative motion
   (this control's actual purpose) is still paused as intended. */
html.ms-a11y-fx-pause :not(#ms-a11y, #ms-a11y *, .ms-floating-trigger, .ms-floating-trigger *),
html.ms-a11y-fx-pause :not(#ms-a11y, #ms-a11y *, .ms-floating-trigger, .ms-floating-trigger *)::before,
html.ms-a11y-fx-pause :not(#ms-a11y, #ms-a11y *, .ms-floating-trigger, .ms-floating-trigger *)::after {
  animation-play-state: paused !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html.ms-a11y-fx-pause .ms-floating-trigger {
  animation: none !important;
  transition: none !important;
}
html.ms-a11y-fx-pause .ms-floating-trigger::before, html.ms-a11y-fx-pause .ms-floating-trigger::after {
  animation: none !important;
  display: none;
}

/* --- Resaltar foco: a thicker, higher-contrast focus ring than the app's own per-component ones,
   everywhere something can receive keyboard focus. */
html.ms-a11y-fx-focus :focus-visible {
  outline: 3px solid var(--ms-terciaryColor, #f2b705) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--ms-terciaryColor, #f2b705) 25%, transparent) !important;
}

/* --- Modo amigable con TDAH's reading guide: two dark masks (built by js/accessibility.js), one from
   the viewport top down to just above the cursor and one from just below it to the viewport bottom —
   the gap between them is the one strip of the screen left easy to look at. Below the widget itself
   (1080/1081) so the panel a reader is using to turn this ON/OFF is never dimmed by its own effect;
   above everything else, same tier as "Listar enlaces". pointer-events:none so it never blocks a click
   at whatever it's currently covering. */
.ms-a11y-focus-mask {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1079;
  background: rgba(8, 10, 18, 0.62);
  pointer-events: none;
}

.ms-a11y-focus-mask--top {
  top: 0;
  height: 0; /* js/accessibility.js sets this on every mousemove */
}

.ms-a11y-focus-mask--bottom {
  bottom: 0;
  top: 100%; /* js/accessibility.js sets this on every mousemove */
}

/* --- Lupa de texto: a floating box (built by js/accessibility.js) that follows the cursor, mirroring
   whatever text sits under it at a much larger size — Readabler's own "Text Magnifier". Highest z-index
   in the whole widget: it has to sit above the reading guide's own dimming mask too, or the ADHD profile
   and this control would fight over what's actually on top when both happen to be on at once. */
.ms-a11y-magnifier {
  display: none;
  position: fixed;
  z-index: 1082;
  max-width: 26rem;
  max-height: 16rem;
  overflow: auto;
  padding: 1rem 1.25rem;
  border-radius: var(--ms-radius-lg);
  background: var(--ms-a11y-panel-surface);
  color: var(--ms-text);
  border: 1px solid var(--ms-a11y-border);
  box-shadow: var(--ms-a11y-panel-shadow);
  font-size: 1.75rem;
  line-height: 1.4;
  pointer-events: none;
}
.ms-a11y-magnifier.is-visible {
  display: block;
}

/* --- Listar enlaces: a floating index of #ms-content's own links (built by js/accessibility.js) --- */
.ms-a11y-linklist {
  position: fixed;
  z-index: 1079; /* below the widget itself (1080/1081), above everything else */
  left: 1.25rem;
  bottom: 1.25rem;
  width: min(20rem, 100vw - 2.5rem);
  max-height: min(24rem, 100vh - 6rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ms-a11y-panel-surface);
  color: var(--ms-text);
  border: 1px solid var(--ms-a11y-border);
  border-radius: var(--ms-radius-lg);
  box-shadow: var(--ms-a11y-panel-shadow);
}

.ms-a11y-linklist-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--ms-a11y-border);
  font-size: 0.82rem;
  font-weight: 600;
}
.ms-a11y-linklist-header .material-symbols-outlined {
  font-size: 18px;
  color: var(--ms-text-muted);
}

.ms-a11y-linklist-header span:nth-child(2) {
  flex: 1 1 auto;
}

.ms-a11y-linklist-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: var(--ms-radius);
  background: transparent;
  color: var(--ms-text-muted);
  cursor: pointer;
}
.ms-a11y-linklist-close .material-symbols-outlined {
  font-size: 18px;
}
.ms-a11y-linklist-close:hover {
  background: var(--ms-table-hover);
  color: var(--ms-text);
}
.ms-a11y-linklist-close:focus-visible {
  outline: 2px solid var(--ms-terciaryColor);
  outline-offset: -2px;
}

.ms-a11y-linklist-empty {
  margin: 0;
  padding: 0.9rem;
  color: var(--ms-a11y-muted);
  font-size: 0.82rem;
}

.ms-a11y-linklist-items {
  margin: 0;
  padding: 0.5rem 0.9rem 0.9rem 2.1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ms-a11y-linklist-items li {
  font-size: 0.82rem;
}
.ms-a11y-linklist-items a {
  color: var(--brand-color, var(--ms-primaryColor));
  text-decoration: none;
}
.ms-a11y-linklist-items a:hover {
  text-decoration: underline;
}
