/* Legal pages (terms, privacy, impressum, delete-account). Loaded after
   styles.css and built from its tokens only: the same canvas, grain, header
   pill and footer, with a reading column in place of the marketing sections.
   The pages need no JavaScript (the cursor trail is their only script); the
   contents list is plain anchors. */

.legal { padding-block: clamp(120px, 12vw, 168px) clamp(48px, 6vw, 88px); }

/* ── Head: tag, title, date, and the switcher between the four documents ── */
.legal__head { max-width: 880px; }
.legal__head .h1 { font-size: clamp(2.5rem, 5vw, 3.75rem); }
.legal__meta { margin-top: 16px; font-size: var(--fs-sm); color: var(--ink-2); }
.legal__tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: clamp(28px, 3.4vw, 40px); }
.legal__tabs a {
  padding: 9px 14px; border-radius: 10px;
  font-size: 15px; font-weight: 500; letter-spacing: -.01em; color: var(--ink-2);
  background: var(--soft);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.legal__tabs a:hover { background: #E9E5E2; color: var(--ink); }
.legal__tabs a[aria-current="page"] { background: var(--navy); color: #fff; }

/* ── Body: sticky contents beside the reading column ── */
.legal__body {
  display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 720px); gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(36px, 4.5vw, 64px); padding-top: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--line);
}
.legal__body--plain { grid-template-columns: minmax(0, 720px); }
.toc { position: sticky; top: 112px; align-self: start; max-height: calc(100vh - 140px); overflow-y: auto; font-size: 15px; }
.toc__label { margin-bottom: 12px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.toc ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: block; padding: 6px 10px; margin-left: -10px; border-radius: 8px; color: var(--ink-2); line-height: 1.35; transition: background-color .25s var(--ease), color .25s var(--ease); }
.toc a:hover { background: var(--soft); color: var(--ink); }
/* On a narrow screen the sticky list gives way to the same list folded into
   one box above the text. display: none keeps the idle copy out of the
   accessibility tree, so a reader meets the contents once. */
.toc-fold { display: none; background: var(--soft); border-radius: var(--r-md); padding: 0 18px; font-size: 15px; }
.toc-fold summary { display: flex; align-items: center; justify-content: space-between; list-style: none; padding: 16px 0; font-weight: 500; cursor: pointer; }
.toc-fold summary::-webkit-details-marker { display: none; }
.toc-fold summary svg { width: 20px; height: 20px; color: var(--ink-2); transition: transform .4s var(--ease); }
.toc-fold[open] summary svg { transform: rotate(180deg); }
.toc-fold ol { margin: 0; padding: 0 0 14px; list-style: none; }
.toc-fold a { display: block; padding: 7px 0; color: var(--ink-2); line-height: 1.35; }
@media (max-width: 860px) {
  .legal__body { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .toc { display: none; }
  .toc-fold { display: block; }
}

/* ── Prose ── */
.prose { font-size: var(--fs-sm); line-height: 1.6; letter-spacing: -.01em; color: var(--ink); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; text-wrap: pretty; }
.prose h2 {
  margin: clamp(40px, 5vw, 64px) 0 16px;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem); font-weight: 500; line-height: 1.15; letter-spacing: -.03em; color: var(--navy);
  text-wrap: balance;
}
.prose h3 { margin: 32px 0 10px; font-size: 1.125rem; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; color: var(--navy); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.3em; }
.prose ul > li::before { content: ""; position: absolute; left: .25em; top: .68em; width: 6px; height: 6px; border-radius: 50%; background: var(--sky-m); }
.prose li { margin: .4em 0; }
.prose li > ul, .prose li > ol { margin: .4em 0 0; }
.prose strong { font-weight: 600; }
.prose a { color: var(--tag-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--tag-ink) 35%, transparent); text-underline-offset: 3px; transition: text-decoration-color .25s var(--ease); }
.prose a:hover { text-decoration-color: currentColor; }
.prose code { font-size: .9em; padding: 2px 6px; border-radius: 6px; background: var(--soft); }

/* The operator's name and address: a card, the way the app sets a profile row. */
.prose .operator {
  width: fit-content; max-width: 100%; margin: 20px 0 24px; padding: 18px 22px;
  background: var(--soft); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line);
  line-height: 1.5;
}

/* Step-by-step instructions: numbered rows in one soft box. */
.prose .steps { margin: 20px 0 24px; padding: 8px 22px; background: var(--soft); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); }
.prose .steps ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.prose .steps li { counter-increment: step; position: relative; margin: 0; padding: 14px 0 14px 44px; }
.prose .steps li + li { border-top: 1px solid var(--line); }
.prose .steps li::before {
  content: counter(step); position: absolute; left: 0; top: 12px;
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 600; color: var(--tag-ink); background: var(--tag-bg);
}

/* Tables scroll inside their own rounded box, never the page. */
.prose .table-wrap { margin: 20px 0 24px; overflow-x: auto; background: var(--soft); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { padding: 14px 18px; text-align: left; vertical-align: top; }
.prose th { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.prose tbody tr, .prose tr + tr { border-top: 1px solid var(--line); }

/* ── Impressum contact form ── */
.prose form { margin: 20px 0 8px; padding: 22px; max-width: 560px; background: var(--soft); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); }
.prose label { display: block; margin-top: 16px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.prose label:first-child { margin-top: 0; }
.prose input, .prose textarea {
  display: block; width: 100%; margin-top: 8px; padding: 13px 14px;
  font: inherit; font-size: 16px; letter-spacing: -.01em; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.prose textarea { resize: vertical; min-height: 140px; }
.prose input:focus, .prose textarea:focus { outline: none; border-color: var(--sky-m); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sky-m) 25%, transparent); }
.prose form .btn { margin-top: 18px; }
.prose .form-note { margin: 16px 0 0; font-size: 14px; color: var(--ink-2); }
.prose .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Result banners: the app's success and error tags, full width. */
.prose .banner { margin: 20px 0; padding: 14px 18px; max-width: 560px; border-radius: var(--r-sm); font-size: 15px; color: var(--green); background: #C3EED0; }
.prose .banner-error { color: var(--red-text); background: #FEE4E2; }
.prose .banner a { color: inherit; text-decoration-color: currentColor; }
.prose [hidden] { display: none; }

@media print {
  .nav, .toc, .toc-fold, .legal__tabs, .footer__grid, body::after { display: none !important; }
  .legal { padding-top: 0; }
  .legal__body { display: block; border: 0; }
}
