/* The consent banner and Privacy choices (public/site/consent.js).

   Loaded only on a page that carries them (src/consent/tags.js). It reads the
   page's own tokens where the page has them: the marketing pages' --ink,
   --ground, --disp and --body (site.css), the legal pages' --fg and --page,
   and --blue on both; each falls back to the brand's own values. Square
   corners, a hairline and one soft shadow, like the site's own panels.

   Motion (emil-design-eng): the banner rises as a sheet on the drawer curve,
   340ms in and 200ms out, and leaves faster than it came; the dialog fades
   and settles 8px in 220ms, 160ms out. Only transform and opacity move.
   Reduced motion keeps the fades and drops every movement.

   The answers (owner, 2026-11-10, ICO: rejecting must be as easy and as
   prominent as accepting): Reject all and Accept all are one button twice,
   the same class, box, 1.5px ink line, type, height and width, side by side
   in one row, and neither is filled blue. Accept all stays last in the row
   and the Tab order. Manage preferences stays on the first layer as the
   quieter text button. */

.cy-banner,.cy-dialog,.cy-live{
  --cy-ink:var(--ink,var(--fg,#0B0D11));
  --cy-ink2:var(--ink2,var(--fg2,rgba(11,13,17,.70)));
  --cy-ground:var(--ground,var(--page,#F5F2EC));
  --cy-paper:#FFFFFF;
  --cy-blue:var(--blue,#025FFD);
  --cy-blue-text:var(--blue-text,#044AC2);
  --cy-hair:var(--hair,rgba(11,13,17,.13));
  --cy-disp:var(--disp,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);
  --cy-body:var(--body,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);
  --cy-drawer:cubic-bezier(.32,.72,0,1);
  --cy-out:cubic-bezier(.23,1,.32,1);
  color:var(--cy-ink);font-family:var(--cy-body);
  -webkit-font-smoothing:antialiased;
}

/* ── the banner: a bottom sheet on a phone, a slim bar above 760px ── */
.cy-banner{
  position:fixed;left:0;right:0;bottom:0;z-index:80;
  box-sizing:border-box;
  padding:14px 16px calc(8px + env(safe-area-inset-bottom));
  background:var(--cy-paper);
  border-top:1px solid var(--cy-hair);
  box-shadow:0 -12px 32px -18px rgba(11,13,17,.32);
  transform:translateY(calc(100% + 16px));opacity:0;
  transition:transform .2s var(--cy-out),opacity .2s var(--cy-out);
}
.cy-banner.in{
  transform:none;opacity:1;
  transition:transform .34s var(--cy-drawer),opacity .24s var(--cy-out);
}
/* out of the way while the visitor types into a field (the builder, sign
   in), and while the mobile menu sheet is open: never over what they use */
html.typing .cy-banner,html.nav-open .cy-banner{transform:translateY(calc(100% + 16px));opacity:0;visibility:hidden}

.cy-h{
  margin:0;font-family:var(--cy-disp);font-weight:700;
  font-size:17px;line-height:1.25;letter-spacing:-.018em;color:var(--cy-ink);
  text-wrap:balance;
}
.cy-p{margin:6px 0 0;font-size:14.5px;line-height:1.45;color:var(--cy-ink2);max-width:60ch;text-wrap:pretty}
.cy-p a,.cy-text a{color:var(--cy-blue-text);text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}
.cy-p a:hover{text-decoration-thickness:2px}
.cy-p a:focus-visible{outline:2px solid var(--cy-ink);outline-offset:2px}

.cy-banner .cy-p{margin:0;color:var(--cy-ink)}
.cy-acts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}

/* Reject all and Accept all: one box, one size, one weight, one colour. A
   1.5px ink line (an inset shadow, so the boxes measure the same) and
   full-contrast ink text on the white sheet; hover and press fill both with
   ink. No answer is emphasised over the other. */
.cy-btn{
  appearance:none;box-sizing:border-box;min-height:48px;margin:0;
  padding:12px 16px;border:0;border-radius:0;cursor:pointer;
  font-family:var(--cy-disp);font-weight:700;font-size:15px;letter-spacing:-.012em;line-height:1.1;
  color:var(--cy-ink);background:transparent;box-shadow:inset 0 0 0 1.5px var(--cy-ink);
  transition:transform .16s var(--cy-out);
  -webkit-tap-highlight-color:transparent;touch-action:manipulation;
}
@media (hover:hover) and (pointer:fine){
  .cy-btn:hover{background:var(--cy-ink);color:var(--cy-paper)}
}
.cy-btn:active{transform:scale(.97);background:var(--cy-ink);color:var(--cy-paper)}
.cy-btn:focus-visible{outline:2.5px solid var(--cy-blue);outline-offset:3px}

.cy-link{
  appearance:none;display:block;min-height:44px;margin:0;padding:10px 0;
  border:0;background:none;cursor:pointer;text-align:left;
  font-family:var(--cy-body);font-size:14.5px;font-weight:500;color:var(--cy-ink);
  text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px;text-decoration-color:var(--cy-hair);
  transition:transform .16s var(--cy-out);
  -webkit-tap-highlight-color:transparent;touch-action:manipulation;
}
@media (hover:hover) and (pointer:fine){
  .cy-link:hover{text-decoration-color:currentColor}
}
.cy-link:active{transform:scale(.98)}
.cy-link:focus-visible{outline:2.5px solid var(--cy-blue);outline-offset:2px}

/* From 761px: one slim bar along the bottom edge, its words on the left and
   its three answers on the right, ending in Accept all in the bottom-right
   corner, so the bar is one line tall and never sits on a hero's button. */
@media (min-width:761px){
  .cy-banner{padding:14px var(--gut,32px) calc(14px + env(safe-area-inset-bottom));box-shadow:0 -10px 30px -20px rgba(11,13,17,.30)}
  .cy-in{display:flex;align-items:center;gap:20px;max-width:1360px;margin:0 auto}
  .cy-copy{flex:1;min-width:0}
  .cy-banner .cy-p{font-size:14.5px}
  .cy-acts{flex:none;display:flex;gap:8px;margin:0}
  .cy-acts .cy-btn{width:140px}
  .cy-link{flex:none;padding:10px 4px}
}

/* While the banner is up, the page can scroll its last line clear of it:
   --consent-h is the banner's height, kept by a ResizeObserver
   (public/site/consent.js). */
html.consent-open body{padding-bottom:var(--consent-h,0px)}

/* The thumb dock rides above the sheet while both are up, so the page's
   main button is never under the banner. Set, not animated. */
@media (max-width:760px){
  html.consent-open .dock{bottom:calc(10px + env(safe-area-inset-bottom) + var(--consent-h,0px))}
}

/* ── Privacy choices: a dialog, a bottom sheet on a phone ───────────── */
.cy-dialog{
  box-sizing:border-box;margin:auto;padding:0;border:0;border-radius:0;
  width:min(460px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;
  background:var(--cy-paper);
  box-shadow:0 24px 64px -24px rgba(11,13,17,.45),0 2px 8px -2px rgba(11,13,17,.14);
  opacity:1;transform:none;
  transition:opacity .22s var(--cy-out),transform .22s var(--cy-out);
  overscroll-behavior:contain;
}
@starting-style{.cy-dialog[open]{opacity:0;transform:translateY(8px)}}
.cy-dialog.out{opacity:0;transform:translateY(8px);transition-duration:.16s}
.cy-dialog::backdrop{background:rgba(11,13,17,.38)}
@media (max-width:760px){
  .cy-dialog{
    width:100%;max-width:100%;margin:auto 0 0;max-height:88dvh;
    padding-bottom:env(safe-area-inset-bottom);
    transition:opacity .2s var(--cy-out),transform .3s var(--cy-drawer);
  }
  @starting-style{.cy-dialog[open]{opacity:0;transform:translateY(32px)}}
  .cy-dialog.out{transform:translateY(32px)}
}
.cy-form{display:block;margin:0;padding:20px 20px 16px}
.cy-dhead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-6px -8px 0 0}
.cy-dhead .cy-h{font-size:19px}
.cy-x{
  appearance:none;display:grid;place-items:center;width:44px;height:44px;flex:none;
  margin:0;padding:0;border:0;border-radius:0;background:transparent;color:var(--cy-ink);cursor:pointer;
  transition:transform .16s var(--cy-out);
}
@media (hover:hover) and (pointer:fine){ .cy-x:hover{background:rgba(11,13,17,.06)} }
.cy-x:active{transform:scale(.94)}
.cy-x:focus-visible{outline:2.5px solid var(--cy-blue);outline-offset:-2px}

.cy-rows{list-style:none;margin:14px 0 0;padding:0;border-top:1px solid var(--cy-hair)}
.cy-row{display:flex;align-items:center;gap:16px;padding:14px 0;border-bottom:1px solid var(--cy-hair)}
.cy-lab{flex:1;display:block;cursor:pointer}
.cy-name{display:block;font-family:var(--cy-disp);font-weight:700;font-size:15.5px;letter-spacing:-.012em;color:var(--cy-ink)}
.cy-text,.cy-note{display:block;margin-top:3px;font-size:13.5px;line-height:1.45;color:var(--cy-ink2)}
.cy-note{color:var(--cy-ink)}
.cy-always{flex:none;font-size:13px;font-weight:600;color:var(--cy-ink2);white-space:nowrap}

/* The switch: a 44x44 target around a 46x28 track. */
.cy-sw{
  appearance:none;-webkit-appearance:none;position:relative;flex:none;
  width:46px;height:28px;margin:8px 0;border:0;border-radius:999px;cursor:pointer;
  background:rgba(11,13,17,.22);
}
.cy-sw::before{content:"";position:absolute;inset:-8px 0}
.cy-sw::after{
  content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;
  background:#fff;box-shadow:0 1px 3px rgba(11,13,17,.3);
  transition:transform .2s var(--cy-out);
}
.cy-sw:checked{background:var(--cy-blue)}
.cy-sw:checked::after{transform:translateX(18px)}
@media (hover:hover) and (pointer:fine){
  .cy-sw:not(:checked):not(:disabled):hover{background:rgba(11,13,17,.32)}
  .cy-sw:checked:not(:disabled):hover{background:#0A69FF}
}
.cy-sw:active:not(:disabled)::after{transform:scale(.92)}
.cy-sw:checked:active:not(:disabled)::after{transform:translateX(18px) scale(.92)}
.cy-sw:focus-visible{outline:2.5px solid var(--cy-ink);outline-offset:3px}
.cy-sw:disabled{opacity:.45;cursor:not-allowed}

/* The panel's answers: Save preferences, Reject all and Accept all are the
   same button. Three across from 761px; on a phone Save preferences takes
   the first row and Reject all and Accept all share the row beneath, equal
   halves, Accept all still last in the Tab order. */
.cy-dacts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:18px}
.cy-dacts [data-cy="save"]{grid-column:1 / -1}
@media (min-width:761px){
  .cy-dialog{width:min(540px,calc(100vw - 32px))}
  .cy-dacts{grid-template-columns:repeat(3,1fr)}
  .cy-dacts [data-cy="save"]{grid-column:auto}
  .cy-dacts .cy-btn{padding-left:8px;padding-right:8px}
}

.cy-live{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* Privacy choices in the footers, and its control on /privacy */
[data-privacy-choices]{cursor:pointer}

@media (prefers-reduced-motion:reduce){
  .cy-banner,.cy-banner.in,html.typing .cy-banner,html.nav-open .cy-banner{transform:none;transition:opacity .2s linear}
  .cy-dialog,.cy-dialog.out{transform:none;transition:opacity .15s linear}
  @starting-style{.cy-dialog[open]{transform:none}}
  .cy-btn,.cy-link,.cy-x,.cy-sw::after{transition:none}
  .cy-btn:active,.cy-link:active,.cy-x:active{transform:none}
}
