/* light-native (_theme.py leaves this file as it is). uberdesigner — what consent.js draws: the cookie bar, the "your privacy choices" sheet and the footer's
   "Your Privacy Choices" (the real app's components/consent, 06-features/consent.md → Layout), in the new design's
   light look: white panels, Instrument Sans, the violet #8657e7. Its own tokens, so it reads the same on any page.
   Mobile first; safe areas respected; reduced motion turns the movement off. */

.cs-frame, .cs-sheet, .cs-link {
  --cs-bg: #fff;
  --cs-surface: #f3f4f6;
  --cs-text: #09090c;
  --cs-muted: #0000029d;
  --cs-stroke: #00000214;
  --cs-stroke-strong: #00000229;
  --cs-accent: #9568f9;
  --cs-accent-fill: #8657e7;
  --cs-accent-ink: #4d21ca;
  --cs-bad: #bd1f44;
  --cs-font: var(--font-sans, "Instrument Sans", system-ui, sans-serif);
  --cs-spring: .81s;
  --cs-spring-ease: var(--spring-ease, cubic-bezier(.34, 1.3, .64, 1));
  --cs-exit: .3s;
  --cs-exit-ease: cubic-bezier(.55, .085, .68, .53);
  --cs-tint: .18s cubic-bezier(.215, .61, .355, 1);
}

/* ---------- the bar: fixed at the bottom on the header's layer (under sheets and toasts); the frame clips, so the
   bar wipes in from below the edge. Phones: full width with the side gutters; from 600 px a panel at the bottom left */
.cs-frame {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: clip;
  pointer-events: none;
}

.cs-bar {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  color: var(--cs-text);
  font: 400 15px/1.45 var(--cs-font);
  letter-spacing: -.005em;
  background: var(--cs-bg);
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--cs-stroke), 0 1px 2px #0000000a, 0 24px 60px -24px #1a103340;
  pointer-events: auto;
  /* out of view: its own height plus the frame's margin */
  transform: translateY(calc(100% + 16px + env(safe-area-inset-bottom)));
  transition: transform var(--cs-exit) var(--cs-exit-ease);
}

.cs-frame[data-phase="open"] .cs-bar {
  transform: none;
  transition: transform var(--cs-spring) var(--cs-spring-ease);
}

.cs-bar__text { margin: 0; text-wrap: pretty; }

.cs-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* accept + reject: two equal columns, as wide as the wider label (rejecting is as easy as accepting) */
.cs-pair {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}

@media (min-width: 600px) {
  .cs-frame { padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .cs-bar { width: min(480px, 100%); transform: translateY(calc(100% + 24px + env(safe-area-inset-bottom))); }
}

/* While the bar is up the dock waits below the edge, so the two never stack at the bottom */
html.cs-bar-up .dock {
  transform: translateY(140%) scale(.9);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* ---------- buttons: the new design's pills */
.cs-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 44px;
  padding: 0 20px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  font: 500 16px/20px var(--cs-font);
  letter-spacing: -.01em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--cs-tint), box-shadow var(--cs-tint), color var(--cs-tint), transform .25s cubic-bezier(.215, .61, .355, 1);
}
.cs-btn:active { transform: scale(.97); }
.cs-btn:disabled { cursor: default; opacity: .6; }
.cs-btn:focus-visible, .cs-sheet__close:focus-visible, .cs-link:focus-visible, .cs-inline:focus-visible, .cs-switch:focus-visible {
  outline: 2px solid var(--cs-accent);
  outline-offset: 3px;
}

.cs-btn--secondary {
  color: var(--cs-text);
  background: var(--cs-bg);
  box-shadow: inset 0 0 0 1px var(--cs-stroke-strong);
}
.cs-btn--secondary:hover:not(:disabled) { background: var(--cs-surface); }

