/* ============================================================
   Legal Pages — shared styles
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:       rgba(0, 0, 0, 0.80);
  --ink-soft:  rgba(0, 0, 0, 0.45);
  --ink-faint: rgba(0, 0, 0, 0.28);
  --surface:   #f9f9f9;
  --white:     #ffffff;
  --border:    rgba(0, 0, 0, 0.08);
  --radius:    16px;
  --font:      -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Navbar ───────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 100;
  transition: background 0.3s ease;
}

#nav-logo img { width: 32px; height: auto; display: block; }
.nav-logo-link {
  display: block;
  text-decoration: none;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.nav-logo-link:hover { transform: scale(1.08); }

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 40px;
  height: 100%;
  align-items: stretch;
}
.nav-links a {
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.65;
  transition: opacity 0.2s;
}
.nav-links > a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}
.nav-links a:hover { opacity: 1; }

.nav-lang { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lang-pill {
  height: 28px;
  padding: 0 14px;
  border-radius: 100px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #ffffff;
  color: rgba(0,0,0,0.65);
  font-size: 12px;
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.04);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.lang-pill:hover {
  background: #f5f5f7;
  border-color: rgba(0,0,0,0.22);
  color: #000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 0 0 0.5px rgba(0,0,0,0.06);
}

.nav-menu-btn {
  display: none;
  margin-left: 8px;
}

/* ── Mobile nav ───────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  flex-direction: column;
  padding: 12px 0 16px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  z-index: 99;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.mobile-nav.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-nav-link {
  padding: 11px 28px;
  font-size: 15px;
  color: #000;
  text-decoration: none;
  opacity: 0.75;
  position: relative;
  transition: opacity 0.15s;
}
.mobile-nav-link:hover { opacity: 1; }

/* ── Page layout ──────────────────────────────────────────── */
.legal-page {
  padding-top: 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-header {
  padding: 72px 40px 48px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.legal-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.legal-header h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.legal-header p {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 540px;
}

/* ── Hub: accordion list ──────────────────────────────────── */
.legal-accordion-list {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px 80px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accordion {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.accordion__header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  color: var(--ink);
  transition: background 0.18s ease;
}
.accordion__header:hover { background: rgba(0,0,0,0.02); }

.accordion__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.accordion__icon { font-size: 18px; line-height: 1; }

.accordion__app-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.accordion__chevron {
  color: var(--ink-faint);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.accordion[data-open="false"] .accordion__chevron { transform: rotate(-90deg); }

.accordion__body {
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.25s ease;
  max-height: 2400px;
  opacity: 1;
}
.accordion[data-open="false"] .accordion__body {
  max-height: 0;
  opacity: 0;
}

/* ── Impressum static card ──────────────────────────────── */
.impressum-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.impressum-card__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.impressum-card__category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 2px;
}

.impressum-card__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

.impressum-card .impressum-inline { border-top: none; }

/* ── Impressum inline body ──────────────────────────────── */
.impressum-inline {
  padding: 20px 24px 28px;
  border-top: 1px solid var(--border);
}
.impressum-inline .doc-content h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 20px 0 6px;
}
.impressum-inline .doc-content h2:first-child { margin-top: 0; }
.impressum-inline .doc-content p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
}
.impressum-inline .doc-content p + p { margin-top: 6px; }
.impressum-inline .doc-content a { color: var(--ink); text-decoration: underline; }

/* ── Doc rows ─────────────────────────────────────────────── */
.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease;
}
.doc-row:hover { background: rgba(0,0,0,0.025); }

.doc-row--coming {
  cursor: default;
  color: var(--ink-faint);
}
.doc-row--coming:hover { background: none; }

.doc-row__icon { font-size: 16px; flex-shrink: 0; }

.doc-row__name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.doc-row__arrow {
  font-size: 14px;
  color: var(--ink-faint);
  transition: transform 0.15s ease;
}
.doc-row:not(.doc-row--coming):hover .doc-row__arrow { transform: translateX(3px); }

/* ── Document page: embed wrapper ────────────────────────── */
.legal-doc {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 40px 80px;
  width: 100%;
}

.legal-doc .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.2s;
}
.legal-doc .back-link:hover { color: var(--ink); }

