/* TouTop legal editorial override. Loaded after legal.css so the canonical
 * BrandBook palette and typography remain authoritative on static documents.
 */

:root {
  --legal-midnight: #002677;
  --legal-navy: #002677;
  --legal-electric-blue: #2e5cf3;
  --legal-pink: #d65c88;
  --legal-cyan: #2ea7ff;
  --legal-blue: var(--legal-electric-blue);
  --legal-mauve: var(--legal-pink);
  --legal-page: #f2f2f2;
  --legal-surface: #ffffff;
  --legal-soft: #eef4fb;
  --legal-copy: var(--legal-midnight);
  --legal-muted: #405071;
  --legal-border: rgba(46, 92, 243, 0.18);
  --legal-shadow: 0 18px 52px rgba(0, 38, 119, 0.1);

  --tt-bg: var(--legal-page);
  --tt-bg-2: var(--legal-soft);
  --tt-surface: var(--legal-surface);
  --tt-surface-strong: var(--legal-surface);
  --tt-surface-soft: var(--legal-soft);
  --tt-border: var(--legal-border);
  --tt-border-strong: rgba(46, 167, 255, 0.24);
  --tt-text: var(--legal-copy);
  --tt-muted: var(--legal-muted);
  --tt-dim: #778397;
  --tt-accent: var(--legal-blue);
  --tt-accent-2: var(--legal-cyan);
  --tt-shadow: var(--legal-shadow);
  --tt-shadow-soft: 0 10px 30px rgba(0, 38, 119, 0.07);
}

html[data-theme="dark"] {
  --legal-blue: var(--legal-cyan);
  --legal-page: #0a1d3f;
  --legal-surface: #10294d;
  --legal-soft: #15385f;
  --legal-copy: #f2f2f2;
  --legal-muted: #b4c6e1;
  --legal-border: rgba(46, 167, 255, 0.24);
  --legal-shadow: 0 20px 58px rgba(0, 38, 119, 0.34);

  --tt-bg: var(--legal-page);
  --tt-bg-2: var(--legal-soft);
  --tt-surface: var(--legal-surface);
  --tt-surface-strong: var(--legal-surface);
  --tt-surface-soft: var(--legal-soft);
  --tt-border: var(--legal-border);
  --tt-border-strong: rgba(46, 167, 255, 0.28);
  --tt-text: var(--legal-copy);
  --tt-muted: var(--legal-muted);
  --tt-dim: #8794a8;
  --tt-accent: var(--legal-blue);
  --tt-accent-2: var(--legal-cyan);
  --tt-shadow: var(--legal-shadow);
  --tt-shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.22);
}

html,
body {
  background: var(--legal-page) !important;
}

body {
  color: var(--legal-copy) !important;
  font-family: var(--tt-font-apple, ui-sans-serif, system-ui, sans-serif) !important;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: none !important;
  display: none !important;
}

.policy-document {
  width: min(1040px, 100%) !important;
}

.policy-hero,
.policy-section,
.policy-footer,
.card,
.tier,
.example,
.formula,
.meta {
  overflow: visible !important;
  border: 1px solid var(--legal-border) !important;
  background: var(--legal-surface) !important;
  color: var(--legal-copy) !important;
  box-shadow: var(--legal-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
}

.policy-hero::before,
.policy-hero::after,
.policy-section::before,
.policy-section::after,
.policy-footer::before,
.policy-footer::after,
.card::before,
.card::after,
.tier::before,
.tier::after,
.example::before,
.example::after,
.formula::before,
.formula::after,
.meta::before,
.meta::after {
  content: none !important;
  display: none !important;
}

.policy-hero {
  border-radius: 30px !important;
  padding: clamp(24px, 5vw, 54px) !important;
}

.policy-hero-body {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
}

.policy-hero-copy {
  max-width: 790px !important;
}

.policy-visual {
  display: none !important;
}

.policy-hero h1 {
  max-width: 820px;
  color: var(--legal-copy) !important;
  font-size: clamp(2.25rem, 6vw, 4.5rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.055em !important;
  text-wrap: balance;
}

.policy-hero h1::after {
  width: 84px !important;
  height: 4px !important;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--legal-blue), var(--legal-cyan)) !important;
}

.policy-hero-brand img {
  box-shadow: 0 10px 30px rgba(46, 167, 255, 0.22) !important;
}

.meta {
  margin-top: 22px !important;
  padding: 16px 18px !important;
  border-radius: 16px !important;
  background: var(--legal-soft) !important;
  color: var(--legal-muted) !important;
  font-size: 0.8125rem !important;
  line-height: 1.75 !important;
  box-shadow: none !important;
}

.policy-section {
  margin-block: 14px !important;
  padding: clamp(22px, 4vw, 34px) !important;
  border-radius: 22px !important;
}