.cs-btn--text {
  padding: 0 12px;
  color: var(--cs-text);
  background: none;
  text-decoration: underline;
  text-decoration-color: var(--cs-stroke-strong);
  text-underline-offset: 4px;
}
.cs-btn--text:hover:not(:disabled) { text-decoration-color: currentColor; }

.cs-btn--primary {
  min-width: 112px;
  padding: 0 26px;
  color: #fff;
  background: var(--cs-accent-fill);
  box-shadow: inset 0 -7px 4px #ffffff3d, 0 16px 40px -14px #8657e7cc;
}
.cs-btn--primary:hover:not(:disabled) { box-shadow: inset 0 -7px 4px #ffffff3d, 0 20px 56px -12px #8657e7, 0 0 0 6px #8657e722; }
/* busy keeps its colour: the label says what's happening */
.cs-btn--primary:disabled { opacity: 1; }

.cs-btn__label { display: inline-block; }
/* save → "saved": the label wipes in from below, clipped by the button (M3) */
.cs-label-in { animation: cs-label-in var(--cs-spring) var(--cs-spring-ease) both; }
@keyframes cs-label-in { from { transform: translateY(101%); } }

/* the failed action's shake: twelve swings shrinking from 4 px to rest */
.cs-shake { animation: cs-shake .75s linear; }
@keyframes cs-shake {
  0% { transform: translateX(0); }
  8% { transform: translateX(4px); }
  16% { transform: translateX(-3.67px); }
  25% { transform: translateX(3.33px); }
  33% { transform: translateX(-3px); }
  41% { transform: translateX(2.67px); }
  50% { transform: translateX(-2.33px); }
  58% { transform: translateX(2px); }
  66% { transform: translateX(-1.67px); }
  75% { transform: translateX(1.33px); }
  83% { transform: translateX(-1px); }
  91% { transform: translateX(.67px); }
  100% { transform: translateX(0); }
}

/* the inline error (role="alert") under the bar's actions and beside save */
.cs-error {
  margin: 0;
  color: var(--cs-bad);
  font: 500 13px/18px var(--cs-font);
  animation: cs-error-in .3s cubic-bezier(.215, .61, .355, 1);
}
@keyframes cs-error-in { from { opacity: 0; transform: translateY(4px); } }
.cs-error-slot:empty { display: none; }

/* the bar's spoken result: visually hidden, still read */
.cs-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- the sheet: a bottom sheet on phones, a centred card from 600 px; over the page, under toasts */
html.cs-locked { overflow: hidden; }

.cs-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: var(--cs-text);
  font: 400 15px/1.45 var(--cs-font);
  letter-spacing: -.005em;
}
.cs-sheet[hidden] { display: none; }

.cs-sheet__back {
  position: absolute;
  inset: 0;
  background: #fafbfdcc;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--cs-exit) ease;
}
.cs-sheet.is-open .cs-sheet__back { opacity: 1; transition-duration: .25s; }

.cs-sheet__panel {
  position: relative;
  width: 100%;
  max-height: min(92dvh, 100%);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--cs-bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 0 0 1px var(--cs-stroke), 0 -20px 60px -30px #1a103359;
  transform: translateY(100%);
  transition: transform var(--cs-exit) var(--cs-exit-ease);
}
.cs-sheet.is-open .cs-sheet__panel { transform: none; transition: transform var(--cs-spring) var(--cs-spring-ease); }
.cs-sheet__panel:focus { outline: none; }

@media (min-width: 600px) {
  .cs-sheet { align-items: center; padding: 24px; }
  .cs-sheet__panel {
    width: min(520px, 100%);
    max-height: calc(100dvh - 48px);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 0 0 1px var(--cs-stroke), 0 40px 100px -30px #00000033;
    transform: translateY(24px) scale(.98);
    opacity: 0;
    transition: transform var(--cs-exit) var(--cs-exit-ease), opacity var(--cs-exit) ease;
  }
  .cs-sheet.is-open .cs-sheet__panel { transform: none; opacity: 1; transition: transform var(--cs-spring) var(--cs-spring-ease), opacity .2s ease; }
}

