:root {
  --accent: #00CBBF;
  --accent-ink: #008f87;
  --accent-tint: #e6faf8;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --radius: 18px;
  --maxw: 720px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Reading progress ---- */
#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 100;
  transition: width .1s linear;
}

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 0 28px; height: 52px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.appicon {
  width: 30px; height: 30px; flex: none; display: block;
  object-fit: contain; margin: -2px 0;
}
.topbar .spacer { flex: 1; }
.lang-pill {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; font-size: 13px; font-weight: 500;
}
.lang-pill span { padding: 4px 12px; color: var(--ink-2); }
.lang-pill span.on { background: var(--ink); color: #fff; }
.lang-pill span.soon { color: var(--ink-3); cursor: not-allowed; }

/* ---- Hero ---- */
.hero {
  max-width: 1080px; margin: 0 auto; padding: 76px 28px 40px;
}
.hero .eyebrow {
  color: var(--accent-ink); font-weight: 600; font-size: 15px;
  letter-spacing: .02em; text-transform: uppercase; margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 64px); line-height: 1.04;
  letter-spacing: -.025em; font-weight: 700; margin: 0 0 18px;
}
.hero .lede {
  font-size: clamp(19px, 2.4vw, 23px); color: var(--ink-2);
  max-width: 640px; margin: 0; line-height: 1.5; letter-spacing: -.01em;
}
.meta {
  display: flex; flex-wrap: wrap; gap: 28px;
  margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line-soft);
}
.meta div { display: flex; flex-direction: column; gap: 2px; }
.meta .k { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; }
.meta .v { font-size: 15px; color: var(--ink); font-weight: 500; }

/* ---- Layout ---- */
.layout {
  max-width: 1080px; margin: 0 auto; padding: 20px 28px 100px;
  display: grid; grid-template-columns: 240px 1fr; gap: 56px;
  align-items: start;
}

/* ---- TOC ---- */
.toc {
  position: sticky; top: 76px; align-self: start;
  font-size: 14px;
}
.toc .toc-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); font-weight: 700; margin: 0 0 14px; padding-left: 14px;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 6px 14px; border-radius: 8px;
  color: var(--ink-2);
  line-height: 1.35; transition: color .15s, background .15s;
}
.toc a .num { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; min-width: 18px; font-weight: 600; }
.toc a:hover { color: var(--ink); text-decoration: none; background: var(--bg-2); }
.toc a.active { color: var(--accent-ink); font-weight: 600; background: var(--accent-tint); }
.toc a.active .num { color: var(--accent-ink); }

/* ---- Mobile TOC ---- */
.toc-mobile { display: none; }

/* ---- Article ---- */
article { max-width: var(--maxw); }
section { scroll-margin-top: 70px; padding: 30px 0; border-top: 1px solid var(--line-soft); }
section:first-of-type { border-top: none; padding-top: 8px; }
.sec-num {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .03em;
  color: var(--accent-ink); margin-bottom: 8px; font-variant-numeric: tabular-nums;
}
h2 {
  font-size: clamp(26px, 3.4vw, 32px); letter-spacing: -.02em; font-weight: 700;
  line-height: 1.12; margin: 0 0 18px;
}
h3 {
  font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: 28px 0 8px;
}
p { margin: 0 0 16px; color: var(--ink); }
.muted { color: var(--ink-2); }
strong { font-weight: 600; }

ul.clean { margin: 0 0 16px; padding-left: 0; list-style: none; }
ul.clean > li {
  position: relative; padding-left: 26px; margin-bottom: 12px; color: var(--ink);
}
ul.clean > li::before {
  content: ""; position: absolute; left: 6px; top: 12px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

/* numbered data list */
ol.data { margin: 0 0 8px; padding: 0; list-style: none; counter-reset: d; }
ol.data > li {
  position: relative; padding: 18px 0 18px 52px; border-top: 1px solid var(--line-soft);
  counter-increment: d;
}
ol.data > li:first-child { border-top: none; }
ol.data > li::before {
  content: counter(d); position: absolute; left: 0; top: 18px;
  width: 30px; height: 30px; border-radius: 9px; background: var(--bg-2);
  color: var(--ink-2); font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
ol.data > li .lead { font-weight: 600; }
ol.data > li p { margin: 4px 0 0; color: var(--ink-2); font-size: 16.5px; }

/* ---- Callouts ---- */
.callout {
  border-radius: var(--radius); padding: 26px 28px; margin: 8px 0 22px;
  background: var(--accent-tint); border: 1px solid #c9f3ef;
}
.callout .badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 10px;
}
.callout .badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.callout p { margin: 0; }
.callout p + p { margin-top: 12px; }
.callout.big p { font-size: 20px; line-height: 1.5; letter-spacing: -.01em; }

.note {
  border-radius: var(--radius); padding: 22px 24px; margin: 8px 0 18px;
  background: var(--bg-2); border: 1px solid var(--line-soft);
}
.note .badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 12px;
}
.note ul.clean > li::before { background: var(--ink-3); }
.note p { margin: 0; }

