/* Osvetra legal kit: our own accessibility button, the cookie notice and the legal page layout.
   One stylesheet for every site we build. It brings no colours of its own: it reads the host's
   tokens (--surface, --ink, --muted, --line, --bg, --accent-ink, the names our templates use) and
   falls back to the browser's system colours. A host can set any --lk-* token to override.
   Design: version 1 "Corner chip" (templates/legal/versions/PICK.md). */

:root {
  --lk-surface: var(--surface, Canvas);
  --lk-ink: var(--ink, CanvasText);
  /* Not GrayText: browsers render it near 4:1 on white, below the 4.5:1 small print needs. */
  --lk-muted: var(--muted, color-mix(in srgb, CanvasText 70%, Canvas));
  --lk-line: var(--line, color-mix(in srgb, CanvasText 18%, Canvas));
  --lk-sunk: var(--bg, color-mix(in srgb, CanvasText 5%, Canvas));
  --lk-link: var(--accent-ink, LinkText);
  --lk-font: inherit;
  --lk-radius: 18px;
  --lk-ease: var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
  /* Shadows take a dark shade of the ink: tinted on a light page, never a light glow on a dark one. */
  --lk-shade: color-mix(in srgb, var(--lk-ink) 25%, #000);
  --lk-shadow: 0 18px 50px color-mix(in srgb, var(--lk-shade) 22%, transparent);
  /* How far the corner button sits above the bottom: the phone call dock (--dock-h in our
     templates) plus the cookie bar while it shows. */
  --lk-offset: var(--dock-h, 0px);
  --lk-bar: 0px;
  --lk-gap: max(16px, env(safe-area-inset-bottom, 0px));
}

/* ---------- Shared bits ---------- */
.lk-root, .lk-root * { box-sizing: border-box; }
.lk-root { font-family: var(--lk-font); color: var(--lk-ink); line-height: 1.4; -webkit-tap-highlight-color: transparent; }
.lk-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* :where() keeps this reset at zero weight, so each button class below sets its own colour and type. */
:where(.lk-root) button { font: inherit; color: inherit; margin: 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.lk-root svg { flex: none; }
.lk-root :focus-visible { outline: 2px solid var(--lk-ink); outline-offset: 2px; }

/* ---------- The accessibility button ---------- */
.lk-trigger {
  position: fixed; z-index: 2147483000; inset-inline-start: max(16px, env(safe-area-inset-left, 0px));
  bottom: calc(var(--lk-gap) + var(--lk-offset) + var(--lk-bar));
  width: 48px; height: 48px; padding: 0; border-radius: 999px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--lk-line); background: var(--lk-surface); color: var(--lk-ink);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--lk-shade) 16%, transparent);
  transition: transform 140ms var(--lk-ease), opacity 180ms var(--lk-ease), bottom 200ms var(--lk-ease);
}
.lk-root[data-side="end"] .lk-trigger { inset-inline-start: auto; inset-inline-end: max(16px, env(safe-area-inset-right, 0px)); }
.lk-trigger:active { transform: scale(0.96); }
.lk-trigger svg { width: 26px; height: 26px; }
.lk-count {
  position: absolute; top: -5px; inset-inline-end: -5px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px;
  background: var(--lk-ink); color: var(--lk-surface); font-size: 12px; font-weight: 700; line-height: 21px; text-align: center;
  border: 2px solid var(--lk-surface);
}

