/* PaperOS Data & Security. Tokens match paperos.com. */
:root {
  --bg: #fcf9f6;
  --bg-alt: #f6f0e2;
  --bg-soft: #faf5ea;
  --card: #ffffff;
  --rule: #ece2cc;
  --ink: #1a1a1a;
  --ink-2: #2a2a2a;
  --muted: #6e6a62;
  --muted-2: #8c8678;
  --yellow: #f9be2f;
  --yellow-soft: #fde29a;
  --green: #1f4435;
  --serif: Georgia, Newsreader, 'Times New Roman', serif;
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-color: var(--yellow); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 12px; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(252, 249, 246, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { display: block; }
.brand-tag { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--rule); white-space: nowrap; }
.topnav { display: flex; align-items: center; gap: 22px; font-size: 15px; font-weight: 500; }
.topnav a { text-decoration: none; }
.topnav a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--yellow); }

/* Buttons (match paperos.com: dark with a yellow offset shadow) */
.btn { display: inline-block; white-space: nowrap; font: 600 15px/1 var(--sans); padding: 14px 22px; border-radius: 6px; text-decoration: none; border: 1px solid transparent; transition: transform .12s, box-shadow .12s, background .12s; }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 3px 3px 0 var(--yellow); }
.btn-dark:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--yellow); }

/* Typography */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--ink); letter-spacing: -.01em; line-height: 1.15; }

/* Policy pages */
.doc-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding-top: 48px; padding-bottom: 80px; }
.doc-nav { position: sticky; top: 92px; align-self: start; font-size: 14.5px; }
.doc-nav-h { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.doc-nav ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.doc-nav li a { display: block; padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--ink-2); }
.doc-nav li a:hover { color: var(--ink); border-left-color: var(--muted-2); }
.doc-nav li.on a { border-left-color: var(--yellow); font-weight: 600; color: var(--ink); }
.doc-nav-c { margin: 22px 0 0; color: var(--muted); font-size: 13.5px; }
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 26px; }
.crumbs span { margin: 0 6px; color: var(--muted-2); }
.crumbs a { color: var(--muted); }

.doc-body { max-width: 46rem; overflow-wrap: anywhere; }
.doc-body h1 { font-size: 30px; margin: 48px 0 10px; }
.doc-body > h1:first-child { font-size: clamp(32px, 4.4vw, 46px); margin: 0 0 10px; }
.doc-body > h1:first-child + p { color: var(--muted); font-size: 14.5px; margin: 0 0 28px; padding-bottom: 22px; border-bottom: 1px solid var(--rule); }
.doc-body h2 { font-size: 28px; margin: 48px 0 12px; padding-top: 8px; }
.doc-body h3 { font-size: 21px; margin: 32px 0 8px; }
.doc-body p, .doc-body li { font-size: 17px; }
.doc-body li { margin: 6px 0; }
.doc-body ul, .doc-body ol { padding-left: 1.3rem; }
.doc-body code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86em; background: var(--bg-alt); padding: 2px 6px; border-radius: 4px; }
.doc-body blockquote { margin: 18px 0; padding: 4px 18px; border-left: 3px solid var(--yellow); color: var(--muted); }
.doc-body table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 15px; }
.doc-body th, .doc-body td { border: 1px solid var(--rule); padding: 9px 12px; text-align: left; vertical-align: top; }
.doc-body th { background: var(--bg-alt); }
.doc-body pre { background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 14px; overflow-x: auto; }
.doc-body hr { border: 0; border-top: 1px solid var(--rule); margin: 36px 0; }
.ctl-tags { font-size: 12px !important; color: var(--muted-2); margin: -4px 0 14px !important; }
.ctl-tags code { background: transparent; padding: 0; }
.doc-end { max-width: 46rem; margin-top: 56px; padding: 22px 24px; background: var(--bg-soft); border: 1px solid var(--rule); border-left: 3px solid var(--yellow); border-radius: 8px; }
.doc-end p { margin: 0 0 10px; font-size: 15.5px; }
.doc-end p:last-child { margin: 0; }

/* Overview (the library's home page) */
.doc-overview > h1:first-child + p { color: var(--ink-2); font-size: 19px; line-height: 1.55; margin: 0; padding: 0; border-bottom: 0; }
.doc-overview h2 { margin-top: 44px; }
/* 200px minimum fits three cards per row whenever the sidebar is beside the content (>1000px). */
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; margin-top: 18px; }
.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; text-decoration: none; transition: transform .12s, box-shadow .12s, border-color .12s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26, 26, 26, .06); }
.card:target { border-color: var(--yellow); }
.doc-body .card h3 { font-size: 18px; margin: 0 0 6px; }
.doc-body .card p { flex: 1; margin: 0 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.card .meta { font-size: 12px; font-weight: 500; color: var(--muted); }

/* Footer */
.foot { border-top: 1px solid var(--rule); padding: 40px 0 32px; background: var(--bg); }
.foot-in { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot-brand p { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; font-size: 14.5px; align-items: flex-start; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; text-decoration-color: var(--yellow); }
.foot-fine { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted-2); line-height: 1.5; }

/* Responsive */
@media (max-width: 1000px) {
  .doc-wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .doc-nav { position: static; }
  .doc-nav ul { display: flex; flex-wrap: wrap; gap: 6px 18px; border-left: 0; }
  .doc-nav li a { border-left: 0; margin: 0; padding: 4px 0; }
}
@media (max-width: 800px) {
  .brand-tag { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .topnav a:not(.btn) { display: none; }
  .brand-tag { display: none; }
  .doc-overview > h1:first-child + p { font-size: 17px; }
}
@media print {
  .topbar, .doc-nav, .doc-end, .foot-links { display: none; }
  .doc-wrap { display: block; padding: 0; }
  body { background: #fff; }
}
