:root {
  --page: #faf7ff;
  --ink: #1a1028;
  --muted: #5b4f72;
  --brand: #7001cc;
  --line: #e4d8f4;
  --card: #ffffff;
  --soft: #f4ecff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Barlow, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

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

.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  background: #14081f;
}

.brand img { display: block; height: 28px; width: auto; }

.top-links { display: flex; gap: 16px; font-weight: 600; }

.top-links a { color: #ffffff; text-decoration: none; }

.top-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

main {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
}

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

h2 {
  margin: 36px 0 12px;
  font-size: 22px;
  line-height: 1.25;
  color: var(--brand);
}

h3 { margin: 24px 0 8px; font-size: 18px; }

p { margin: 0 0 14px; }

.clause { padding-left: 0; }

.num {
  display: inline-block;
  min-width: 2.4em;
  color: var(--brand);
  font-weight: 700;
}

ul, ol { margin: 0 0 16px; padding-left: 1.25em; }

li { margin: 0 0 8px; }

.toc {
  margin: 0 0 28px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.toc-title { margin: 0 0 8px; font-weight: 700; }

.toc ul { margin: 0; padding: 0; list-style: none; }

.toc a { text-decoration: none; }

.table-wrap {
  margin: 0 0 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

table { width: 100%; border-collapse: collapse; font-size: 15px; }

th, td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th { background: var(--soft); font-weight: 700; }

tr:last-child td { border-bottom: 0; }

.field {
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-weight: 600;
}

.cards { display: grid; gap: 12px; margin-top: 24px; }

.card {
  display: block;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
}

.card strong { display: block; margin-bottom: 4px; color: var(--brand); font-size: 18px; }

.card span { color: var(--muted); }

footer {
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

footer p { margin: 0 0 6px; }

@media (max-width: 640px) {
  h1 { font-size: 28px; }
  table, thead, tbody, tr, th, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); }
  tr:last-child { border-bottom: 0; }
  td { border-bottom: 0; padding-top: 10px; padding-bottom: 0; }
  td:last-child { padding-bottom: 12px; }
  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }
}