.cs-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.cs-sheet__title {
  margin: 0;
  font: 500 24px/1.2 var(--cs-font);
  letter-spacing: -.02em;
}
.cs-sheet__close {
  flex: none;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--cs-muted);
  font: 500 12px/16px var(--cs-font);
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
}
.cs-sheet__close:hover { color: var(--cs-text); }

.cs-choices { display: flex; flex-direction: column; gap: 24px; }
.cs-choices p { margin: 0; }
.cs-muted { color: var(--cs-muted); }
.cs-rows { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.cs-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
  border-top: 1px solid var(--cs-stroke);
}
.cs-row:last-child { border-bottom: 1px solid var(--cs-stroke); }

/* a category's name, and what sits beside it: essential's tag, or the switch */
.cs-row__line { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.cs-row__name { font: 500 17px/1.3 var(--cs-font); letter-spacing: -.01em; color: var(--cs-text); }
.cs-check { justify-content: space-between; gap: 16px; cursor: pointer; }

.cs-tag {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--cs-surface);
  color: var(--cs-text);
  font: 500 11px/14px var(--cs-font);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* on / off: a checkbox drawn as the new design's switch */
.cs-switch {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: 13px;
  background: #0000021f;
  cursor: pointer;
  transition: background-color .2s;
}
.cs-switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #00000033;
  transition: transform .35s var(--cs-spring-ease);
}
.cs-switch:checked { background: var(--cs-accent-fill); }
.cs-switch:checked::after { transform: translateX(18px); }

/* the GPC line reads in the text colour, the US line muted */
.cs-gpc { color: var(--cs-text); }
.cs-inline { color: var(--cs-text); text-decoration: underline; text-underline-offset: 3px; border-radius: 2px; }

.cs-save { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

/* ---------- the footer's "Your Privacy Choices": the opt-out icon, then the title; the footer's link styles apply */
.cs-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  --cs-cut: #fff;
}
.cs-link__icon { flex: none; width: 30px; height: 14px; }

/* ---------- reduced motion: things appear and go, nothing travels */
@media (prefers-reduced-motion: reduce) {
  .cs-bar, .cs-frame[data-phase="open"] .cs-bar,
  .cs-sheet__panel, .cs-sheet.is-open .cs-sheet__panel,
  .cs-sheet__back, .cs-switch, .cs-switch::after, .cs-btn {
    transition: none !important;
  }
  .cs-frame:not([data-phase="open"]) .cs-bar { visibility: hidden; }
  .cs-label-in, .cs-shake, .cs-error { animation: none !important; }
  html.cs-bar-up .dock { transition: none; }
}

/* ---------- the live site's own bits of the shared chrome (chrome.js in LIVE: html.is-live, set by real.js). Here
   because this sheet loads only on the pages the front Worker serves ---------- */
/* anything only the test build has */
html.is-live [data-demo] { display: none !important; }
/* a member isn't asked to "get unlimited" (HomeActions.tsx, D-151): the hero's and the last band's, the tools' cards */
html.is-live.is-pro #cta-main, html.is-live.is-pro [data-upsell], html.is-live.is-pro [data-source="home_final_band"] { display: none !important; }
/* the footer's email opt-in for a signed-in account (AccountClient.tsx: one checkbox, saved at once) */
.ft3__opt { display: flex; align-items: flex-start; gap: 10px; max-width: 26em; font-size: 15px; line-height: 1.45; cursor: pointer; }
.ft3__opt input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: #8657e7; cursor: pointer; }
.ft3__opt input:disabled { cursor: progress; }
#nl-st:not(:empty) { color: #1f7a45; font-weight: 500; }
/* a plan or billing button while its request runs (real.js: aria-busy) */
html.is-live [aria-busy="true"] { cursor: progress; opacity: .7; }