/* ---------- The panel (not modal: the page changes behind it while it's open) ---------- */
.lk-panel {
  position: fixed; z-index: 2147483001; inset-inline-start: max(12px, env(safe-area-inset-left, 0px));
  bottom: calc(var(--lk-gap) + var(--lk-offset) + var(--lk-bar) + 58px);
  width: min(368px, calc(100vw - 24px)); max-height: calc(100dvh - var(--lk-offset) - var(--lk-bar) - 100px);
  overflow: auto; overscroll-behavior: contain; padding: 6px 0 4px;
  background: var(--lk-surface); color: var(--lk-ink); border: 1px solid var(--lk-line); border-radius: var(--lk-radius); box-shadow: var(--lk-shadow);
  transform-origin: 24px 100%;
  transition: opacity 160ms var(--lk-ease), transform 160ms var(--lk-ease);
}
[dir="rtl"] .lk-panel { transform-origin: calc(100% - 24px) 100%; }
.lk-root[data-side="end"] .lk-panel { inset-inline-start: auto; inset-inline-end: max(12px, env(safe-area-inset-right, 0px)); transform-origin: calc(100% - 24px) 100%; }
[dir="rtl"] .lk-root[data-side="end"] .lk-panel { transform-origin: 24px 100%; }
.lk-panel[data-state="closed"] { opacity: 0; transform: translateY(6px) scale(0.97); pointer-events: none; }
.lk-panel[hidden] { display: none; }
.lk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 18px; }
[dir="rtl"] .lk-head { padding: 6px 18px 6px 8px; }
.lk-head h2 { margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: -0.01em; outline: none; }
.lk-icon-btn { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; background: none; border-radius: 999px; color: var(--lk-muted); cursor: pointer; }
.lk-icon-btn svg { width: 20px; height: 20px; }
.lk-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 4px 18px; }
.lk-row + .lk-row { border-top: 1px solid var(--lk-line); }
.lk-label { display: flex; align-items: center; gap: 12px; font-size: 1rem; }
.lk-label svg { width: 20px; height: 20px; color: var(--lk-muted); }
.lk-stepper { display: flex; align-items: center; gap: 4px; }
.lk-stepper button { width: 44px; height: 44px; padding: 0; border-radius: 999px; border: 1px solid var(--lk-line); background: var(--lk-sunk); color: var(--lk-ink); display: grid; place-items: center; cursor: pointer; transition: transform 120ms var(--lk-ease); }
.lk-stepper button:active { transform: scale(0.94); }
.lk-stepper button[aria-disabled="true"] { opacity: 0.45; cursor: default; transform: none; }
.lk-stepper svg { width: 18px; height: 18px; }
.lk-stepper output { min-width: 4.5ch; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }

/* Switches show state by position and a tick, never by colour alone. */
.lk-switch { position: relative; flex: none; width: 52px; height: 32px; padding: 0; border-radius: 999px; border: 2px solid var(--lk-muted); background: var(--lk-sunk); cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease; }
.lk-switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 999px; background: var(--lk-muted); transition: transform 180ms var(--lk-ease); }
.lk-switch[aria-checked="true"] { background: var(--lk-ink); border-color: var(--lk-ink); }
.lk-switch[aria-checked="true"]::after { background: var(--lk-surface); transform: translateX(20px); }
[dir="rtl"] .lk-switch[aria-checked="true"]::after { transform: translateX(-20px); }
.lk-switch .lk-tick { position: absolute; top: 7px; inset-inline-start: 8px; width: 14px; height: 14px; color: var(--lk-surface); opacity: 0; transition: opacity 140ms ease; }
.lk-switch[aria-checked="true"] .lk-tick { opacity: 1; }
.lk-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 8px 18px 6px; border-top: 1px solid var(--lk-line); }
.lk-text-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--lk-ink); font-size: 0.95rem; font-weight: 550; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.lk-text-btn svg { width: 18px; height: 18px; }
.lk-text-btn[aria-disabled="true"] { opacity: 0.5; cursor: default; text-decoration: none; }
.lk-device { margin: 0; padding: 0 18px 10px; font-size: 0.8125rem; line-height: 1.4; color: var(--lk-muted); }
/* Steps aside on a phone while a form or the footer is on screen (data-aside); the footer then opens it. */
.lk-root[data-lk-aside] .lk-trigger { opacity: 0; transform: translateY(12px); visibility: hidden; transition: opacity 140ms var(--lk-ease), transform 140ms var(--lk-ease), visibility 0s 140ms; }
[dir="rtl"] .lk-flip svg, [dir="rtl"] svg.lk-flip { transform: scaleX(-1); }