.legal-doc__body {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 44px 48px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  min-height: 400px;
}

/* Termly iframe fills the card */
.legal-doc__body iframe { width: 100%; border: none; min-height: 600px; }

/* ── Document body typography ─────────────────────────────── */
.doc-content { display: none; }
.doc-content.is-active { display: block; }

.doc-content h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 36px 0 10px;
  color: var(--ink);
}
.doc-content h2:first-child { margin-top: 0; }

.doc-content p {
  margin: 0 0 14px;
  color: var(--ink-soft);
}

.doc-content ul, .doc-content ol {
  margin: 0 0 14px 20px;
  color: var(--ink-soft);
}
.doc-content li { margin-bottom: 6px; }

.doc-content a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.doc-content a:hover { color: rgba(0,0,0,0.55); }

.doc-content strong { color: var(--ink); font-weight: 600; }

.doc-content .doc-meta {
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.doc-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ── Navbar: dropdown (desktop) ─────────────────────────── */
.nav-dropdown { position: relative; display: flex; align-items: center; height: 100%; }

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--ink);
  opacity: 0.65;
  padding: 0;
  transition: opacity 0.2s;
}
.nav-dropdown-trigger:hover { opacity: 1; }

.nav-dd-chevron {
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.nav-dropdown:hover .nav-dd-chevron { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 6px;
  min-width: 160px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* invisible bridge covers the gap so mouse can travel to menu */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 18px;
}

.nav-dd-item {
  display: block;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(0,0,0,0.72);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
  cursor: pointer;
}
a.nav-dd-item:hover { background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.9); }
.nav-dd-item--dim { color: rgba(0,0,0,0.28); cursor: default; }
.nav-dd-item--dim:hover { background: none; }

/* Active: navbar-bottom indicator bar */
.nav-links a.is-active,
.nav-dropdown-trigger.is-active {
  opacity: 1 !important;
  text-decoration: none !important;
}
.nav-links > a.is-active::after,
.nav-dropdown.is-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(0,0,0,0.85);
  border-radius: 1px;
}
/* Active: sub-item gets dark-blue dot */
a.nav-dd-item.is-active { color: rgba(0,0,0,0.85); }
a.nav-dd-item.is-active::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1a54d8;
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* ── Mobile nav: accordion ───────────────────────────────── */
.mobile-nav-group { display: flex; flex-direction: column; }

.mobile-nav-group-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 28px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
  color: #000;
  opacity: 0.75;
  text-align: left;
  position: relative;
  transition: opacity 0.15s;
}
.mobile-nav-group-btn:hover { opacity: 1; }

.mobile-nav-chevron {
  flex-shrink: 0;
  transition: transform 0.25s ease;
  opacity: 0.4;
}
.mobile-nav-group.is-open .mobile-nav-chevron { transform: rotate(180deg); }

.mobile-nav-sub {
  height: 0;
  overflow: hidden;
  transition: height 0.28s cubic-bezier(0.4,0,0.2,1);
}

.mobile-nav-sub-link {
  display: block;
  padding: 9px 24px 9px 44px;
  font-size: 14px;
  color: rgba(0,0,0,0.7);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s;
}
a.mobile-nav-sub-link:hover { opacity: 1; }
.mobile-nav-sub-link--dim { color: rgba(0,0,0,0.3); cursor: default; }

/* Mobile active */
.mobile-nav-link.is-active,
.mobile-nav-group.is-active > .mobile-nav-group-btn {
  opacity: 1;
  font-weight: 600;
}
.mobile-nav-link.is-active::before,
.mobile-nav-group.is-active > .mobile-nav-group-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5px;
  height: 16px;
  background: rgba(0,0,0,0.85);
  border-radius: 0 2px 2px 0;
}
a.mobile-nav-sub-link.is-active { opacity: 1; font-weight: 600; color: rgba(0,0,0,0.85); }
a.mobile-nav-sub-link.is-active::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1a54d8;
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* ── Footer ───────────────────────────────────────────────── */
#footer {
  background: #0a0a0a;
  padding: 64px 40px 52px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 0 60px;
  align-items: start;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.footer-logo img {
  height: 24px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}