/* ---- Path chip (Settings → …) ---- */
.path {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 3px 10px; font-size: 15px; font-weight: 500; color: var(--ink);
  vertical-align: baseline;
}
.path .arr { color: var(--ink-3); }

/* ---- Tables ---- */
.table-wrap { margin: 8px 0 18px; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
thead th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-3); font-weight: 700; padding: 14px 18px; background: var(--bg-2);
  border-bottom: 1px solid var(--line-soft);
}
tbody td { padding: 16px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink-2); }
tbody tr:last-child td { border-bottom: none; }
tbody td .who { font-weight: 600; color: var(--ink); display: block; margin-bottom: 3px; }
tbody td a { font-size: 14.5px; }

.legal-grid { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; margin: 8px 0 18px; }
.legal-grid .row { display: grid; grid-template-columns: 1.4fr 1fr; background: #fff; }
.legal-grid .row > div { padding: 15px 18px; }
.legal-grid .row .purpose { color: var(--ink); font-weight: 500; }
.legal-grid .row .basis { color: var(--accent-ink); font-weight: 600; font-size: 15px; display: flex; align-items: center; }

/* ---- Footer ---- */
footer {
  background: var(--bg-2); border-top: 1px solid var(--line-soft);
}
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 44px 28px; display: flex; flex-wrap: wrap; gap: 24px 56px; justify-content: space-between; align-items: flex-start; }
.footer-inner .brand { font-size: 15px; }
.footer-meta { font-size: 13px; color: var(--ink-3); line-height: 1.6; }
.footer-links { display: flex; gap: 24px; font-size: 14px; }
.footer-links a { color: var(--ink-2); }

.totop {
  position: fixed; right: 24px; bottom: 24px; z-index: 70;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border: 1px solid var(--line); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .25s;
  box-shadow: 0 4px 16px rgba(0,0,0,.1); font-size: 18px;
}
.totop.show { opacity: 1; pointer-events: auto; }

/* ---- Responsive ---- */
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .toc { display: none; }
  .toc-mobile {
    display: block; position: sticky; top: 52px; z-index: 55;
    background: rgba(255,255,255,.9); backdrop-filter: blur(16px);
    margin: 0 -28px 24px; padding: 10px 28px; border-bottom: 1px solid var(--line-soft);
  }
  .toc-mobile select {
    width: 100%; font-family: var(--font); font-size: 16px; font-weight: 500;
    color: var(--ink); padding: 11px 14px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2386868b' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
  }
  .hero { padding: 48px 28px 28px; }
  .meta { gap: 20px 36px; }
  article { max-width: 100%; }
  .legal-grid .row { grid-template-columns: 1fr; }
  .legal-grid .row .basis { padding-top: 0; }
}

@media (max-width: 460px) {
  body { font-size: 17px; }
  .topbar-inner, .hero, .layout, .footer-inner { padding-left: 20px; padding-right: 20px; }
  .toc-mobile { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
}

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

/* ---- Dark mode (follows the browser / OS preference) ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #00d9cc;
    --accent-ink: #2fded2;
    --accent-tint: #0e2b28;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #86868b;
    --bg: #000000;
    --bg-2: #1c1c1e;
    --line: #38383a;
    --line-soft: #2c2c2e;
  }

  .topbar { background: rgba(22,22,23,.72); }
  .lang-pill span.on { color: #000; }
  .callout { border-color: #16413c; }
  .toc-mobile { background: rgba(22,22,23,.9); }
  .toc-mobile select { background: var(--bg-2); }
  .legal-grid .row { background: var(--bg-2); }
  .totop {
    background: rgba(28,28,30,.85);
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
  }
}