/* ---------- The cookie notice (only on sites that use optional cookies or trackers) ---------- */
.lk-consent {
  position: fixed; z-index: 2147482999; inset-inline: 0; bottom: var(--lk-offset);
  background: var(--lk-surface); color: var(--lk-ink); border-top: 1px solid var(--lk-line);
  box-shadow: 0 -10px 30px color-mix(in srgb, var(--lk-shade) 10%, transparent);
  padding: 16px max(20px, env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px));
}
.lk-consent[hidden] { display: none; }
.lk-consent-in { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.lk-consent h2 { margin: 0 0 2px; font-size: 1rem; font-weight: 650; }
.lk-consent-text { flex: 1 1 420px; }
.lk-consent-text p { margin: 0; font-size: 0.95rem; }
.lk-consent a { color: var(--lk-link); text-decoration: underline; text-underline-offset: 3px; }
.lk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Reject and Accept are the same button: same size, colour and weight, side by side. */
.lk-btn { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 2px solid var(--lk-ink); background: var(--lk-ink); color: var(--lk-surface); font-size: 0.95rem; font-weight: 650; cursor: pointer; transition: transform 120ms var(--lk-ease); }
.lk-btn:active { transform: scale(0.97); }
.lk-btn.lk-quiet { background: transparent; color: var(--lk-ink); }
.lk-choices { flex-basis: 100%; display: grid; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.lk-choices[hidden] { display: none; }
.lk-choice { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; min-height: 44px; }
.lk-choice input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--lk-ink); flex: none; }
.lk-choice small { display: block; color: var(--lk-muted); font-size: 0.875rem; }
.lk-gpc { margin: 6px 0 0; font-size: 0.875rem; color: var(--lk-muted); }
@media (max-width: 560px) {
  .lk-actions { width: 100%; }
  /* Buttons share the row; at large text sizes a whole button moves down, its label never breaks. */
  .lk-actions .lk-btn { flex: 1 1 auto; padding: 0 12px; white-space: nowrap; }
}

/* Click-to-load embeds (a map or a video from another company, held back until asked for). */
.lk-embed { display: grid; place-items: center; gap: 10px; min-height: 220px; padding: 24px; text-align: center; border: 1px dashed var(--lk-line); border-radius: 14px; background: var(--lk-sunk); color: var(--lk-ink); }
.lk-embed p { margin: 0; max-width: 46ch; font-size: 0.95rem; }

@media (hover: hover) and (pointer: fine) {
  .lk-icon-btn:hover { background: var(--lk-sunk); color: var(--lk-ink); }
  .lk-stepper button:not([aria-disabled="true"]):hover, .lk-trigger:hover { border-color: var(--lk-ink); }
  .lk-btn.lk-quiet:hover { background: var(--lk-sunk); }
}
@media (prefers-reduced-motion: reduce) {
  .lk-panel { transition: opacity 120ms ease; }
  .lk-panel[data-state="closed"] { transform: none; }
  .lk-trigger, .lk-switch::after, .lk-btn, .lk-stepper button { transition: none; }
}
@media (prefers-contrast: more) {
  .lk-panel, .lk-consent, .lk-trigger { border-width: 2px; border-color: var(--lk-ink); box-shadow: none; }
}
@media print { .lk-root { display: none !important; } }

/* ---------- What each setting does to the whole page (classes on <html>) ---------- */
/* Text size: the engine sets the root font size, so rem-based sites (all of ours) scale with it. */