.footer-logo-name {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.01em;
}
.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.28);
  line-height: 1.5;
  margin: 0;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-col-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin: 0;
}
.footer-col-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col-links a {
  font-size: 13px;
  color: rgba(255,255,255,0.48);
  text-decoration: none;
  transition: color 0.18s ease;
}
.footer-col-links a:hover { color: rgba(255,255,255,0.9); }
.footer-link-dim {
  font-size: 13px;
  color: rgba(255,255,255,0.22);
}

/* ── Footer: col toggle button ── */
.footer-col-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: default;
  pointer-events: none;
  text-align: left;
}

.footer-col-chevron {
  display: none;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

/* ── Footer bottom (copyright) ── */
.footer-bottom {
  max-width: 1100px;
  margin: 28px auto 0;
  padding: 20px 40px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-bottom .footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.28);
  line-height: 1.5;
  margin: 0;
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  html { scroll-behavior: smooth; }

  #navbar { padding: 0 20px; }
  .nav-links { display: none !important; }
  .nav-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .mobile-nav { display: flex; }
  .lang-pill {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 8px rgba(0,0,0,0.06);
  }

  .legal-header         { padding: 48px 24px 36px; }
  .legal-accordion-list { padding: 0 24px 60px; }
  .legal-doc            { padding: 0 24px 60px; }
  .legal-doc__body { padding: 28px 24px 32px; }
  #footer { padding: 48px 24px 44px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 40px 24px; }
  .footer-brand { grid-column: 1 / -1; }

  /* Footer accordion on mobile */
  .footer-inner { grid-template-columns: 1fr !important; gap: 0 !important; }
  .footer-brand { padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.08); grid-column: auto !important; }
  .footer-col { border-top: 1px solid rgba(255,255,255,0.08); gap: 0; }
  .footer-col-toggle { cursor: pointer; pointer-events: auto; padding: 14px 0; }
  .footer-col-chevron { display: block; }
  .footer-col.is-open .footer-col-chevron { transform: rotate(180deg); }
  .footer-col-links { height: 0; overflow: hidden; transition: height 0.28s cubic-bezier(0.4,0,0.2,1); margin: 0; }
  .footer-col.is-open .footer-col-links { padding-bottom: 16px; }
  .footer-bottom { padding: 16px 0 0; margin-top: 16px; }
}

@media (hover: none) {
  .nav-logo-link:hover { transform: none; }
  .lang-pill:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.9);
    color: rgba(0,0,0,0.65);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 8px rgba(0,0,0,0.06);
  }
  .legal-card:hover { box-shadow: none; transform: none; }
}

/* ============================================================
   Three-column document layout (Goodnotes-style)
   ============================================================ */

.legal-doc-page {
  padding-top: 64px;
  min-height: 100vh;
  /* background inherits body's var(--surface) = #f9f9f9 */
}

/* ── Page header: back-link + label + h1, aligned to center column ── */
.legal-page-header {
  max-width: 1160px;
  margin: 0 auto;
  padding: 52px 40px 28px;
  display: grid;
  grid-template-columns: 210px 1fr 190px;
  gap: 0 52px;
}

.legal-header-inner {
  grid-column: 2;
}

.legal-layout {
  display: grid;
  grid-template-columns: 210px 1fr 190px;
  gap: 0 52px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px 100px;
  align-items: start;
}

/* ── Shared sidebar label ─────────────────────────────────── */
.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 16px;
  display: block;
}

/* ── Left TOC sidebar ─────────────────────────────────────── */
.legal-toc {
  position: sticky;
  top: 88px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.toc-item a {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 5px 0 5px 8px;
  cursor: pointer;
  transition: color 0.15s;
}
.toc-item a:hover { color: var(--ink); }
.toc-item.is-active a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* ── Center content ───────────────────────────────────────── */
.legal-content {
  min-width: 0;
}

.legal-back-link {
  margin-bottom: 28px;
}
.legal-back-link a {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s;
}
.legal-back-link a:hover { color: var(--ink); }

.legal-doc-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.legal-doc-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 28px;
}

/* Override doc-content typography when inside new layout */
.legal-content .doc-content h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 40px 0 10px;
  color: var(--ink);
}
.legal-content .doc-content h2:first-child { margin-top: 0; }

.legal-content .doc-content h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 28px 0 6px;
  color: var(--ink);
}

