/* UpCounting brand tokens (Brand Guidelines, Apr 2025) */
:root {
  --navy: #00152F;
  --lime: #E2FE9F;
  --turquoise: #20C4FA;
  --ink: #00152F;
  --body: #1d2433;
  --muted: #5b6475;
  --rule: #e3e7ee;
  --soft: #F3F3F3;
  --page: #FFFFFF;
  --link: #0000EE;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--body);
  font-family: 'DM Sans', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.topbar { border-bottom: 1px solid var(--rule); background: var(--page); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { height: 34px; width: auto; display: block; }
.print-btn {
  font: inherit; font-size: 14px; font-weight: 500;
  color: var(--navy); background: var(--page);
  border: 1px solid var(--navy); border-radius: 999px;
  padding: 8px 16px; cursor: pointer;
}
.print-btn:hover { background: var(--navy); color: var(--page); }

/* Hero */
.hero { background: var(--navy); color: var(--page); padding: 48px 0 40px; }
.eyebrow { margin: 0 0 8px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--lime); font-weight: 500; }
.hero h1 { margin: 0; font-size: clamp(30px, 5vw, 44px); line-height: 1.15; font-weight: 700; }
.meta { margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 15px; }
.badge { background: var(--lime); color: var(--navy); font-weight: 700; border-radius: 999px; padding: 3px 12px; }

/* Layout */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 56px; padding-top: 40px; padding-bottom: 80px; }
.toc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow: auto; font-size: 14px; }
.toc summary { font-weight: 700; color: var(--navy); cursor: pointer; margin-bottom: 8px; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--rule); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc li a:hover { color: var(--navy); border-left-color: var(--turquoise); }

/* Terms body */
.terms { max-width: 760px; min-width: 0; }
.terms section { padding-bottom: 8px; border-bottom: 1px solid var(--rule); margin-bottom: 32px; }
.terms h2 { color: var(--navy); font-size: 26px; line-height: 1.25; margin: 0 0 12px; padding-top: 8px; }
.terms h3 { color: var(--navy); font-size: 18px; line-height: 1.35; margin: 28px 0 6px; }
.terms h4 { color: var(--navy); font-size: 16px; font-weight: 500; font-style: italic; margin: 20px 0 4px; }
.terms h4.step { font-style: normal; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--lime); color: var(--navy); font-size: 14px; font-weight: 700; flex: none; }
.terms p { margin: 0 0 12px; }
.terms ul, .terms ol { margin: 0 0 14px; padding-left: 28px; }
.terms li { margin: 0 0 6px; padding-left: 4px; }
.terms li ol { margin-top: 6px; }
.terms .indent { margin-left: 28px; }
.terms a { color: var(--link); }
.terms strong { color: var(--ink); }
.doc-footer { color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; }
  .toc { position: static; max-height: none; border: 1px solid var(--rule); border-radius: 12px; padding: 12px 16px; }
  .toc details:not([open]) summary { margin-bottom: 0; }
  .hero { padding: 32px 0 28px; }
  .terms h2 { font-size: 22px; }
}

/* Print / PDF archive */
@media print {
  @page { margin: 18mm 16mm; }
  body { font-size: 10.5pt; line-height: 1.5; }
  .print-btn, .toc { display: none; }
  .topbar { border: 0; }
  .topbar-inner { height: auto; padding-top: 0; }
  .hero { background: none; color: var(--navy); padding: 12px 0 8px; border-bottom: 2px solid var(--navy); }
  .eyebrow { color: var(--muted); }
  .badge { border: 1px solid var(--navy); }
  .layout { display: block; padding: 16px 0 0; }
  .terms { max-width: none; }
  .terms section { border: 0; margin-bottom: 12px; }
  .terms h2, .terms h3, .terms h4 { break-after: avoid; }
  .terms a { color: inherit; text-decoration: none; }
}
