/* Legal pages: privacy-policy.html, terms.html, cookie-policy.html, safedating.html.
   The mobile app and the web app open them inside the app; html.embedded is set there. */

/* Force light theme on iOS WebKit (Dark Mode auto-invert protection). */
:root {
  color-scheme: light;
  --accent: #d80a38;
  --accent-soft: #fff0f3;
  --text: #1d1d1f;
  --body: #3a3a3c;
  --muted: #6e6e73;
  --line: #ebebef;
  --surface: #f6f6f8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { background-color: #ffffff; color: #1d1d1f; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[id] { scroll-margin-top: 24px; }
.icon { width: 1em; height: 1em; flex: none; }

.page { max-width: 1120px; margin: 0 auto; padding: 24px 20px 40px; }

.hero { padding: 8px 0 28px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; }
.brand img { width: 30px; height: 22px; }
h1 { margin: 36px 0 16px; font-size: clamp(38px, 7vw, 56px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 800; color: var(--text); }
.hero h1:last-child { margin-bottom: 0; }
.updated { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; }

.layout { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
.intro p, .section p, .section li, .section td { color: var(--body); }
p { margin: 0 0 14px; }
ul { margin: 0 0 14px; padding-left: 22px; }
li { margin: 6px 0; }
li::marker { color: var(--accent); }
li ul { margin: 6px 0 0; }
strong, b { color: var(--text); }
code { font-size: 14px; background: var(--surface); border-radius: 6px; padding: 1px 6px; color: var(--text); }

.toc { background: var(--surface); border-radius: 18px; padding: 20px 12px 12px; }
.toc h2 { display: flex; align-items: center; gap: 8px; margin: 0 8px 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 15px; line-height: 1.35; }
.toc a .icon { font-size: 18px; color: var(--muted); }
.toc a:hover { background: #ececf0; }
.toc a[aria-current="true"] { background: #ffffff; color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.toc a[aria-current="true"] .icon { color: var(--accent); }

.section { margin: 0 0 48px; }
.section h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font-size: 24px; line-height: 1.25; letter-spacing: -0.01em; color: var(--text); }
.badge { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); font-size: 22px; flex: none; }
.section h3 { margin: 26px 0 8px; font-size: 17px; line-height: 1.35; color: var(--text); }
.lead { margin: 0 0 18px; padding: 14px 18px; border-left: 3px solid var(--accent); border-radius: 0 14px 14px 0; background: var(--surface); }
.section .lead { color: var(--text); }
.card { margin: 28px 0 0; padding: 20px 20px 6px; border: 1px solid var(--line); border-radius: 18px; }
.card h3 { display: flex; align-items: center; gap: 8px; margin-top: 0; }
.card h3 .icon { font-size: 22px; color: var(--accent); }
.note { font-size: 14px; color: var(--muted); }
.section .note { color: var(--muted); }
.divider { margin: 0 0 40px; border: 0; border-top: 1px solid var(--line); }

.cards { display: grid; gap: 16px; margin: 0 0 20px; }
.cards .card { margin: 0; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }

.table { width: 100%; margin: 0 0 18px; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
@media (max-width: 719px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { margin: 0 0 14px; padding: 6px 16px; border: 1px solid var(--line); border-radius: 16px; }
  .table td { padding: 8px 0; }
  .table td:last-child { border-bottom: 0; }
  .table td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
}

.footer { margin-top: 16px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.footer nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; }
.footer nav a .icon { font-size: 17px; color: var(--accent); }
.footer p { margin: 0; }
.embedded .brand { pointer-events: none; }
.embedded .footer nav { display: none; }

.to-top { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--text); color: #ffffff; font-size: 22px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); transition: opacity 0.2s, transform 0.2s; }
.js .to-top { opacity: 0; transform: translateY(12px); pointer-events: none; }
.js .to-top.visible { opacity: 1; transform: none; pointer-events: auto; }

@media (min-width: 960px) {
  .page { padding: 32px 32px 48px; }
  .layout { grid-template-columns: 270px minmax(0, 1fr); grid-template-areas: "toc intro" "toc content"; column-gap: 56px; row-gap: 16px; }
  .intro { grid-area: intro; max-width: 740px; }
  .toc { grid-area: toc; align-self: start; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
  .content { grid-area: content; max-width: 740px; }
  .to-top { right: 32px; bottom: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .to-top { transition: none; }
}
@media print {
  .toc, .to-top, .footer nav { display: none; }
  .layout { display: block; }
}
