/* Privacy notice and terms of use, in a pop-up (legal.js). Deliberately plain, the way large
   companies set their legal text: one white sheet, a bar with a switch between the two documents,
   then the text as a single column of numbered sections in small regular type, no images, no colour,
   no decoration. Same shell as the cookie pop-up (privacy.css): white, 24px corners, the page dimmed
   and blurred behind, a round close button, a faint-wash "Done". */
.legal-dialog {
  --ink: #120c08; --soft: rgba(18, 12, 8, .66);
  width: min(760px, calc(100% - 32px)); height: min(86dvh, 920px); max-height: none; padding: 0; overflow: hidden;
  border: 0; border-radius: 24px; background: #fff; color: var(--ink);
  box-shadow: 0 24px 64px rgba(18, 12, 8, .18), 0 2px 8px rgba(18, 12, 8, .06);
  font: 400 14px/22px var(--landing-body, "Figtree", "DM Sans", system-ui, sans-serif);
}
.legal-dialog[open] { display: flex; flex-direction: column; animation: legal-in .3s cubic-bezier(.22, 1, .36, 1); }
.legal-dialog::backdrop { background: rgba(18, 12, 8, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.legal-dialog[open]::backdrop { animation: legal-fade .3s ease; }
@keyframes legal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes legal-fade { from { opacity: 0; } }

/* Top bar: the document switch on the left, close on the right, a hairline under it. */
.legal-dialog__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none;
  padding: 14px 16px 14px 20px; box-shadow: 0 1px rgba(18, 12, 8, .08);
}
.legal-dialog__tabs { display: flex; gap: 4px; padding: 4px; border-radius: 1000px; background: rgba(18, 12, 8, .05); }
.legal-dialog__tabs button {
  height: 32px; padding: 0 14px; border: 0; border-radius: 1000px; background: none; cursor: pointer;
  font: 500 14px/1 var(--landing-body, "Figtree", "DM Sans", system-ui, sans-serif); color: var(--soft);
}
.legal-dialog__tabs [aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(18, 12, 8, .14); }
.legal-dialog__close {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(18, 12, 8, .05); color: var(--ink); cursor: pointer;
  transition: background-color .2s ease;
}
.legal-dialog__close:hover { background: rgba(18, 12, 8, .09); }
.legal-dialog__close svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

/* The document: one column, numbered sections, small regular type. */
.legal-dialog__body { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 28px 40px 40px; overscroll-behavior: contain; }
.legal-dialog__body > * { max-width: 68ch; }
.legal-dialog__body h2 { margin: 0; font: 500 22px/28px var(--landing-head, "Manrope", "DM Sans", system-ui, sans-serif); letter-spacing: -.2px; }
.legal-dialog__meta { margin: 6px 0 0; font-size: 13px; color: var(--soft); }
.legal-dialog__intro { margin: 16px 0 0; padding-bottom: 20px; box-shadow: 0 1px rgba(18, 12, 8, .08); color: var(--soft); }
.legal-dialog__body h3 { margin: 26px 0 6px; font: 600 14px/22px var(--landing-body, "Figtree", "DM Sans", system-ui, sans-serif); }
.legal-dialog__body p { margin: 0 0 12px; color: rgba(18, 12, 8, .8); }
.legal-dialog__body a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.legal-dialog__body strong { font-weight: 600; color: var(--ink); }
.legal-dialog__body ul { margin: 0 0 12px; padding-left: 20px; color: rgba(18, 12, 8, .8); }
.legal-dialog__body li { margin: 0 0 6px; padding-left: 2px; }
/* A plain ruled table (the cookie list): small type, hairlines between rows, scrolls sideways on
   narrow screens rather than squeezing. */
.legal-dialog__body table { display: block; width: 100%; max-width: 100%; margin: 4px 0 16px; overflow-x: auto; border-collapse: collapse; font-size: 13px; line-height: 1.45; }
.legal-dialog__body th, .legal-dialog__body td { padding: 9px 14px 9px 0; text-align: left; vertical-align: top; box-shadow: inset 0 -1px rgba(18, 12, 8, .08); }
.legal-dialog__body th { font-weight: 600; color: var(--ink); white-space: nowrap; }
.legal-dialog__body td { color: rgba(18, 12, 8, .8); min-width: 110px; }
.legal-dialog__body :is(th, td):last-child { padding-right: 0; }
.legal-dialog__body [data-cookie-settings] {
  padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}

/* Bottom bar: who to ask, and Done. */
.legal-dialog__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none;
  padding: 12px 16px 12px 24px; box-shadow: 0 -1px rgba(18, 12, 8, .08);
}
.legal-dialog__foot p { margin: 0; font-size: 13px; color: var(--soft); }
.legal-dialog__foot a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.legal-dialog__done {
  height: 40px; padding: 0 22px; border: 0; border-radius: 1000px; background: rgba(18, 12, 8, .08); color: var(--ink); cursor: pointer;
  font: 500 14px/1 var(--landing-body, "Figtree", "DM Sans", system-ui, sans-serif); transition: background-color .2s ease;
}
.legal-dialog__done:hover { background: rgba(18, 12, 8, .12); }
.legal-dialog :is(button, a, .legal-dialog__body):focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Phones: a full-height sheet from the bottom edge. */
@media (max-width: 560px) {
  .legal-dialog { width: calc(100% - 16px); height: calc(100dvh - 40px); margin: auto auto 8px; border-radius: 22px; }
  .legal-dialog__bar { gap: 8px; padding: 12px; }
  /* Short names on phones (Privacy, Terms, Cookies) so the three fit at full size. */
  .legal-dialog__tabs button { padding: 0 12px; white-space: nowrap; }
  .legal-dialog__tab-rest { display: none; }
  /* The cookie table stacks: one block per row, the name in bold, then purpose, type and duration. */
  .legal-dialog__body table, .legal-dialog__body tbody, .legal-dialog__body tr, .legal-dialog__body td { display: block; }
  .legal-dialog__body thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legal-dialog__body tr { padding: 12px 0; box-shadow: inset 0 -1px rgba(18, 12, 8, .08); }
  .legal-dialog__body td { min-width: 0; padding: 2px 0; box-shadow: none; }
  .legal-dialog__body td:first-child { font-weight: 600; color: var(--ink); }
  .legal-dialog__body td:nth-child(3)::before { content: "Type: "; font-weight: 600; }
  .legal-dialog__body td:nth-child(4)::before { content: "Duration: "; font-weight: 600; }
  .legal-dialog__body { padding: 22px 20px 32px; }
  .legal-dialog__foot { padding: 10px 12px 10px 20px; }
  .legal-dialog__done { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .legal-dialog[open], .legal-dialog[open]::backdrop { animation: none; }
}
