:root {
  color-scheme: light;
  --legal-accent: #b5d600;
  --legal-accent-strong: #87a600;
  --legal-ink: #151a14;
  --legal-muted: #5b655a;
  --legal-bg: #f3f5ef;
  --legal-paper: #ffffff;
  --legal-line: #dce3d5;
  --legal-soft: #f7f9f3;
  --legal-dark: #111711;
  --legal-dark-soft: #1c261a;
  --legal-shadow: 0 24px 70px rgba(29, 40, 26, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
}

body.legal-page {
  margin: 0;
  color: var(--legal-ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(181, 214, 0, 0.1), transparent 26rem),
    linear-gradient(180deg, #f9faf7 0%, var(--legal-bg) 36%, #eef1e9 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.legal-page::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.24;
  pointer-events: none;
  background-image: linear-gradient(rgba(31, 45, 27, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(31, 45, 27, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 44%);
}

::selection {
  color: #111;
  background: rgba(181, 214, 0, 0.48);
}

a {
  color: #4f6800;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #2d3b00;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 120;
  padding: 10px 14px;
  color: #111;
  background: var(--legal-accent);
  border-radius: 8px;
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.legal-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 110;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.legal-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--legal-accent), #ddf56a);
  box-shadow: 0 0 14px rgba(181, 214, 0, 0.62);
}

.legal-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  color: #fff;
  background: rgba(17, 23, 17, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.legal-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 40px), 1240px);
  min-height: 82px;
  margin: 0 auto;
  gap: 24px;
}

.legal-logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.legal-logo img {
  display: block;
  width: min(240px, 48vw);
  height: auto;
}

.legal-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #dfe7db;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.legal-badge::before {
  width: 7px;
  height: 7px;
  content: "";
  background: var(--legal-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(181, 214, 0, 0.13);
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  color: #f7f9f4;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.back-link::before {
  margin-right: 8px;
  content: "←";
  color: var(--legal-accent);
}

.back-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(181, 214, 0, 0.6);
  transform: translateY(-1px);
}

.legal-main {
  width: min(calc(100% - 40px), 1240px);
  margin: 0 auto;
  padding: 38px 0 74px;
}

.legal-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(28px, 4vw, 46px) clamp(6px, 1.5vw, 18px) 32px;
  color: var(--legal-ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(135, 166, 0, 0.18);
  border-radius: 0;
  box-shadow: none;
}

.legal-hero::before,
.legal-hero::after {
  position: absolute;
  z-index: -1;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.legal-hero::before {
  top: -120px;
  right: -70px;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(181, 214, 0, 0.13), rgba(181, 214, 0, 0) 68%);
}

.legal-hero::after {
  display: none;
}

.kicker,
.legal-hero > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #657f00;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.kicker::before,
.legal-hero > span:first-child::before {
  width: 28px;
  height: 2px;
  content: "";
  background: var(--legal-accent);
}

