/* Device preferences (prism-prefs.js, 2026-10-30). prism-prefs.js sets data-* attributes on <html> before the first
   paint; these rules apply them on every page. "Match system" follows the OS (prefers-reduced-motion, prefers-contrast). */

/* ---- Motion */
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;
  transition-delay:0s!important;scroll-behavior:auto!important}
@media (prefers-reduced-motion:reduce){
  html:not([data-motion="allow"]) *,html:not([data-motion="allow"]) *::before,html:not([data-motion="allow"]) *::after{
    animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;
    transition-delay:0s!important;scroll-behavior:auto!important}
}

/* ---- High contrast: darker secondary text and visible borders. Selectors out-rank the shell's own token rules
   (body.sv-shell and :root[data-theme="dark"] body.sv-shell in spectra-home.css). */
html[data-contrast="more"][data-theme]:not([data-theme="dark"]),
html[data-contrast="more"][data-theme]:not([data-theme="dark"]) body.sv-shell{
  --secondary:#27272a;--muted:#3f3f46;--disabled:#52525b;--border:#a1a1aa;--vc-muted:#3f3f46;--vc-line:#a1a1aa;--sv-pane-line:#a1a1aa}
html[data-contrast="more"][data-theme="dark"],
html[data-contrast="more"][data-theme="dark"] body.sv-shell{
  --secondary:#e4e4e7;--muted:#d4d4d8;--disabled:#a1a1aa;--border:#71717a;--vc-muted:#d4d4d8;--vc-line:rgba(255,255,255,.32);--sv-pane-line:#52525b}
@media (prefers-contrast:more){
  html[data-contrast="system"][data-theme]:not([data-theme="dark"]),
  html[data-contrast="system"][data-theme]:not([data-theme="dark"]) body.sv-shell{
    --secondary:#27272a;--muted:#3f3f46;--disabled:#52525b;--border:#a1a1aa;--vc-muted:#3f3f46;--vc-line:#a1a1aa;--sv-pane-line:#a1a1aa}
  html[data-contrast="system"][data-theme="dark"],
  html[data-contrast="system"][data-theme="dark"] body.sv-shell{
    --secondary:#e4e4e7;--muted:#d4d4d8;--disabled:#a1a1aa;--border:#71717a;--vc-muted:#d4d4d8;--vc-line:rgba(255,255,255,.32);--sv-pane-line:#52525b}
}

/* ---- Focus ring: "Always strong" draws a thick outline on whatever has keyboard focus, overriding page styles. */
html[data-focus="strong"] :focus-visible{outline:3px solid var(--tech-blue,#004dc0)!important;outline-offset:2px!important;
  box-shadow:0 0 0 5px var(--page,#fff)!important}
html[data-focus="strong"][data-theme="dark"] :focus-visible{outline-color:#8fc2ff!important}

/* ---- Links: underline in-text links (not buttons, cards or navigation styled as links). */
html[data-links="underline"] #main a:not([class]),html[data-links="underline"] #main p a,
html[data-links="underline"] #main td a,html[data-links="underline"] #main li a:not([class*="nav"]){
  text-decoration:underline!important;text-underline-offset:2px}

/* ---- Settings > Appearance & accessibility */
.pp-seg{display:inline-flex;flex-wrap:wrap;gap:2px;margin:0;padding:2px;border:1px solid var(--vc-line,var(--border));border-radius:8px;
  background:var(--vc-fill,var(--soft))}
.pp-seg label{position:relative;display:inline-flex}
.pp-seg input{position:absolute;inset:0;margin:0;opacity:0;cursor:pointer}
.pp-seg span{display:inline-flex;align-items:center;min-height:28px;padding:0 11px;border-radius:6px;color:var(--secondary,var(--text));
  font:400 13px/1 Inter,Arial,sans-serif;white-space:nowrap}
.pp-seg label:hover span{color:var(--text)}
.pp-seg input:checked+span{background:var(--vc-card,var(--surface));color:var(--text);font-weight:500;box-shadow:0 0 0 1px var(--vc-line,var(--border))}
.pp-seg input:focus-visible+span{outline:2px solid var(--tech-blue,#004dc0);outline-offset:1px}
.pp-note{margin:6px 0 0;color:var(--vc-muted,var(--muted));font:400 12px/16px Inter,Arial,sans-serif}
.pp-keys{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:10px 18px;margin:0;align-items:center}
.pp-keys dt{display:flex;gap:4px}
.pp-keys dd{margin:0;color:var(--secondary,var(--text));font:400 13px/18px Inter,Arial,sans-serif}
.pp-keys kbd,.pp-kbd{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 6px;
  border:1px solid var(--vc-line,var(--border));border-bottom-width:2px;border-radius:6px;background:var(--vc-card,var(--surface));
  color:var(--text);font:500 12px/1 Inter,Arial,sans-serif}
@media (max-width:640px){
  .pp-row{grid-template-columns:1fr;gap:8px}
  .pp-seg span{min-height:32px}
}

/* Account menu: PRISM credits this month (2026-10-31; app.js fillAccountUsage). Lives here because this sheet loads on
   every page; style.css is shared. */
.account-menu button.account-menu-usage{height:auto;min-height:39px;padding:8px 10px;align-items:center}
.account-menu-usage .amu{display:flex;flex-direction:column;gap:6px;flex:1;min-width:0}
.account-menu-usage .amu-row{display:flex;justify-content:space-between;gap:8px}
.account-menu-usage .amu-num{color:var(--muted);font-variant-numeric:tabular-nums}
.account-menu-usage .amu-bar{display:block;height:4px;border-radius:2px;background:var(--border);overflow:hidden}
.account-menu-usage .amu-bar>span{display:block;height:100%;width:0;border-radius:2px;background:var(--tech-blue)}
