/* ============================================================================
   Film Backpack — legal pages (P1-LEGAL-1)
   ----------------------------------------------------------------------------
   Shared layout for every legal document (terms, privacy, cookies, DPA,
   acceptable use, Komplett agreement, bug bounty) and the legal hub.
   Rendered by filmbackpack_legal.js. Tokens come from filmbackpack_design.css
   and filmbackpack_theme.css, so light and dark themes both work.
   Phone first: one column, the document list folds into a disclosure row;
   from 1024px a sticky sidebar lists every document (house pattern: iOS rows).
   ============================================================================ */

body.fbl { margin: 0; font-family: var(--fb-font); color: var(--fb-label); background: var(--fb-bg); -webkit-font-smoothing: antialiased; }
.fbl *, .fbl *::before, .fbl *::after { box-sizing: border-box; }

.fbl-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--fb-surface); color: var(--fb-navy-ink); padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.fbl-skip:focus { left: 12px; }

/* top bar — same shell as the old legal pages */
.fbl-top { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.fbl-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fb-navy-ink); font-weight: 800; min-height: 44px; }
.fbl-brand img { width: 32px; height: 32px; border-radius: 9px; }
.fbl-top .fb-pill { min-height: 44px; padding: 8px 14px; font-size: 13px; }

/* shell */
.fbl-shell { max-width: 1180px; margin: 0 auto; padding: 18px 16px 72px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 1024px) {
  .fbl-shell { grid-template-columns: 270px minmax(0, 1fr); gap: 36px; padding: 32px 24px 96px; }
}

/* document list */
.fbl-nav { min-width: 0; }
.fbl-nav details { background: var(--fb-surface); border: 1px solid var(--fb-sep); border-radius: var(--fb-r-lg); }
.fbl-nav summary { list-style: none; cursor: pointer; min-height: 48px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--fb-navy-ink); font-size: 15px; }
.fbl-nav summary::-webkit-details-marker { display: none; }
.fbl-nav summary::after { content: ''; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--fb-muted); border-bottom: 2px solid var(--fb-muted); transform: rotate(45deg); transition: transform .2s ease; }
.fbl-nav details[open] summary::after { transform: rotate(-135deg); }
.fbl-nav ul { list-style: none; margin: 0; padding: 4px 8px 10px; }
.fbl-nav li a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: 10px; color: var(--fb-label); text-decoration: none; font-size: 14.5px; line-height: 1.3; }
.fbl-nav li a:hover { background: var(--fb-surface-2); }
.fbl-nav li a[aria-current="page"] { background: var(--fb-surface-2); color: var(--fb-navy-ink); font-weight: 800; box-shadow: inset 3px 0 0 var(--fb-navy-ink); }
@media (min-width: 1024px) {
  .fbl-nav > div { position: sticky; top: 84px; }
  .fbl-nav details { background: transparent; border: 0; }
  .fbl-nav summary { pointer-events: none; padding: 0 12px 8px; min-height: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--fb-muted); }
  .fbl-nav summary::after { display: none; }
  .fbl-nav ul { padding: 0; }
}

/* main column */
.fbl-main { min-width: 0; max-width: 800px; }
.fbl-kicker { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fb-muted); }
.fbl-main h1 { font-family: var(--fb-serif); font-size: clamp(30px, 6vw, 44px); line-height: 1.12; font-weight: 800; margin: 0 0 10px; color: var(--fb-label); overflow-wrap: anywhere; }
.fbl-meta { margin: 0; color: var(--fb-muted); font-size: 13.5px; line-height: 1.6; }
.fbl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.fbl-actions .fb-btn { min-height: 44px; }
.fbl-actions .fb-btn--secondary { --_fg: var(--fb-navy-ink); }   /* readable label in both themes */

.fbl-card { background: var(--fb-surface); border: 1px solid var(--fb-sep); border-radius: var(--fb-r-xl); padding: 22px 20px; box-shadow: var(--fb-shadow-sm); margin-top: 18px; }
@media (min-width: 640px) { .fbl-card { padding: 28px 30px; } }

/* plain-language summary */
.fbl-summary h2 { margin: 0 0 10px; font-size: 18px; font-weight: 800; color: var(--fb-navy-ink); }
.fbl-summary ul { margin: 0; padding-left: 20px; }
.fbl-summary li { margin: 8px 0; font-size: 15.5px; line-height: 1.6; color: var(--fb-label); }
.fbl-summary .fbl-note { margin: 12px 0 0; font-size: 13px; color: var(--fb-muted); }
.fbl-summary a { color: var(--fb-navy-ink); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

/* table of contents */
.fbl-toc { margin-top: 18px; }
.fbl-toc summary { cursor: pointer; list-style: none; font-weight: 800; color: var(--fb-navy-ink); min-height: 44px; display: flex; align-items: center; gap: 10px; }
.fbl-toc summary::-webkit-details-marker { display: none; }
.fbl-toc summary::after { content: ''; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--fb-muted); border-bottom: 2px solid var(--fb-muted); transform: rotate(45deg); transition: transform .2s ease; }
.fbl-toc[open] summary::after { transform: rotate(-135deg); }
.fbl-toc ol { margin: 6px 0 0; padding-left: 0; list-style: none; columns: 1; }
@media (min-width: 760px) { .fbl-toc ol { columns: 2; column-gap: 28px; } }
.fbl-toc li { break-inside: avoid; }
.fbl-toc a { display: flex; align-items: center; padding: 6px 0; min-height: 44px; color: var(--fb-label); text-decoration: none; font-size: 14.5px; line-height: 1.35; }
.fbl-toc a:hover { text-decoration: underline; }

