/* Shared styling for the standalone legal pages (terms, and later privacy).
   External rather than inline so the pages stay within the site CSP
   (style-src 'self'). Light by default, dark when theme-init.js sets the saved
   choice - mirroring the app. */
:root {
  color-scheme: light;
  --bg: #eef2ff;
  --panel: #ffffff;
  --text: #171a21;
  --muted: #4b5262;
  --accent: #3b5bdb;
  --line: rgba(30, 41, 82, 0.12);
  --shadow: 0 1px 2px rgba(30, 41, 82, 0.06), 0 12px 28px -14px rgba(30, 41, 82, 0.22);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14110f;
  --panel: #1c1a24;
  --text: #f4f2ef;
  --muted: #a8a29b;
  --accent: #5476ff;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 32px 20px 64px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans Thai", sans-serif;
  line-height: 1.65;
}

.legal-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.legal-back {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.legal-back:hover {
  text-decoration: underline;
}

.legal-lang-switch {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 88%, var(--text));
}

.legal-lang-option {
  min-width: 44px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.legal-lang-option[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.legal-copy-en {
  display: none;
}

:root[lang="en"] .legal-copy-th {
  display: none;
}

:root[lang="en"] .legal-copy-en {
  display: block;
}

h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

.legal-meta {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
}

h2 {
  margin: 30px 0 8px;
  font-size: 17px;
}

p {
  margin: 0 0 14px;
  color: var(--text);
}

.legal-note {
  color: var(--muted);
  font-size: 13.5px;
}

ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

li {
  margin-bottom: 6px;
}

strong {
  font-weight: 700;
}

a {
  color: var(--accent);
}

@media (max-width: 560px) {
  body {
    padding: 16px 12px 40px;
  }

  .legal-shell {
    padding: 28px 20px;
  }

  .legal-topbar {
    align-items: flex-start;
  }
}
