:root {
  --navy:    #2b4878;
  --navy-dk: #1c3057;
  --navy-lt: #3d5f9a;
  --pink:    #d4186c;
  --pink-lt: #e8397f;
  --gray-bg: #d2d6de;
  --gray-mid:#b0bac8;
  --white:   #ffffff;
  --text:    #1a2840;
  --text-lt: #4a5a72;
  --border:  #c5cdd9;
}

html { scroll-behavior: smooth; }

/* ── PAGE ROOT ───────────────────────────────── */
.public-doc {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  background: var(--gray-bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
  min-height: 100vh;
}

.public-doc *,
.public-doc *::before,
.public-doc *::after {
  box-sizing: border-box;
}

/* ── HERO ────────────────────────────────────── */
.public-doc .hero {
  background: #303030;
  color: var(--white);
  padding: 22px 40px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease;
  box-shadow: 0 2px 16px rgba(43,72,120,.2);
}

.public-doc .hero.hidden {
  transform: translateY(-100%);
  box-shadow: none;
}

.public-doc .hero-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--pink-lt);
  margin-bottom: 12px;
  opacity: .9;
}

.public-doc .hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 0 0 4px;
  color: var(--white);
  text-align: center;
  width: auto;
}

.public-doc .hero-sub {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,.65);
  letter-spacing: .08em;
  text-transform: uppercase;
  max-width: 520px;
  margin: 0 auto;
}

.public-doc .version-badge {
  display: inline-block;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .05em;
  color: rgba(255,255,255,.75);
}

/* ── LAYOUT ─────────────────────────────────── */
.public-doc .page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 40px 80px;
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

/* ── SIDEBAR / TOC ───────────────────────────── */
.public-doc .toc {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  background: var(--white);
  border-radius: 10px;
  padding: 24px 20px;
  box-shadow: 0 2px 12px rgba(43,72,120,.08);
  border-top: 3px solid var(--navy);
}

.public-doc .toc-heading {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 14px;
}

.public-doc .toc a {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-lt);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 5px;
  margin-bottom: 2px;
  border-left: 2px solid transparent;
  transition: all .18s;
  line-height: 1.3;
}

.public-doc .toc a:hover,
.public-doc .toc a.active {
  background: rgba(43,72,120,.06);
  color: var(--navy);
  border-left-color: var(--pink);
}

.public-doc .toc a.active { font-weight: 600; }

.public-doc .toc-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

/* ── MAIN CONTENT ────────────────────────────── */
.public-doc .content {
  flex: 1;
  min-width: 0;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(43,72,120,.08);
  overflow: hidden;
}

.public-doc .intro-band {
  background: linear-gradient(90deg, rgba(43,72,120,.05) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  padding: 28px 40px;
}

.public-doc .intro-band p {
  font-size: 14px;
  color: var(--text-lt);
  font-style: italic;
  font-weight: 400;
  max-width: 680px;
  line-height: 1.7;
  margin: 0;
}

.public-doc .sections { padding: 0 40px 40px; }

/* ── SECTION ─────────────────────────────────── */
.public-doc .section {
  border-bottom: 1px solid var(--border);
  padding: 36px 0;
  animation: fadeUp .5s ease both;
}

.public-doc .section:last-child { border-bottom: none; }
.public-doc .section-flush { border-bottom: none; padding-bottom: 0; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.public-doc .section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.public-doc .section-num {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--white);
  background: var(--pink);
  border-radius: 4px;
  padding: 3px 10px;
  text-transform: uppercase;
  flex-shrink: 0;
  width: auto;
  line-height: normal;
  margin: 0;
  text-align: center;
}

.public-doc .section h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: left;
  margin: 0;
  line-height: 1.2;
  width: auto;
}

/* ── BODY TEXT ───────────────────────────────── */
.public-doc .body-text {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 14px;
}

.public-doc .body-text:last-child { margin-bottom: 0; }

.public-doc .styled-list + .body-text { margin-top: 20px; }

/* ── CLAUSES ─────────────────────────────────── */
.public-doc .clause { margin-bottom: 14px; }

.public-doc .clause-id {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--navy);
  min-width: 50px;
  display: inline-block;
}

.public-doc .clause-body { color: var(--text); line-height: 1.8; font-weight: 400; }

.public-doc .clause-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.public-doc .sub-clauses {
  margin-left: 50px;
  margin-top: 8px;
  border-left: 2px solid var(--border);
  padding-left: 16px;
}

.public-doc .sub-clause {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}

.public-doc .sub-sub-clauses {
  margin-left: 40px;
  margin-top: 6px;
  border-left: 2px solid rgba(212,24,108,.2);
  padding-left: 14px;
}

.public-doc .sub-sub-clause {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
}

.public-doc .sub-id {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: var(--navy-lt);
  min-width: 44px;
  flex-shrink: 0;
}

.public-doc .sub-sub-id {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-lt);
  min-width: 52px;
  flex-shrink: 0;
}

/* ── DATA TABLE ──────────────────────────────── */
.public-doc .data-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 16px 0;
  font-size: 13.5px;
}

.public-doc .data-table th {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--navy);
  padding: 10px 16px;
  text-align: left;
}