.legal-hero h1 {
  max-width: 900px;
  margin: 0 0 18px;
  color: var(--legal-ink);
  font-size: clamp(2.25rem, 4.4vw, 4.25rem);
  font-weight: 860;
  line-height: 0.97;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.legal-hero > p {
  max-width: 850px;
  margin: 0;
  color: var(--legal-muted);
  font-size: clamp(1rem, 1.5vw, 1.13rem);
  line-height: 1.72;
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.meta article {
  min-width: 0;
  padding: 16px 18px;
  color: var(--legal-ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--legal-line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(34, 45, 31, 0.045);
  backdrop-filter: blur(8px);
}

.meta strong {
  display: block;
  margin-bottom: 6px;
  color: #778172;
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.meta a {
  color: #506900;
}

.legal-layout {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  margin-top: 24px;
}

.legal-aside {
  position: sticky;
  top: 106px;
  display: grid;
  gap: 16px;
}

.contents,
.legal-toc {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--legal-line);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(34, 45, 31, 0.06);
}

.contents summary,
.legal-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 18px;
  color: var(--legal-ink);
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
  font-weight: 850;
  letter-spacing: -0.01em;
}

.contents summary::-webkit-details-marker,
.legal-toc summary::-webkit-details-marker {
  display: none;
}

.contents summary::after,
.legal-toc summary::after {
  content: "+";
  color: #6c7a67;
  font-size: 1.25rem;
  font-weight: 500;
}

.contents[open] summary::after,
.legal-toc[open] summary::after {
  content: "−";
}

.contents ol,
.legal-toc ol {
  max-height: min(58vh, 620px);
  margin: 0;
  padding: 8px 10px 14px;
  overflow: auto;
  border-top: 1px solid var(--legal-line);
  counter-reset: legal-toc;
}

.contents li,
.legal-toc li {
  margin: 0;
  list-style: none;
  counter-increment: legal-toc;
}

.contents li a,
.legal-toc li a {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  padding: 9px 10px;
  color: #5b655a;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 690;
  line-height: 1.35;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease;
}

.contents li a::before,
.legal-toc li a::before {
  content: counter(legal-toc, decimal-leading-zero);
  color: #95a18f;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.contents li a:hover,
.legal-toc li a:hover,
.contents li a[aria-current="true"],
.legal-toc li a[aria-current="true"] {
  color: #334100;
  background: #f2f7dc;
}

.legal-help {
  padding: 20px;
  color: #e7ece3;
  background: linear-gradient(145deg, #182018, #243021);
  border: 1px solid #303d2d;
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(23, 32, 21, 0.15);
}

.legal-help span,
.legal-help strong {
  display: block;
}

.legal-help span {
  margin-bottom: 7px;
  color: #aeb9aa;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.legal-help strong {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.legal-help a {
  color: #dff06e;
  font-size: 0.88rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.content-card,
.card {
  min-width: 0;
  padding: clamp(30px, 5vw, 58px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--legal-line);
  border-radius: 24px;
  box-shadow: var(--legal-shadow);
}

.legal-section,
.content-card > section {
  position: relative;
}

.legal-section + .legal-section,
.content-card > section + section {
  margin-top: 34px;
  padding-top: 34px;
  border-top: 1px solid var(--legal-line);
}

.legal-section h2,
.content-card h2,
.card h2 {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 0 0 14px;
  color: var(--legal-ink);
  font-size: clamp(1.15rem, 2vw, 1.42rem);
  font-weight: 840;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.legal-section h2::before,
.content-card h2::before,
.card h2::before {
  width: 7px;
  height: 24px;
  margin-top: 1px;
  content: "";
  background: linear-gradient(180deg, var(--legal-accent), #91ad00);
  border-radius: 4px;
}

.legal-section p,
.legal-section li,
.content-card p,
.content-card li,
.card p,
.card li {
  color: var(--legal-muted);
  font-size: 1rem;
  line-height: 1.78;
}

.legal-section p,
.content-card p,
.card p {
  margin: 10px 0;
}

.legal-section ul,
.content-card ul,
.card ul {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.legal-section li,
.content-card li,
.card li {
  position: relative;
  padding-left: 22px;
}

.legal-section li::before,
.content-card li::before,
.card li::before {
  position: absolute;
  top: 0.72em;
  left: 2px;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--legal-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(181, 214, 0, 0.12);
}

.legal-section a,
.content-card a,
.card a {
  font-weight: 760;
}

.highlight,
.note,
.acceptance-note {
  margin-top: 22px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #f5f9e6, #fbfcf7);
  border: 1px solid #d7e3a8;
  border-left: 4px solid var(--legal-accent);
  border-radius: 14px;
}

.acceptance-note {
  margin-top: 34px;
}

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

.legal-footer-inner {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding-top: 24px;
  border-top: 1px solid #d2dacb;
}

.legal-footer strong,
.legal-footer small {
  display: block;
}

.legal-footer strong {
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.legal-footer small {
  color: #6b7568;
  line-height: 1.5;
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px 18px;
}

.legal-footer a {
  color: #556052;
  font-size: 0.8rem;
  font-weight: 760;
}

.legal-back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #111;
  background: var(--legal-accent);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(76, 94, 15, 0.26);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.legal-back-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 960px) {
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-aside {
    position: static;
  }

  .legal-help {
    display: none;
  }

  .contents ol,
  .legal-toc ol {
    max-height: 320px;
  }
}

@media (max-width: 700px) {
  .legal-header-inner,
  .legal-main,
  .legal-footer {
    width: min(calc(100% - 28px), 1240px);
  }

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

  .legal-logo img {
    width: 170px;
  }

  .legal-badge {
    display: none;
  }

  .back-link {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.8rem;
  }

  .back-link::before {
    margin-right: 5px;
  }

  .legal-main {
    padding: 20px 0 50px;
  }

  .legal-hero {
    padding: 24px 4px 26px;
    border-radius: 0;
  }

  .legal-hero h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .legal-hero::before {
    top: -90px;
    right: -190px;
  }

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

  .legal-layout {
    margin-top: 16px;
  }

  .content-card,
  .card {
    padding: 26px 21px;
    border-radius: 18px;
  }

  .legal-section + .legal-section,
  .content-card > section + section {
    margin-top: 28px;
    padding-top: 28px;
  }

  .legal-section p,
  .legal-section li,
  .content-card p,
  .content-card li,
  .card p,
  .card li {
    font-size: 0.96rem;
    line-height: 1.72;
  }

  .legal-footer-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .legal-footer nav {
    justify-content: flex-start;
  }

  .legal-back-top {
    right: 14px;
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