/* ── h1 row: title + prev/next buttons ───────────────────── */
.legal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.legal-title-row .legal-doc-title {
  margin-bottom: 0;
  flex: 1;
}

/* ── Prev / Next navigation buttons (glass, beside h1) ───── */
.doc-nav-btns {
  display: none;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.doc-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(210, 210, 210, 0.7);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px) saturate(1.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.55);
  font-size: 14px;
  font-family: var(--font);
  font-weight: 500;
  line-height: 1;
  transition: background 0.15s, box-shadow 0.15s;
}
.doc-nav-btn:hover {
  background: rgba(255,255,255,0.88);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,1);
  color: rgba(0,0,0,0.8);
}
.doc-nav-btn:disabled {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}

/* ── Right legal nav sidebar ──────────────────────────────── */
.legal-nav-sidebar {
  position: sticky;
  top: 88px;
}

.legal-nav-group {
  margin-bottom: 6px;
}

.legal-nav-group-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: left;
  transition: color 0.15s;
}
.legal-nav-group-title:hover { color: var(--ink-soft); }
.legal-nav-group.is-open > .legal-nav-group-title { font-size: 13px; }

.legal-nav-chevron {
  flex-shrink: 0;
  color: var(--ink-faint);
  transition: transform 0.22s ease;
}
.legal-nav-group.is-open .legal-nav-chevron { transform: rotate(180deg); }

.legal-nav-group-body {
  height: 0;
  overflow: hidden;
  transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.legal-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 5px 0;
  transition: color 0.15s;
}
.legal-nav-item::after {
  content: '→';
  font-size: 12px;
  color: var(--ink-faint);
  flex-shrink: 0;
  margin-left: 6px;
  transition: transform 0.15s;
}
.legal-nav-item:hover { color: var(--ink); }
.legal-nav-item:hover::after { transform: translateX(2px); }
.legal-nav-item.is-active {
  color: var(--ink);
  font-weight: 600;
}
.legal-nav-item.is-active::after { color: rgba(0,0,0,0.35); }

/* ── Responsive: tablet (≤1000px) — hide right sidebar, show nav btns */
@media (max-width: 1000px) {
  .legal-page-header {
    grid-template-columns: 190px 1fr;
    max-width: 880px;
    gap: 0 40px;
  }
  .legal-header-inner { grid-column: 2; }
  .legal-layout {
    grid-template-columns: 190px 1fr;
    max-width: 880px;
    gap: 0 40px;
  }
  .legal-nav-sidebar { display: none; }
  .doc-nav-btns { display: flex; }
}

/* ── Responsive: mobile (≤768px) — single column ─────────── */
@media (max-width: 768px) {
  .legal-page-header {
    grid-template-columns: 1fr;
    padding: 36px 24px 20px;
    gap: 0;
  }
  .legal-header-inner { grid-column: 1; }
  .legal-layout {
    grid-template-columns: 1fr;
    padding: 0 24px 80px;
    gap: 0;
  }
  .legal-toc { display: none; }
  .legal-nav-sidebar {
    display: block;
    position: static;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
  }
  .doc-nav-btns { display: flex; }
}

/* ── Legal document tables ─────────────────────────────────── */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 24px;
  font-size: 13px;
  line-height: 1.5;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.legal-table th {
  background: var(--bg-soft, #f5f5f5);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1.5px solid var(--border, #e0e0e0);
}
.legal-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light, #eee);
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 240px;
}
.legal-table tbody tr:last-child td { border-bottom: none; }
.legal-table a { color: inherit; word-break: break-all; }

/* Info-style table (key/value, no header) */
.info-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
  width: 30%;
  color: var(--ink-soft, #555);
}

/* Notice / callout box */
.doc-notice {
  background: rgba(0, 0, 0, 0.03);
  border-left: 3px solid rgba(0, 0, 0, 0.15);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 16px 0;
}

/* Key-points section label ("重點摘要 / Key Points") */
.doc-kp-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 8px !important;
}

/* Key-points summary (top of privacy/terms doc) */
.doc-key-points {
  margin: 0 0 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.doc-key-points p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 8px !important;
}
.doc-key-points p:last-child { margin-bottom: 0 !important; }

/* .legal-table overflow-x is handled in the base rule above */
