/* Privacy, terms and 404 pages. Legal text sits on paper sheets; app pages open on their object's colour. */
.policy-page {
  --text: #34352f;
  --wash: #f3ecdf;
}
.policy-page[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171a16; --card: #21261f; --ink: #f1ede2; --text: #d3d4c9; --soft: #b5b8ab; --line: #383e35;
  --signal: #ff8b67; --wash: #2a3027; --fg: #f1ede2; --on-fg: #171a16; --bar: rgb(33 38 31 / .7);
}
.policy-page[data-theme="dark"] .policy-mast { border-color: rgb(255 255 255 / .08); box-shadow: 0 10px 30px -14px rgb(0 0 0 / .6); }
.policy-page[data-theme="dark"] .theme-toggle, .policy-page[data-theme="dark"] .policy-mast .btn:hover, .policy-page[data-theme="dark"] .policy-mast > a:not(.identity):hover { background: rgb(255 255 255 / .08); }

/* ---------- Glass bar (same look as the main pages) ---------- */
.policy-mast {
  position: fixed; z-index: 60; top: 14px; left: 50%; translate: -50% 0;
  display: flex; align-items: center; gap: 2px; width: auto; max-width: calc(100% - 24px); margin: 0; padding: 5px; white-space: nowrap;
  border-radius: 999px; background: var(--bar);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid rgb(26 26 22 / .08);
  box-shadow: 0 1px 0 rgb(255 255 255 / .5) inset, 0 10px 30px -14px rgb(26 26 22 / .35);
}
.policy-mast > a:not(.identity), .policy-mast .btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 0; padding: 8px 14px; border-radius: 999px;
  font-size: .9rem; font-weight: 400; box-shadow: none; transition: background .25s;
}
.policy-mast > a:not(.identity):hover, .policy-mast .btn:hover { background: rgb(26 26 22 / .07); }
.policy-mast .btn .fas { font-size: .78em; }
.nav-actions { display: flex; align-items: center; gap: 2px; }
.theme-toggle { display: grid; place-items: center; width: 38px; height: 38px; margin-left: 2px; padding: 0; border: 0; border-radius: 50%; background: rgb(26 26 22 / .06); color: var(--ink); transition: background .25s; }
.theme-toggle:hover { background: rgb(26 26 22 / .12); }

/* ---------- Cover ---------- */
.policy-main { width: min(100% - 2 * var(--gutter), 1120px); max-width: none; margin-inline: auto; padding: clamp(96px, 13vh, 130px) 0 0; }
.policy-cover { padding: clamp(20px, 4vw, 60px) 0 clamp(36px, 5vw, 64px); }
.policy-cover h1 { max-width: 16ch; font: 400 clamp(3rem, 7vw, 7rem)/.94 var(--serif); letter-spacing: -.058em; text-wrap: balance; }
.policy-cover h1 em { color: var(--signal); }
.policy-cover:not(.app-cover) { width: min(100%, 50rem); margin-inline: auto; }
.policy-cover:not(.app-cover) h1 { font-size: clamp(3rem, 6.4vw, 5.8rem); }
.policy-detail { margin-top: clamp(20px, 2.4vw, 30px); color: var(--soft); }
.policy-detail + p { display: inline-block; margin-top: 12px; padding: 6px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font: 500 .74rem/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--soft); }
.policy-cover .intro, .page-subtitle { max-width: 52ch; margin-top: 18px; color: var(--soft); font-size: clamp(1.04rem, 1.35vw, 1.22rem); line-height: 1.55; }
.page-links { margin-top: 26px; }
.page-links .btn { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--fg) 55%, transparent); }
.page-links .btn:hover { box-shadow: inset 0 0 0 1.5px var(--fg); }
.page-links .fas { font-size: .85em; }

/* App pages open on their object, like the homepage chapters */
.app-cover {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); align-items: center; gap: clamp(20px, 4vw, 60px);
  margin: clamp(6px, 1.5vw, 20px) 0 clamp(20px, 2.4vw, 32px); padding: clamp(32px, 5vw, 72px); border-radius: var(--radius);
  background: var(--bg); color: var(--fg);
}
.app-cover h1 { max-width: 12ch; font-size: clamp(2.8rem, 6vw, 6rem); }
.app-cover h1 em, .app-cover .page-subtitle { color: var(--fg); }
.app-cover .page-subtitle { opacity: .86; }
.app-cover .policy-print { rotate: -5deg; }
.app-cover .policy-print img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Reading sheets ---------- */
.reading-column, .legal-section, .toc {
  width: min(100%, 50rem); margin-inline: auto; padding: clamp(26px, 5vw, 64px);
  border-radius: clamp(20px, 2.4vw, 30px); background: var(--card); color: var(--text);
  font-size: 1.02rem; line-height: 1.72; overflow-wrap: break-word;
  box-shadow: 0 1px 0 rgb(0 0 0 / .04), 0 30px 60px -44px rgb(40 40 25 / .55);
}
.legal-section + .legal-section, .lang-section + .lang-section .legal-section { margin-top: 20px; }
.lang-section .legal-section + .legal-section { margin-top: 20px; }
.policy-main a:not(.btn) { color: var(--signal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; overflow-wrap: anywhere; }
.policy-main a:not(.btn):hover { color: var(--ink); }
.reading-column p + p, .legal-section p + p { margin-top: .75em; }
.reading-column ul, .legal-section ul { margin: .8em 0; padding-inline-start: 1.3rem; }
.reading-column li + li, .legal-section li + li { margin-top: .45em; }
.reading-column li::marker, .legal-section li::marker { color: var(--signal); }
.reading-column strong, .legal-section strong { color: var(--ink); font-weight: 600; }
.reading-column code { padding: .1em .35em; border-radius: 6px; background: var(--wash); font: .88em var(--mono); }

/* Website pages: numbered h2 sections */
.reading-column h2 { margin: 2.4rem 0 .8rem; padding-top: 1.8rem; border-top: 1px solid var(--line); color: var(--ink); font: 400 clamp(1.6rem, 2.6vw, 2.2rem)/1.15 var(--serif); letter-spacing: -.035em; }
.reading-column > :first-child, .reading-column h2:first-child { margin-top: 0; padding-top: 0; border: 0; }
.reading-column nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.reading-column nav a { padding: 6px 13px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink) !important; text-decoration: none !important; font-size: .9rem; transition: box-shadow .25s, background .25s; }
.reading-column nav a:hover { box-shadow: inset 0 0 0 1px var(--ink); }