/* High contrast: black on white (white on black in dark mode), no images behind text, no shadows. */
html.lk-contrast { --lk-hc-bg: #fff; --lk-hc-ink: #000; --lk-hc-link: #0a2fa8; }
@media (prefers-color-scheme: dark) { html.lk-contrast:not([data-theme="light"]) { --lk-hc-bg: #000; --lk-hc-ink: #fff; --lk-hc-link: #ffe066; } }
html.lk-contrast[data-theme="dark"] { --lk-hc-bg: #000; --lk-hc-ink: #fff; --lk-hc-link: #ffe066; }
html.lk-contrast body, html.lk-contrast body *:not(svg):not(svg *):not(img):not(video):not(picture):not(canvas):not(iframe) {
  background-color: var(--lk-hc-bg) !important; background-image: none !important;
  color: var(--lk-hc-ink) !important; border-color: var(--lk-hc-ink) !important;
  text-shadow: none !important; box-shadow: none !important; backdrop-filter: none !important;
}
html.lk-contrast body a, html.lk-contrast body a * { color: var(--lk-hc-link) !important; text-decoration: underline !important; }
html.lk-contrast body button, html.lk-contrast body [role="button"], html.lk-contrast body input, html.lk-contrast body select, html.lk-contrast body textarea { border: 2px solid var(--lk-hc-ink) !important; }
html.lk-contrast .lk-switch[aria-checked="true"]::after { background: var(--lk-hc-bg) !important; }
html.lk-contrast .lk-switch[aria-checked="true"] { background: var(--lk-hc-ink) !important; }
html.lk-contrast .lk-switch[aria-checked="true"] .lk-tick { color: var(--lk-hc-bg) !important; }
html.lk-contrast .lk-count { background: var(--lk-hc-ink) !important; color: var(--lk-hc-bg) !important; }
html.lk-contrast .lk-btn:not(.lk-quiet) { background: var(--lk-hc-ink) !important; color: var(--lk-hc-bg) !important; }

/* Highlight links: every link underlined and outlined, so links never rely on colour. */
html.lk-links body a { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important; outline: 2px dashed currentColor; outline-offset: 2px; }

/* Stop motion: animations and transitions end at once, smooth scroll off; the engine pauses videos
   and sets data-motion="reduce" on <html> for scripts that animate. */
html.lk-still *, html.lk-still *::before, html.lk-still *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
  transition-duration: 0.001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}

/* Text spacing: the WCAG 1.4.12 values. */
/* Easy-to-read font: a plain, open sans the device already has (wide letters, a clear I/l/1), regular weight for
   body text, and no tight tracking on headings. */
html.lk-readable body *:not(svg):not(svg *):not(code):not(pre) { font-family: Verdana, "Atkinson Hyperlegible", Tahoma, "Segoe UI", Arial, sans-serif !important; letter-spacing: 0 !important; font-style: normal !important; }
html.lk-readable body p, html.lk-readable body li { font-weight: 400 !important; }
html.lk-spacing body *:not(svg):not(svg *) { line-height: 1.5 !important; letter-spacing: 0.12em !important; word-spacing: 0.16em !important; }
html.lk-spacing body p { margin-block-end: 2em !important; }

/* Strong focus ring: yellow inside, near-black outside, so it shows on any background. */
html.lk-focus *:focus-visible { outline: 3px solid #ffbf47 !important; outline-offset: 0 !important; box-shadow: 0 0 0 6px #0b0c0c !important; }

/* ---------- Legal pages: the reading layout the renderer's HTML uses ---------- */
.lk-doc { --lk-measure: 68ch; display: grid; gap: 32px; padding-block: 56px 120px; color: var(--lk-ink); }
/* Phone: header (title, notes, short version), contents, text. Wide: contents in a sticky column beside both. */
@media (min-width: 1000px) {
  .lk-doc.lk-has-toc { grid-template-columns: 220px minmax(0, var(--lk-measure)); grid-template-areas: "toc head" "toc body"; column-gap: 56px; row-gap: 8px; }
  .lk-doc.lk-has-toc .lk-doc-head { grid-area: head; }
  .lk-doc.lk-has-toc .lk-toc { grid-area: toc; }
  .lk-doc.lk-has-toc .lk-doc-body { grid-area: body; }
}
.lk-doc-head, .lk-doc-body { max-width: var(--lk-measure); min-width: 0; }
.lk-doc h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); line-height: 1.08; letter-spacing: -0.03em; margin: 0; outline: none; }
.lk-meta { margin: 12px 0 0; color: var(--lk-muted); font-size: 0.95rem; }
.lk-meta span + span::before { content: " · "; }
.lk-demo-note, .lk-blocked-note { margin: 24px 0 0; padding: 14px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--lk-ink) 40%, transparent); background: var(--lk-sunk); font-size: 0.95rem; line-height: 1.55; }
.lk-blocked-note { border: 2px dashed #b42318; }
.lk-short { margin: 28px 0 8px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--lk-line); background: var(--lk-surface); }
.lk-short h2 { margin: 0 0 8px !important; font-size: 1.05rem !important; }
.lk-short ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.lk-short li { font-size: 1rem; line-height: 1.55; }
.lk-doc-head a { color: var(--lk-link); text-underline-offset: 3px; }
.lk-toc { font-size: 0.95rem; padding-block: 4px 12px; border-bottom: 1px solid var(--lk-line); }
@media (min-width: 1000px) { .lk-toc { position: sticky; top: 24px; align-self: start; border-bottom: 0; padding: 0; } }
.lk-toc h2 { font-size: 0.95rem; margin: 0 0 8px; }
.lk-toc ol { margin: 0; padding-inline-start: 22px; }
/* The spacing sits on the item, so the number stays on the link's first line when a title wraps; the 31px
   pitch keeps each link clear of the next (WCAG 2.5.8). */
