:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at top right, #eaf1ff 0%, var(--bg) 42%, #f8fafc 100%);
  color: var(--text);
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[lang='ja'] body {
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", "Meiryo", -apple-system, BlinkMacSystemFont, sans-serif;
}

html[lang='en'] body {
  font-family: "Charter", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

html[lang='en'] .legal-title,
html[lang='en'] .legal-lang-switch button,
html[lang='en'] .legal-back,
html[lang='en'] .legal-meta {
  font-family: "Avenir Next", "SF Pro Text", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.legal-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
}

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

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.legal-back:hover {
  color: var(--text);
}

.legal-lang-switch {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.legal-lang-switch a,
.legal-lang-switch button {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.legal-lang-switch a.active,
.legal-lang-switch button.active {
  color: #ffffff;
  background: var(--accent);
}

.legal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.08);
}

.legal-title {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

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

.legal-content {
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fbfcff;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.85;
  overflow-x: auto;
}

html[lang='en'] .legal-content {
  font-size: 16px;
  line-height: 1.9;
}

@media (max-width: 720px) {
  .legal-page {
    padding: 14px;
  }

  .legal-card {
    padding: 18px;
    border-radius: 14px;
  }

  .legal-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