/* document body */
.fbl-doc p, .fbl-doc li, .fbl-doc td, .fbl-doc th, .fbl-doc dd, .fbl-doc dt { font-size: 15.5px; line-height: 1.65; color: var(--fb-label); }
.fbl-doc p { margin: 10px 0; }
.fbl-doc ul, .fbl-doc ol { padding-left: 22px; margin: 8px 0; }
.fbl-doc li { margin: 4px 0; }
.fbl-doc h2 { font-size: 20px; line-height: 1.3; font-weight: 800; margin: 34px 0 8px; color: var(--fb-navy-ink); scroll-margin-top: 84px; }
.fbl-doc h2:first-child { margin-top: 4px; }
.fbl-doc h3 { font-size: 16.5px; line-height: 1.35; font-weight: 800; margin: 22px 0 6px; color: var(--fb-label); scroll-margin-top: 84px; }
.fbl-doc a { color: var(--fb-navy-ink); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.fbl-doc strong { font-weight: 700; }
.fbl-doc .fbl-callout { background: var(--fb-surface-2); border: 1px solid var(--fb-sep); border-radius: var(--fb-r-md); padding: 14px 16px; margin: 14px 0; }
.fbl-doc .fbl-callout p { margin: 4px 0; }
.fbl-doc dl { margin: 8px 0; }
.fbl-doc dt { font-weight: 700; margin-top: 10px; }
.fbl-doc dd { margin: 2px 0 0; }

/* tables (scroll inside their own box — never the page) */
.fbl-table { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 12px 0; border: 1px solid var(--fb-sep); border-radius: var(--fb-r-md); }
.fbl-table table { width: 100%; border-collapse: collapse; min-width: 560px; }
.fbl-table th, .fbl-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--fb-sep); font-size: 14px; line-height: 1.5; }
.fbl-table tr:last-child td { border-bottom: 0; }
.fbl-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--fb-muted); background: var(--fb-surface-2); }
.fbl-table code, .fbl-doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--fb-surface-2); border: 1px solid var(--fb-sep); border-radius: 6px; padding: 1px 5px; overflow-wrap: anywhere; }

/* company identity block */
.fbl-company { margin-top: 22px; color: var(--fb-muted); font-size: 13.5px; line-height: 1.6; }
.fbl-company p { margin: 4px 0; color: var(--fb-muted); font-size: 13.5px; }
.fbl-company a { color: var(--fb-navy-ink); }

/* legal hub rows */
.fbl-rows { list-style: none; margin: 18px 0 0; padding: 0; background: var(--fb-surface); border: 1px solid var(--fb-sep); border-radius: var(--fb-r-xl); overflow: hidden; box-shadow: var(--fb-shadow-sm); }
.fbl-rows li + li { border-top: 1px solid var(--fb-sep); }
.fbl-rows a { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 18px; text-decoration: none; color: var(--fb-label); }
.fbl-rows a:hover { background: var(--fb-surface-2); }
.fbl-rows .fbl-row-t { display: block; font-weight: 700; font-size: 16px; color: var(--fb-label); }
.fbl-rows .fbl-row-d { display: block; font-size: 13.5px; line-height: 1.45; color: var(--fb-muted); margin-top: 2px; }
.fbl-rows .fbl-row-chev { margin-left: auto; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--fb-faint); border-top: 2px solid var(--fb-faint); transform: rotate(45deg); }

/* cookie preferences panel */
.fbl-prefs { margin: 14px 0 4px; }
.fbl-pref { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-top: 1px solid var(--fb-sep); }
.fbl-pref:first-child { border-top: 0; }
.fbl-pref-text { flex: 1; min-width: 0; }
.fbl-pref-t { display: block; font-weight: 700; font-size: 15.5px; color: var(--fb-label); }
.fbl-pref-d { display: block; font-size: 14px; line-height: 1.5; color: var(--fb-muted); margin-top: 2px; }
.fbl-switch { position: relative; flex: none; width: 52px; height: 32px; margin-top: 2px; }
.fbl-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.fbl-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--fb-sep); transition: background .2s ease; }
.fbl-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.fbl-switch input:checked + span { background: var(--fb-forest); }
.fbl-switch input:checked + span::after { transform: translateX(20px); }
.fbl-switch input:focus-visible + span { outline: 3px solid var(--fb-navy-ink); outline-offset: 2px; }
.fbl-switch input:disabled { cursor: not-allowed; }
.fbl-switch input:disabled + span { opacity: .55; }
.fbl-prefs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.fbl-prefs-status { font-size: 14px; color: var(--fb-forest); font-weight: 700; min-height: 20px; }
.fbl-prefs-none { margin: 12px 0 0; font-size: 15px; line-height: 1.6; color: var(--fb-label); }

/* print: the document only */
@media print {
  .fb-topbar, .fbl-nav, .fbl-actions, .fbl-skip, .fbl-toc, #fbpCookieBanner, [data-fbp-chat] { display: none !important; }
  body.fbl { background: #fff; color: #000; }
  .fbl-shell { display: block; padding: 0; max-width: none; }
  .fbl-main { max-width: none; }
  .fbl-card { box-shadow: none; border: 0; padding: 0; }
  .fbl-doc a::after { content: ' (' attr(href) ')'; font-size: 11px; color: #555; }
  .fbl-doc a[href^="#"]::after { content: ''; }
  .fbl-table { overflow: visible; border: 0; }
  .fbl-table table { min-width: 0; }
  .fbl-doc h2, .fbl-doc h3 { break-after: avoid; }
}