.policy-section:hover {
  border-color: rgba(46, 167, 255, 0.28) !important;
  transform: none !important;
  box-shadow: var(--legal-shadow) !important;
}

.policy-section h2 {
  color: var(--legal-copy) !important;
  font-size: clamp(1.25rem, 2.3vw, 1.65rem) !important;
  letter-spacing: -0.025em !important;
}

.policy-section :where(p, li, td, th) {
  color: var(--legal-muted) !important;
  font-size: 0.9375rem !important;
  line-height: 1.8 !important;
}

.policy-section :where(strong, b),
.policy-section th {
  color: var(--legal-copy) !important;
}

.policy-section a,
.policy-footer a,
.meta a {
  color: #0F54D6 !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

html[data-theme="dark"] :where(.policy-section, .policy-footer, .meta) a {
  color: #2EA7FF !important;
}

.policy-section table {
  overflow: hidden;
  border: 1px solid var(--legal-border) !important;
  border-radius: 16px !important;
  background: var(--legal-surface) !important;
}

.policy-section th {
  background: var(--legal-soft) !important;
}

.policy-section :where(th, td) {
  border-color: var(--legal-border) !important;
}

.callout,
.note,
.warning,
.example,
.formula {
  border-color: rgba(46, 167, 255, 0.22) !important;
  background: var(--legal-soft) !important;
  color: var(--legal-copy) !important;
  box-shadow: none !important;
}

.policy-footer {
  border-radius: 22px !important;
  padding: 22px 24px !important;
}

.lang-switch {
  width: min(1040px, 100%) !important;
  border-color: var(--legal-border) !important;
  background: color-mix(in srgb, var(--legal-surface) 92%, transparent) !important;
  box-shadow: 0 12px 34px rgba(0, 38, 119, 0.11) !important;
  backdrop-filter: blur(18px) saturate(125%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(125%) !important;
}

.lang-switch button,
.policy-hero-links a,
.policy-footer-links a,
.nav a,
a[href^="mailto:"] {
  min-height: 44px !important;
  height: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--legal-border) !important;
  border-radius: 999px !important;
  background: var(--legal-soft) !important;
  color: var(--legal-muted) !important;
  box-shadow: none !important;
  transform: none !important;
}

.policy-brand,
.policy-footer-brand,
.policy-section a {
  min-height: 44px !important;
  display: inline-flex;
  align-items: center;
}

.lang-switch button.active,
.policy-hero-links a.is-current,
.policy-footer-links a.is-current {
  border-color: rgba(46, 167, 255, 0.68) !important;
  background: linear-gradient(135deg, #2E5CF3, #002677) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 12px 30px rgba(0, 38, 119, 0.24) !important;
}

:where(.lang-switch button, .policy-hero-links a, .policy-footer-links a, .nav a, a[href^="mailto:"]):hover {
  border-color: rgba(46, 167, 255, 0.34) !important;
  color: var(--legal-blue) !important;
  transform: none !important;
  filter: none !important;
}

:where(button, a):focus-visible {
  outline: 2px solid #ffffff !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px #2E5CF3 !important;
}

@media (max-width: 760px) {
  body {
    padding: 10px 10px 56px !important;
  }

  .policy-document {
    width: 100% !important;
  }

  .lang-switch {
    overflow-x: auto;
    width: 100% !important;
  }

  .lang-switch button {
    min-width: 74px;
    min-height: 44px !important;
    padding-inline: 14px !important;
  }

  .policy-hero {
    border-radius: 22px !important;
    padding: 22px 18px !important;
  }

  .policy-hero-links,
  .policy-footer-links {
    justify-content: flex-start !important;
  }

  .policy-section {
    padding: 20px 18px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --legal-border: rgba(46, 167, 255, 0.54);
  }
}

/* Approved TouTop wordmark replaces the legacy favicon + text treatment on
   every standalone policy surface. */
.lang-switch::before,
.lang-switch::after {
  content: none !important;
  display: none !important;
}

.policy-logo-art,
.policy-lang-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.policy-lang-brand {
  min-height: 44px;
  margin-right: auto;
  border-radius: 12px;
}

.policy-logo-art img {
  display: block !important;
  width: auto !important;
  max-width: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  object-fit: contain;
}

.policy-logo-art--header img { height: 38px !important; }
.policy-logo-art--footer img { height: 32px !important; }
.policy-logo-art--language img { height: 30px !important; }
.policy-logo-art [data-logo-variant="inverse"] { display: none !important; }
html[data-theme="dark"] .policy-logo-art [data-logo-variant="primary"] { display: none !important; }
html[data-theme="dark"] .policy-logo-art [data-logo-variant="inverse"] { display: block !important; }

@media print {
  .policy-logo-art img {
    width: auto !important;
    height: 10.5mm !important;
  }
}
