/* ============================================================
   Shared UX layer — applies Nielsen's heuristics site-wide.
   Self-contained, RTL, supports html.light AND [data-theme].
   ============================================================ */
:root { --ux-accent: #8250E7; --ux-accent2: #A855F7; }

/* #1 Visibility of system status — reading progress bar */
.reading-bar { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 70; background: transparent; pointer-events: none; }
.reading-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ux-accent), var(--ux-accent2)); box-shadow: 0 0 8px rgba(168,85,247,.5); transition: width .08s linear; }

/* #1/#9 Toast notifications — feedback + error recovery */
.toast-wrap { position: fixed; inset-block-end: 20px; inset-inline: 0; z-index: 9998; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 440px; display: flex; align-items: center; gap: 10px; background: #17131f; color: #fff; border: 1px solid #2a2440; border-radius: 13px; padding: 12px 16px; font-size: 14px; font-weight: 600; box-shadow: 0 14px 40px rgba(0,0,0,.45); transform: translateY(16px); opacity: 0; transition: transform .28s cubic-bezier(.16,1,.3,1), opacity .28s ease; }
.toast.in { transform: translateY(0); opacity: 1; }
.toast .ti { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.toast.ok .ti { background: rgba(34,197,94,.2); color: #4ade80; }
.toast.err .ti { background: rgba(239,68,68,.2); color: #f87171; }
.toast.info .ti { background: rgba(130,80,231,.22); color: #c4b5fd; }
html.light .toast, html[data-theme="light"] .toast { background: #fff; color: #16121f; border-color: #e6e3f0; }

/* #3/#6 Breadcrumbs — location + freedom to navigate up */
.crumbs { max-width: 1180px; margin: 0 auto; padding: 14px 24px 2px; font-size: 13px; color: var(--color-text-muted, #8b8699); display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--ux-accent2); }
.crumbs .sep { opacity: .5; }
.crumbs .cur { color: var(--color-text, #fff); font-weight: 700; }
html.light .crumbs .cur, html[data-theme="light"] .crumbs .cur { color: #16121f; }

/* #3 User control — skip to content link (keyboard/screen-reader) */
.skip-link { position: fixed; top: -60px; inset-inline-start: 12px; z-index: 9999; background: var(--ux-accent); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; text-decoration: none; transition: top .18s ease; }
.skip-link:focus { top: 12px; }

/* #3 back-to-top floating button (all pages incl. platform) */
.to-top { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 60; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: #17131f; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.28); opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .22s ease, transform .22s ease, background .18s; }
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: linear-gradient(150deg, #8250E7, #5B34A8); color: #fff; border-color: transparent; }
.to-top svg { width: 20px; height: 20px; }
html.light .to-top, html[data-theme="light"] .to-top { background: #fff; color: #16121f; border-color: #e6e3f0; }

/* #4 Consistency — one visible keyboard-focus ring everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--ux-accent2); outline-offset: 2px; border-radius: 6px;
}
