:root {
  color-scheme: light;
  --bg: #f3f7fb;
  --surface: #ffffff;
  --surface-soft: #edf7fd;
  --text: #17212b;
  --muted: #687b8e;
  --line: #dbe6ef;
  --accent: #2aabee;
  --accent-strong: #168acd;
  --candidate-bg: #fff6da;
  --candidate-text: #73550d;
  --shadow: 0 12px 30px rgba(30, 75, 115, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -8%, rgba(42, 171, 238, 0.14), transparent 31rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

a:focus-visible {
  border-radius: 6px;
  outline: 3px solid rgba(42, 171, 238, 0.24);
  outline-offset: 3px;
}

.legal-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 34px);
}

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

.legal-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.legal-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #34d1bd, #28a9ec);
  color: #fff;
  font-size: 19px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(42, 171, 238, 0.2);
}

.legal-brand-copy {
  display: grid;
  gap: 1px;
}

.legal-brand-copy small {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.legal-brand-copy strong {
  font-size: 18px;
  line-height: 1.15;
}

.legal-back {
  min-height: 40px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.candidate-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(217, 154, 33, 0.3);
  border-radius: 14px;
  background: var(--candidate-bg);
  color: var(--candidate-text);
  font-size: 13px;
  line-height: 1.45;
}

.candidate-banner strong {
  white-space: nowrap;
}

.legal-hero,
.legal-paper,
.document-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-hero,
.legal-paper {
  border-radius: 22px;
}

.legal-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 25px 24px 23px;
}

.legal-hero::after {
  position: absolute;
  top: -52px;
  right: -52px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 171, 238, 0.2), rgba(42, 171, 238, 0));
  content: "";
  pointer-events: none;
}

.legal-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-hero h1,
.document-header h1 {
  margin: 0;
  letter-spacing: -0.025em;
}

.legal-hero h1 {
  max-width: 590px;
  font-size: clamp(30px, 7vw, 45px);
  line-height: 1.02;
}

.legal-hero p,
.document-header p {
  max-width: 630px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.document-card {
  display: grid;
  min-height: 150px;
  padding: 18px;
  border-radius: 18px;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.document-card:hover {
  border-color: rgba(42, 171, 238, 0.38);
  box-shadow: 0 16px 34px rgba(30, 93, 136, 0.13);
  transform: translateY(-2px);
}

.document-label {
  align-self: start;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
}

.document-card strong {
  align-self: end;
  margin-top: 18px;
  font-size: 20px;
  line-height: 1.15;
}

.document-card small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.document-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding: 2px 2px 5px;
  scrollbar-width: none;
}

.document-nav::-webkit-scrollbar {
  display: none;
}

.document-nav a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.document-nav a[aria-current="page"] {
  border-color: rgba(42, 171, 238, 0.35);
  background: var(--surface-soft);
  color: var(--accent-strong);
}

.legal-paper {
  padding: 25px 24px;
}

.document-header {
  padding-bottom: 21px;
  border-bottom: 1px solid var(--line);
}

.document-header h1 {
  font-size: clamp(28px, 6vw, 39px);
  line-height: 1.08;
}

.plain-summary {
  margin: 20px 0 5px;
  padding: 16px 17px;
  border: 1px solid rgba(42, 171, 238, 0.22);
  border-radius: 16px;
  background: linear-gradient(135deg, #f7fcff, var(--surface-soft));
}

.plain-summary strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 13px;
}

.plain-summary p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.legal-section {
  padding-top: 23px;
}

.legal-section + .legal-section {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 21px;
  line-height: 1.2;
}

.legal-section h3 {
  margin: 18px 0 8px;
  font-size: 16px;
}

.legal-section p,
.legal-section li {
  color: #314253;
  font-size: 15px;
  line-height: 1.62;
}

.legal-section p {
  margin: 0 0 11px;
}

.legal-section ol,
.legal-section ul {
  margin: 0;
  padding-left: 22px;
}

.legal-section li + li {
  margin-top: 7px;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.legal-footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.legal-footer a,
.legal-section a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 560px) {
  .legal-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

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

  .legal-brand-copy strong {
    font-size: 16px;
  }

  .legal-back {
    padding-right: 11px;
    padding-left: 11px;
  }

  .candidate-banner {
    display: grid;
    gap: 3px;
  }

  .legal-hero,
  .legal-paper {
    padding: 21px 18px;
    border-radius: 18px;
  }

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

  .document-card {
    min-height: 126px;
  }
}

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

  .document-card {
    transition: none;
  }
}