/* App pages: titled sections, numbered subsections */
.section-title { margin: 0 0 clamp(18px, 2.4vw, 30px); padding-bottom: 16px; border-bottom: 1px solid var(--line); color: var(--signal); font: 500 .8rem/1.4 var(--mono); letter-spacing: .08em; }
.subsection { margin: 0; }
.subsection + .subsection { margin-top: 2.2rem; padding-top: 2.2rem; border-top: 1px solid var(--line); }
.subsection h4, .final-declaration h4 { margin: 0 0 .8rem; color: var(--ink); font: 600 .95rem/1.4 Geist, system-ui, sans-serif; letter-spacing: .03em; }
.subsection h5 { margin: 1.4rem 0 .4rem; color: var(--ink); font: 600 1rem/1.4 Geist, system-ui, sans-serif; }
.checklist { list-style-type: "✓  "; }
.footer-info { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line); color: var(--soft); font-size: .92rem; }
.summary, .highlight-box, .final-declaration { margin: 1.4rem 0; padding: 1.1rem 1.4rem; border-radius: 16px; background: var(--wash); color: var(--ink); }
.summary { margin-top: 0; font: 400 1.18rem/1.45 var(--serif); letter-spacing: -.01em; }

.toc { margin-bottom: 20px; padding-block: clamp(20px, 3vw, 32px); }
.toc h3 { margin: 0; color: var(--soft); font: 500 .76rem/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.toc ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 7px 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink) !important; text-decoration: none !important; }
.toc a:hover { box-shadow: inset 0 0 0 1px var(--ink); }

.lang-tabs { display: none; }
.has-policy-controls .lang-tabs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; width: fit-content; max-width: 100%;
  margin: 0 auto 20px; padding: 5px; border-radius: 28px; background: var(--card);
  box-shadow: 0 1px 0 rgb(0 0 0 / .04), 0 16px 30px -24px rgb(40 40 25 / .5);
}
.lang-tab { min-height: 40px; padding: 6px 15px; border: 0; border-radius: 999px; background: transparent; font-size: .92rem; transition: background .25s, color .25s; }
.lang-tab:hover { background: rgb(26 26 22 / .06); }
.lang-tab.active { background: var(--ink); color: var(--paper); font-weight: 500; }
.has-policy-controls .lang-section:not(.active) { display: none; }

.table-scroll { overflow-x: auto; margin: 1rem 0; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.processor-table { width: 100%; min-width: 42rem; border-collapse: collapse; font-size: .92rem; line-height: 1.5; }
.processor-table :is(th, td) { padding: .8rem .9rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.processor-table tr:last-child td { border-bottom: 0; }
.processor-table th { background: var(--wash); color: var(--ink); font-weight: 600; }

/* ---------- Footer ---------- */
.policy-footer {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px;
  width: 100%; max-width: none; margin: clamp(60px, 8vw, 110px) 0 0; padding: 34px var(--gutter) 40px;
  border-radius: var(--radius) var(--radius) 0 0; background: #121411; color: #8e9085; font-size: .9rem;
}
.policy-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
.policy-footer a { color: var(--cream); }
.policy-footer a:hover { color: #ff8b67; }

/* Legacy redirect pages */
.redirect-page { display: grid; min-height: 100svh; padding: 1.5rem; place-items: center; }
.redirect-page p { font: 400 clamp(1.4rem, 3.8vw, 2.7rem)/1.3 var(--serif); }
.redirect-page a { color: var(--signal); text-decoration: underline; }

@media (max-width: 760px) {
  .app-cover { grid-template-columns: 1fr; }
  .app-cover .policy-print { order: -1; width: min(70%, 260px); margin: -10px 0 -6px; }
  .policy-mast > a:not(.identity), .policy-mast .btn { padding: 8px 11px; font-size: .86rem; }
}
@media (max-width: 420px) {
  .policy-mast .identity { padding-right: 6px; }
  .policy-mast .identity { font-size: 0; gap: 0; }
}
