/* Accessibility panel + settings (Account > Accessibility). Applies to every logged-in page that loads the shared head (_ui_head.html).
   Settings are html[data-*] attributes set before first paint by lf-boot.js. Not loaded on other people's link-in-bio pages (only on LinkForge's own pages and the demo page). */

/* ---- always on: skip link + visible keyboard focus ---- */
.lf-skip { position: fixed; left: .75rem; top: .75rem; z-index: 3000; transform: translateY(-200%); background: #fff; color: #111; font: 700 .95rem/1.2 system-ui, sans-serif; padding: .75rem 1rem; border-radius: 10px; border: 2px solid #7e22ce; text-decoration: none; }
.lf-skip:focus, .lf-skip:focus-visible { transform: none; outline: 3px solid #111; outline-offset: 2px; }
html :focus-visible { outline: 2px solid var(--focus, #c084fc); outline-offset: 2px; }
html[data-theme="light"] :focus-visible { outline-color: var(--focus, #7e22ce); }
main:focus { outline: none; }
.lf-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- text size on pages that do not load lf-theme.css (public pages); same values as lf-theme.css ---- */
html[data-text="sm"] { font-size: 15px; }
html[data-text="lg"] { font-size: 18px; }
html[data-text="xl"] { font-size: 20px; }

/* ---- footer button that opens the panel (hidden until lf-a11y.js runs) ---- */
.lf-foot__a11y { display: inline; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: #c084fc; text-decoration: underline; cursor: pointer; min-height: 24px; }
.lf-foot__a11y:hover { color: #fff; }
.lf-foot__a11y[hidden] { display: none; }

/* ---- underline links ---- */
html[data-underline="on"] a { text-decoration: underline !important; text-underline-offset: .18em; text-decoration-thickness: 2px; }

/* ---- readable font (system fonts only: no downloads) ---- */
html[data-readable="on"] body, html[data-readable="on"] body *:not(svg):not(svg *) { font-family: Verdana, Tahoma, "Trebuchet MS", "Segoe UI", system-ui, sans-serif !important; letter-spacing: .01em; }

/* ---- line and text spacing ---- */
html[data-spacing="on"] body, html[data-spacing="on"] body *:not(svg):not(svg *) { line-height: 1.75 !important; letter-spacing: .03em; word-spacing: .12em; }
html[data-spacing="on"] p, html[data-spacing="on"] li { margin-bottom: .35em; }

/* ---- larger cursor and focus outlines ---- */
html[data-focus="on"] :focus-visible { outline: 4px solid #ffbf00 !important; outline-offset: 3px !important; box-shadow: 0 0 0 7px #000 !important; border-radius: 6px; }
html[data-focus="on"], html[data-focus="on"] body { cursor: url(/static/brand/cursor-large.svg) 5 3, auto; }
html[data-focus="on"] a, html[data-focus="on"] button, html[data-focus="on"] [role="button"], html[data-focus="on"] [role="radio"], html[data-focus="on"] [role="switch"], html[data-focus="on"] summary, html[data-focus="on"] select, html[data-focus="on"] label { cursor: url(/static/brand/cursor-large.svg) 5 3, pointer; }

/* ---- high contrast ---- */
html[data-contrast="on"][data-theme="dark"] body { background: #000 !important; color: #fff !important; }
html[data-contrast="on"][data-theme="light"] body { background: #fff !important; color: #000 !important; }
html[data-contrast="on"] :is(.text-gray-300, .text-gray-400, .text-gray-500, .text-gray-600, .text-zinc-400, .text-zinc-500, [class*="text-white/"]) { color: var(--hc-mute) !important; }
html[data-contrast="on"][data-theme="dark"] { --hc-fg: #fff; --hc-mute: #ececf1; --hc-bg: #000; --hc-line: #fff; --hc-link: #8ecbff; }
html[data-contrast="on"][data-theme="light"] { --hc-fg: #000; --hc-mute: #1c1b24; --hc-bg: #fff; --hc-line: #000; --hc-link: #0a3fb0; }
html[data-contrast="on"] :is([class*="bg-[#"], .bg-gray-800, .bg-gray-900, .bg-zinc-900, .bg-zinc-800, [class*="bg-white/"], [class*="bg-black/"], aside, header[data-lf-topbar], [data-lf-topbar]) { background-color: var(--hc-bg) !important; }
html[data-contrast="on"] :is([class*="border-white/"], [class*="border-gray"], .border, .border-b, .border-t, .border-r, .border-l, aside, [data-lf-topbar]) { border-color: var(--hc-line) !important; }
html[data-contrast="on"] :is(h1, h2, h3, h4, h5, h6, label, p, li, td, th, dt, dd, span:not([class*="text-purple"]):not([class*="text-pink"]):not([class*="bg-clip-text"])) { color: var(--hc-fg); }
html[data-contrast="on"] a:not([class*="bg-"]):not(.dh-btn--primary) { color: var(--hc-link); }
/* the dark site header, footer and cookie notice keep light links, also on pages with a light body */
html[data-contrast="on"] :is(.lf-top, .lf-foot, .ckb) a:not(.lf-top__cta):not([class*="bg-"]) { color: #8ecbff; }
html[data-contrast="on"] :is(input, select, textarea) { background: var(--hc-bg) !important; color: var(--hc-fg) !important; border: 2px solid var(--hc-line) !important; }
html[data-contrast="on"] :is(.bg-purple-600, .bg-purple-500, .bg-pink-500, .bg-red-600, [class*="bg-red-600/"], .bg-gradient-to-r, .bg-gradient-to-br) { background: #5b21b6 !important; color: #fff !important; }
html[data-contrast="on"] :is(.dh, .lfs, .lfa) { --c-mute: var(--hc-mute); --c-text: var(--hc-fg); --c-card: var(--hc-bg); --c-card2: var(--hc-bg); --c-line: var(--hc-line); }
html[data-contrast="on"] .lfd { --bg: var(--hc-bg); --panel: var(--hc-bg); --panel-2: var(--hc-bg); --line: var(--hc-line); --line-2: var(--hc-line); --text: var(--hc-fg); --muted: var(--hc-mute); --dim: var(--hc-mute); }
html[data-contrast="on"] .dh-btn--primary, html[data-contrast="on"] .dh-plan--pro, html[data-contrast="on"] .dh-plan--business { background: #5b21b6; color: #fff; }
html[data-contrast="on"] .dh-ava { background: #5b21b6; }

/* ---- the panel itself ---- */
.lfa-back { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .6); display: none; }
.lfa-back.is-on { display: block; }
.lfa { --c-card:#12121a; --c-card2:#0a0a0f; --c-line:rgba(255,255,255,.14); --c-text:#f4f4f8; --c-mute:#b4b4be; --c-acc:var(--color-purple-500, #a855f7); --c-ring:var(--color-purple-400, #c084fc);
  position: fixed; z-index: 2001; right: 0; bottom: 0; left: 0; max-height: min(92dvh, 46rem); overflow-y: auto; overscroll-behavior: contain; background: var(--c-card); color: var(--c-text);
  border: 1px solid var(--c-line); border-radius: 20px 20px 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translateY(105%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.4; }
.lfa.is-on { transform: none; visibility: visible; transition: transform .22s ease; }
html[data-motion="reduce"] .lfa, html[data-motion="reduce"] .lfa.is-on { transition: none; }
html[data-theme="light"] .lfa { --c-card:#ffffff; --c-card2:#f4f4f8; --c-line:rgba(23,21,31,.16); --c-text:#17151f; --c-mute:#4d4b63; --c-ring:var(--color-purple-600, #7e22ce); }
.lfa *, .lfa *::before, .lfa *::after { box-sizing: border-box; }
.lfa-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 0 .25rem; }
.lfa-head h2 { font-size: 1.25rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.lfa-x { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--c-card2); border: 1px solid var(--c-line); color: var(--c-text); cursor: pointer; padding: 0; }
.lfa-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lfa-lead { margin: 0 0 .9rem; color: var(--c-mute); font-size: .88rem; }
.lfa-group { background: var(--c-card2); border: 1px solid var(--c-line); border-radius: 16px; padding: .85rem; margin: 0 0 .75rem; }
.lfa-group h3 { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--c-mute); margin: 0 0 .6rem; }
.lfa-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.lfa button { font: inherit; color: inherit; -webkit-appearance: none; appearance: none; touch-action: manipulation; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lfa-opt { min-height: 48px; border-radius: 12px; border: 2px solid var(--c-line); background: var(--c-card); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: .35rem; padding: 0 .5rem; }
.lfa-opt[aria-checked="true"] { border-color: var(--c-acc); box-shadow: 0 0 0 1px var(--c-acc) inset; }
.lfa-opt .a1 { font-size: 1rem; } .lfa-opt .a2 { font-size: 1.2rem; } .lfa-opt .a3 { font-size: 1.45rem; }
.lfa-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 56px; padding: .35rem 0; border-top: 1px solid var(--c-line); }
.lfa-row:first-of-type { border-top: 0; }
.lfa-row .t { min-width: 0; }
.lfa-row .t strong { display: block; font-size: .95rem; }
.lfa-row .t span { display: block; font-size: .8rem; color: var(--c-mute); }
.lfa-sw { position: relative; flex: none; width: 56px; height: 44px; border: 0; background: transparent; padding: 0; }
.lfa-sw::before { content: ""; position: absolute; left: 0; top: 10px; width: 56px; height: 24px; border-radius: 999px; background: var(--c-line); border: 2px solid var(--c-mute); transition: background .15s; }
.lfa-sw::after { content: ""; position: absolute; left: 5px; top: 14px; width: 16px; height: 16px; border-radius: 50%; background: var(--c-mute); transition: transform .15s, background .15s; }
.lfa-sw[aria-checked="true"]::before { background: var(--c-acc); border-color: var(--c-acc); }
.lfa-sw[aria-checked="true"]::after { transform: translateX(28px); background: #fff; }
html[data-motion="reduce"] .lfa-sw::before, html[data-motion="reduce"] .lfa-sw::after { transition: none; }
.lfa-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; margin-top: .25rem; }
.lfa-reset { min-height: 46px; padding: 0 1rem; border-radius: 12px; border: 1px solid var(--c-line); background: var(--c-card2); font-weight: 700; }
.lfa-links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .88rem; }
.lfa-links a { color: var(--c-text); text-decoration: underline; text-underline-offset: .18em; min-height: 44px; display: inline-flex; align-items: center; }
.lfa-status { margin-left: auto; font-size: .85rem; font-weight: 700; color: var(--c-mute); min-height: 1.2em; }
.lfa :focus-visible { outline: 3px solid var(--c-ring); outline-offset: 2px; }
@media (min-width: 640px) {
  .lfa { left: auto; right: 1rem; bottom: 1rem; width: 25rem; border-radius: 20px; max-height: calc(100dvh - 2rem); transform: translateX(110%); }
}

/* ---- contrast >= 4.5:1 for small footer text on dark pages ---- */
html:not([data-theme="light"]) .lf-foot__tagline, html:not([data-theme="light"]) .lf-foot__tagline a { color: #b9b9c4; }
html:not([data-theme="light"]) .lf-foot__copy { color: #b0b0bb; }
/* the skip link keeps its own colours even inside pages that reset link colours (.lfd a { color: inherit }) */
html a.lf-skip, html a.lf-skip:visited { color: #111 !important; background: #fff; }