.public-doc .data-table td {
  padding: 12px 16px;
  vertical-align: top;
  line-height: 1.7;
  color: var(--text);
  font-weight: 400;
  border-bottom: 1px solid var(--border);
  border-top: none;
  border-left: none;
}

.public-doc .data-table td:first-child {
  font-weight: 700;
  color: var(--navy);
  width: 220px;
  font-size: 13px;
}

.public-doc .data-table tr:last-child td { border-bottom: none; }
.public-doc .data-table tr:hover td { background: rgba(43,72,120,.03); }

/* ── DEFINITIONS TABLE ───────────────────────── */
.public-doc .definitions-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin-top: 16px;
}

.public-doc .definitions-table tr { border-bottom: 1px solid var(--border); }
.public-doc .definitions-table tr:last-child { border-bottom: none; }

.public-doc .definitions-table td {
  padding: 14px 12px;
  vertical-align: top;
  line-height: 1.7;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 400;
  border-top: none;
  border-left: none;
}

.public-doc .definitions-table td:first-child {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--navy);
  white-space: nowrap;
  padding-right: 20px;
  width: 200px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.public-doc .definitions-table tr:hover td { background: rgba(43,72,120,.03); }

.public-doc #definitions .section-num { background: var(--navy); }

.public-doc #definitions > p { color: var(--text-lt); font-size: 14px; text-align: left; margin: 0; }
.public-doc #definitions > p:first-of-type { margin-bottom: 16px; }
.public-doc #definitions > p:last-of-type { margin-top: 20px; }

/* ── BULLET LIST ─────────────────────────────── */
.public-doc .styled-list {
  list-style: none;
  margin: 12px 0 16px;
  padding: 0;
}

.public-doc .styled-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.75;
  padding: 5px 0;
  border-bottom: 1px solid rgba(197,205,217,.4);
}

.public-doc .styled-list li:last-child { border-bottom: none; }

.public-doc .styled-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  flex-shrink: 0;
  margin-top: 7px;
}

/* ── HIGHLIGHT BAND ──────────────────────────── */
.public-doc .highlight-band {
  background: linear-gradient(90deg, rgba(43,72,120,.05) 0%, transparent 100%);
  border-left: 3px solid var(--navy);
  border-radius: 0 6px 6px 0;
  padding: 14px 20px;
  margin: 16px 0;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-lt);
  line-height: 1.7;
}

.public-doc strong.bold { color: var(--navy); font-weight: 700; }

.public-doc .inline-link {
  color: var(--navy);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dotted var(--navy-lt);
}

/* ── CONTACT BAND ────────────────────────────── */
.public-doc .contact-band {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dk) 100%);
  color: var(--white);
  border-radius: 8px;
  padding: 28px 32px;
  margin: 32px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.public-doc .contact-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.public-doc .contact-band h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--pink-lt);
  margin-bottom: 6px;
  text-align: left;
  line-height: 1.3;
  width: auto;
  margin-top: 0;
}

.public-doc .contact-band p {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,.8);
  line-height: 1.7;
  margin-bottom: 6px;
}

.public-doc .contact-band p:last-child { margin-bottom: 0; }

.public-doc .contact-band a {
  color: var(--pink-lt);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dotted rgba(232,57,127,.5);
}

.public-doc .contact-band a:hover { border-bottom-color: var(--pink-lt); }

/* ── FOOTER ─────────────────────────────────── */
.public-doc footer {
  background: #303030;
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 28px 40px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .04em;
}

.public-doc footer .fw {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.public-doc footer .divider { color: rgba(255,255,255,.2); }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 780px) {
  .public-doc .page-wrap { flex-direction: column; padding: 24px 20px 60px; }
  .public-doc .toc { position: static; width: 100%; }
  .public-doc .header-inner { padding: 14px 20px; }
  .public-doc .sections { padding: 0 20px 32px; }
  .public-doc .intro-band { padding: 20px 20px; }
  .public-doc .hero { padding: 18px 20px; }
  .public-doc .data-table td:first-child { width: 140px; }

  /* definitions table: allow wrapping, stack columns on very small screens */
  .public-doc .definitions-table td:first-child {
    white-space: normal;
    width: auto;
    padding-right: 12px;
  }

  /* reduce nesting indentation so clauses don't overflow */
  .public-doc .sub-clauses {
    margin-left: 20px;
    padding-left: 12px;
  }

  .public-doc .sub-sub-clauses {
    margin-left: 16px;
    padding-left: 10px;
  }
}

@media (max-width: 480px) {
  .public-doc .sections { padding: 0 16px 24px; }
  .public-doc .intro-band { padding: 16px; }

  /* stack definitions table rows vertically */
  .public-doc .definitions-table,
  .public-doc .definitions-table tbody,
  .public-doc .definitions-table tr,
  .public-doc .definitions-table td { display: block; width: 100%; }

  .public-doc .definitions-table td:first-child {
    padding-bottom: 2px;
    border-bottom: none;
  }

  .public-doc .definitions-table td:last-child { padding-top: 2px; }

  .public-doc .definitions-table tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
  .public-doc .definitions-table tr:last-child { border-bottom: none; }

  /* tighten clause nesting further */
  .public-doc .sub-clauses { margin-left: 10px; padding-left: 10px; }
  .public-doc .sub-sub-clauses { margin-left: 8px; padding-left: 8px; }
}
