/* Rechtliche Seiten (Impressum, Datenschutz) und Cookie-Hinweis.
   Nutzt die Marken-Tokens aus style.css: Papier, Haarlinien, eine Signalfarbe. */

.legal-page {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  padding: max(2rem, env(safe-area-inset-top)) 16px 4rem;
}
.legal-wrap { max-width: 760px; margin: 0 auto; }
.legal-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 1rem; border-bottom: 1px solid var(--rule); margin-bottom: 2rem;
}
.legal-top a.legal-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.legal-top img { width: 36px; height: 36px; object-fit: contain; }
.legal-top .legal-back { color: var(--brand-ink); font-weight: 600; text-decoration: none; }
.legal-page h1 { font-family: var(--display); font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1.1; margin: 0 0 .4rem; }
.legal-page .legal-stand { color: var(--ink-3); font-family: var(--mono); font-size: .8rem; margin: 0 0 2rem; }
.legal-page h2 { font-size: 1.25rem; margin: 2.2rem 0 .6rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.legal-page h3 { font-size: 1rem; margin: 1.4rem 0 .4rem; }
.legal-page p, .legal-page li { line-height: 1.6; color: var(--ink-2); }
.legal-page address { font-style: normal; line-height: 1.6; }
.legal-page a { color: var(--brand-ink); }
.legal-page table { width: 100%; border-collapse: collapse; margin: .6rem 0 1rem; font-size: .92rem; }
.legal-page th, .legal-page td { text-align: left; vertical-align: top; padding: .5rem .6rem; border-bottom: 1px solid var(--rule); }
.legal-page th { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.legal-table-scroll { overflow-x: auto; }
.legal-footer-note { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--ink-3); }

/* Fußzeilen-Links (Login, Seitenleiste, „Mehr"-Blatt, rechtliche Seiten) */
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; font-size: .8rem; margin-top: 1.2rem; }
.legal-links a, .legal-links button {
  color: var(--ink-3); background: none; border: 0; padding: 2px 0; min-height: 0;
  font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; width: auto;
}
.legal-links a:hover, .legal-links button:hover { color: var(--ink); }
.sidebar-footer .legal-links { justify-content: flex-start; margin-top: 10px; }
.sidebar-footer .legal-links a, .sidebar-footer .legal-links button { color: inherit; opacity: .75; }

/* Cookie-Hinweis */
.cookie-notice {
  position: fixed; z-index: 10000; left: 16px; right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule-strong); border-top: 3px solid var(--brand);
  padding: 16px 18px;
  box-shadow: 0 12px 32px rgba(20, 18, 16, .18);
  animation: cookie-in .25s ease-out;
}
@keyframes cookie-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cookie-notice { animation: none; } }
@media (max-width: 767px) {
  html.has-app-shell .cookie-notice { bottom: calc(84px + env(safe-area-inset-bottom)); }
  /* Im geöffneten Chat liegt unten das Eingabefeld – Hinweis dann oben zeigen. */
  body.mobile-chat-open .cookie-notice { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }
}
.cookie-notice h2 { font-size: 1rem; margin: 0 0 6px; }
.cookie-notice p { margin: 0 0 12px; font-size: .9rem; line-height: 1.5; color: var(--ink-2); }
.cookie-notice a, .cookie-dialog-panel a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.cookie-notice .cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cookie-notice .cookie-actions button { width: auto; }

.cookie-settings-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.cookie-settings-list > li { border: 1px solid var(--rule); padding: 12px 14px; margin-bottom: 10px; }
.cookie-settings-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cookie-settings-head strong { font-size: .95rem; }
.cookie-switch { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ink-3); white-space: nowrap; }
.cookie-switch input { width: auto; margin: 0; }
.cookie-settings-list p { margin: 6px 0 0; font-size: .85rem; line-height: 1.5; color: var(--ink-2); }
.cookie-settings-list details { margin-top: 6px; font-size: .82rem; }
.cookie-settings-list .legal-table-scroll table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.cookie-settings-list td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.cookie-dialog {
  position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 18, 16, .45); padding: 16px;
}
.cookie-dialog-panel {
  background: var(--paper); color: var(--ink); width: 100%; max-width: 620px;
  max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px; border: 1px solid var(--rule-strong);
}
.cookie-dialog-panel h2 { margin: 0 0 8px; }
.cookie-dialog-panel > p { color: var(--ink-2); line-height: 1.5; font-size: .92rem; }
.cookie-dialog-panel .cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cookie-dialog-panel .cookie-actions button { width: auto; }
