/* Public privacy policy page */
:root {
  --accent: #2563eb;
  --ink: #111113;
  --text: #333338;
  --muted: #6b6b76;
  --line: #e2e2e6;
  --soft: #f3f3f6;
  --bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #5b9cf5;
    --ink: #ededf0;
    --text: #c8c8ce;
    --muted: #8e8e9a;
    --line: #28282e;
    --soft: #18181c;
    --bg: #0e0e10;
  }
}
:root[data-theme="dark"] {
  --accent: #5b9cf5;
  --ink: #ededf0;
  --text: #c8c8ce;
  --muted: #8e8e9a;
  --line: #28282e;
  --soft: #18181c;
  --bg: #0e0e10;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.page { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* ---------- preview banner ---------- */
.preview-banner {
  position: sticky; top: 0; z-index: 10;
  padding: 6px 14px; background: #fffbeb; border-bottom: 1px solid #fde68a;
  color: #92400e; font-size: 12px; text-align: center;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .preview-banner { background: #422006; border-color: #854d0e; color: #fde68a; }
}

/* ---------- header ---------- */
.policy-header { padding: 48px 0 24px; text-align: center; }

.policy-logo {
  display: block; width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 14px; object-fit: cover; background: var(--soft);
  box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 6px 18px -8px rgba(0,0,0,.2);
}
.policy-logo--fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 22px; font-weight: 600;
}

.policy-app-name { margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 500; }

.policy-header h1 {
  color: var(--ink); font-size: 30px; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.15;
}
.policy-dates { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.policy-dates span { margin: 0 5px; }

/* ---------- download ---------- */
.policy-download {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 12px; font-weight: 500; color: var(--ink); text-decoration: none;
  transition: background .12s, border-color .12s;
}
.policy-download:hover { background: var(--soft); border-color: var(--muted); color: var(--ink); }

/* ---------- table of contents ---------- */
.policy-toc { margin: 0 0 32px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.policy-toc summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; color: var(--ink); font-size: 13px; font-weight: 600;
  cursor: pointer; list-style: none;
}
.policy-toc summary::-webkit-details-marker { display: none; }
.policy-toc summary::after {
  content: ""; width: 6px; height: 6px; margin-right: 2px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform .12s ease;
}
.policy-toc[open] summary::after { transform: rotate(-135deg) translateY(-2px); }

.policy-toc ol {
  margin: 0; padding: 0 0 12px; list-style: none;
  counter-reset: toc; columns: 2; column-gap: 20px;
}
.policy-toc li { counter-increment: toc; break-inside: avoid; }
.policy-toc a {
  display: block; padding: 3px 0; color: var(--text);
  font-size: 13px; text-decoration: none; transition: color .1s;
}
.policy-toc a::before {
  content: counter(toc, decimal-leading-zero);
  display: inline-block; width: 24px; color: var(--muted);
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.policy-toc a:hover { color: var(--accent); }

/* ---------- sections ---------- */
.policy-content { counter-reset: section; }
.policy-section { counter-increment: section; margin: 0 0 32px; scroll-margin-top: 20px; }

.policy-section h2 {
  margin: 0 0 8px; color: var(--ink); font-size: 18px; font-weight: 650;
  letter-spacing: -0.015em; line-height: 1.3;
}
.policy-section h2::before {
  content: counter(section, decimal-leading-zero);
  display: block; margin-bottom: 2px; color: var(--accent);
  font-size: 11px; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums;
}

.policy-section h3 { margin: 20px 0 6px; color: var(--ink); font-size: 15px; font-weight: 600; }
.policy-section p { margin: 0 0 10px; }
.policy-section ul { margin: 0 0 10px; padding-left: 18px; }
.policy-section li { margin-bottom: 4px; }
.policy-section li::marker { color: var(--muted); }

/* ---------- data list ---------- */
.policy-section .data-list { margin: 0 0 12px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.policy-section .data-list li { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.data-list p { margin: 3px 0 0; font-size: 14px; }
.data-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.data-list-head strong { margin-right: 2px; color: var(--ink); font-weight: 600; }
.data-list .data-list-meta { color: var(--muted); font-size: 12px; }

.tag {
  padding: 1px 7px; border-radius: 999px; background: var(--soft);
  color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.6;
}

/* ---------- permission chips ---------- */
.policy-section .chip-list {
  display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; padding: 0; list-style: none;
}
.policy-section .chip-list li {
  margin: 0; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font-size: 12px; font-weight: 500;
}

.policy-section .why {
  padding: 10px 12px; border-radius: 8px; background: var(--soft); font-size: 14px;
}
.why span { display: block; margin-bottom: 2px; color: var(--ink); font-size: 12px; font-weight: 600; }

/* ---------- tables ---------- */
.policy-table { width: 100%; margin: 0 0 12px; border-collapse: collapse; font-size: 13px; }
.policy-table th, .policy-table td {
  padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top;
}
.policy-table th { color: var(--muted); font-size: 11px; font-weight: 500; }

/* ---------- contacts ---------- */
.policy-section .policy-contacts { padding: 0; list-style: none; }
.policy-section .policy-contacts li {
  margin-bottom: 8px; padding: 10px 12px; border-radius: 8px;
  background: var(--soft); font-size: 14px;
}
.policy-contacts strong { color: var(--ink); }

/* ---------- footer ---------- */
.policy-footer {
  padding: 20px 0 40px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; text-align: center;
}
.policy-footer p { margin: 0 0 2px; }
.policy-footer a { color: var(--muted); }

/* ---------- tablet ---------- */
@media (max-width: 768px) {
  .policy-header { padding: 36px 0 20px; }
  .policy-header h1 { font-size: 26px; }
}

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .page { padding: 0 12px; }
  .policy-header { padding: 28px 0 16px; }
  .policy-header h1 { font-size: 22px; }
  .policy-logo { width: 44px; height: 44px; border-radius: 11px; }
  .policy-toc ol { columns: 1; }
  .policy-section { margin-bottom: 24px; }
  .policy-section h2 { font-size: 16px; }

  .policy-table thead { display: none; }
  .policy-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .policy-table td { display: block; padding: 1px 0; border: none; }
  .policy-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 11px; }

  .policy-section .why { padding: 8px 10px; }
  .policy-section .policy-contacts li { padding: 8px 10px; }
}

/* ---------- very small ---------- */
@media (max-width: 380px) {
  .page { padding: 0 10px; }
  .policy-header h1 { font-size: 20px; }
  .policy-footer { padding: 16px 0 28px; }
}

/* ---------- print ---------- */
@media print {
  .preview-banner, .policy-toc, .policy-download { display: none; }
  body { font-size: 11pt; line-height: 1.5; color: #000; background: #fff; }
  .policy-header { padding-top: 0; }
  .policy-section { break-inside: avoid; }
  a { color: inherit; }
}
