:root {
  color-scheme: light;
  --bg: #fffaf4;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --text: #241913;
  --muted: #7b675a;
  --line: rgba(143, 93, 52, 0.16);
  --accent: #f97316;
  --accent-dark: #c2410c;
  --accent-soft: #fff1e6;
  --shadow: 0 18px 56px rgba(93, 52, 20, 0.12);
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 205, 150, 0.36), transparent 32rem),
    radial-gradient(circle at 88% 0%, rgba(255, 236, 204, 0.62), transparent 28rem),
    linear-gradient(180deg, #fffaf4 0%, #fffefd 54%, #fff7ef 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.legal-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.legal-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(143, 93, 52, 0.1);
  background: rgba(255, 250, 244, 0.88);
  backdrop-filter: blur(18px);
}

.legal-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 82px;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.legal-logo {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #ffb35b, #ff5b10);
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.25);
}

.legal-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.legal-nav a:hover {
  color: var(--accent-dark);
}

.xm-lang-picker {
  position: relative;
  z-index: 80;
  display: inline-flex;
  align-items: center;
}

.xm-lang-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(120, 70, 30, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #2e2118;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(120, 70, 30, 0.1);
  font: 700 13px/1.1 inherit;
  cursor: pointer;
}

.xm-lang-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex: 0 0 auto;
}

.xm-lang-code {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xm-lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 184px;
  padding: 8px;
  border: 1px solid rgba(120, 70, 30, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 48px rgba(60, 35, 18, 0.18);
  backdrop-filter: blur(18px);
}

.xm-lang-menu[hidden] {
  display: none;
}

.xm-lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #2e2118;
  padding: 10px 11px;
  font: 700 13px/1.2 inherit;
  text-align: left;
  cursor: pointer;
}

.xm-lang-option:hover,
.xm-lang-option.is-active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.xm-lang-check {
  opacity: 0;
  font-weight: 900;
}

.xm-lang-option.is-active .xm-lang-check {
  opacity: 1;
}

.legal-hero {
  padding: 72px 0 34px;
}

.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.legal-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.legal-title {
  max-width: 820px;
  margin: 0;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

.legal-subtitle {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.7;
}

.legal-updated {
  display: inline-flex;
  margin-top: 22px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #8b5a37;
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 800;
}

.legal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
  padding-bottom: 84px;
}

.legal-content {
  display: grid;
  gap: 16px;
}

.legal-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 26px;
}

.legal-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
  letter-spacing: 0;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.legal-card p {
  margin: 0;
}

.legal-card ul {
  margin: 0;
  padding-left: 20px;
}

.legal-card li + li {
  margin-top: 8px;
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.legal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(249, 115, 22, 0.28);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(249, 115, 22, 0.24);
}

.legal-button.secondary {
  background: #fff;
  color: var(--accent-dark);
}

.legal-sidebar {
  position: sticky;
  top: 106px;
  display: grid;
  gap: 14px;
}

.legal-toc,
.legal-help {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 34px rgba(93, 52, 20, 0.08);
  padding: 18px;
}

.legal-toc-title,
.legal-help-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 900;
}

.legal-toc a {
  display: block;
  padding: 8px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.legal-toc a:hover {
  color: var(--accent-dark);
}

.legal-help p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.legal-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 42px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 860px) {
  .legal-shell {
    width: min(100% - 28px, 680px);
  }

  .legal-header-inner {
    min-height: 74px;
    gap: 12px;
  }

  .legal-nav {
    gap: 12px;
  }

  .legal-nav a:nth-child(n + 3) {
    display: none;
  }

  .legal-grid {
    grid-template-columns: 1fr;
  }

  .legal-sidebar {
    position: static;
  }

  .legal-hero {
    padding-top: 48px;
  }

  .xm-lang-button {
    width: 42px;
    padding: 0;
  }

  .xm-lang-code {
    display: none;
  }
}