.lk-toc li { padding-block: 5px; line-height: 1.4; }
.lk-toc li::marker { color: var(--lk-muted); font-variant-numeric: tabular-nums; }
.lk-toc a { color: var(--lk-ink); text-underline-offset: 3px; }
.lk-doc-body h2 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -0.015em; margin: 44px 0 10px; scroll-margin-top: 24px; }
.lk-doc-body h3 { font-size: 1.08rem; margin: 28px 0 8px; }
.lk-doc-body p, .lk-doc-body li { font-size: 1.0625rem; line-height: 1.65; }
.lk-doc-body ul, .lk-doc-body ol { padding-inline-start: 22px; }
.lk-doc-body li + li { margin-top: 6px; }
.lk-doc-body a { color: var(--lk-link); text-underline-offset: 3px; }
.lk-doc-body table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.5; margin: 16px 0 8px; font-variant-numeric: tabular-nums; }
.lk-doc-body th, .lk-doc-body td { text-align: start; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--lk-line); }
.lk-doc-body th:first-child, .lk-doc-body td:first-child { padding-inline-start: 0; }
.lk-doc-body th { font-size: 0.875rem; font-weight: 650; border-bottom-color: color-mix(in srgb, var(--lk-ink) 45%, transparent); }
.lk-doc-body td code { font-size: 0.875em; overflow-wrap: anywhere; }
/* On a phone each row becomes a short stack with its column names, instead of a table that scrolls sideways.
   The renderer gives every cell an explicit role, so Safari keeps the table semantics. */
@media (max-width: 640px) {
  .lk-doc-body table, .lk-doc-body tbody, .lk-doc-body tr, .lk-doc-body td { display: block; }
  .lk-doc-body thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .lk-doc-body tr { padding: 14px 0; border-bottom: 1px solid var(--lk-line); }
  .lk-doc-body tr:first-child { border-top: 1px solid var(--lk-line); }
  .lk-doc-body td { border: 0; padding: 3px 0; }
  .lk-doc-body td::before { content: attr(data-label); display: block; font-size: 0.8125rem; font-weight: 650; color: var(--lk-muted); }
  .lk-doc-body td:first-child { font-weight: 650; }
  .lk-doc-body td:first-child::before { content: none; }
}
/* The notice beside a form and the words beside its text box: small print, in the host's own type. */
.lk-snippet { font-size: 0.875rem; line-height: 1.5; color: var(--lk-muted); }
.lk-snippet p { margin: 0; }
.lk-snippet a { color: var(--lk-link); text-underline-offset: 2px; }
.lk-review { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--lk-line); color: var(--lk-muted); font-size: 0.875rem; }
/* A fact the client hasn't given us yet: loud on purpose, and the gate refuses to publish it. */
.lk-missing { background: #fde8e6; color: #7a1209; border: 2px dashed #b42318; border-radius: 6px; padding: 0 6px; font-weight: 650; font-family: ui-monospace, monospace; font-size: 0.9em; }
.lk-tbc { background: color-mix(in srgb, var(--lk-ink) 8%, transparent); border-bottom: 2px dotted var(--lk-muted); padding: 0 4px; border-radius: 4px; }
