/* Shared stylesheet for /privacy/ (Vietnamese, authoritative) and /privacy/en/ (English translation).
   Palette and fonts follow embra.cloud (see /terms/). Layout: sticky TOC column at >=1100px, inline TOC below. */
:root {
  --char: #232323; --cream: #F6F6EA; --ink: #232323; --grey: #5A5A5A; --lime: #D3F28C;
  --line: rgba(35,35,35,.16); --line-strong: rgba(35,35,35,.32); --panel: #FCFCF5; --todo: #FFE27A;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: "IBM Plex Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--char); outline-offset: 3px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; background: var(--lime); color: var(--char); font: 500 14px "IBM Plex Mono", monospace; padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; }

header.site { background: var(--char); color: #FAFAFA; }
header.site .in { max-width: 1180px; margin: 0 auto; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
header.site a { font-family: "IBM Plex Mono", monospace; font-size: 14px; text-decoration: none; color: var(--lime); }
header.site b { font-family: "IBM Plex Sans", sans-serif; font-weight: 400; letter-spacing: .2em; }
header.site :focus-visible { outline-color: var(--lime); }

.shell { max-width: 1180px; margin: 0 auto; padding: 56px 24px 96px; }
.intro, .doc { max-width: 780px; min-width: 0; }

h1 { font-family: "IBM Plex Sans", sans-serif; font-weight: 500; font-size: clamp(30px, 4vw, 42px); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 14px; }
.lead { font-size: 18px; line-height: 1.7; max-width: 68ch; margin: 0 0 22px; }
.tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 0 0 26px; font-size: 15px; }
.tools .lang { font-family: "IBM Plex Mono", monospace; font-size: 14px; }
.tools .lang [aria-current] { font-weight: 500; text-decoration: none; }
button.print { font: 500 14px "IBM Plex Mono", monospace; color: var(--char); background: transparent; border: 1px solid var(--char); padding: 7px 14px; cursor: pointer; }
button.print:hover { background: var(--char); color: var(--cream); }

dl.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0 0 30px; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line); }
dl.meta > div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
dl.meta dt { font-size: 13px; color: var(--grey); margin: 0 0 4px; }
dl.meta dd { margin: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }

.summary { background: var(--panel); border: 1px solid var(--line-strong); border-left: 4px solid var(--char); padding: 18px 22px 8px; margin: 0 0 36px; }
.summary h2 { font-size: 19px; margin: 0 0 8px; padding: 0; border: 0; }
.summary li { font-size: 16px; line-height: 1.65; margin-bottom: 8px; }

/* Table of contents: one element, inline on small screens, sticky column on wide screens. */
nav.toc { border: 1px solid var(--line-strong); background: var(--panel); padding: 16px 18px 12px; margin: 0 0 40px; max-width: 780px; }
nav.toc .toc-h { font-size: 13px; color: var(--grey); margin: 0 0 8px; }
nav.toc ol { list-style: none; margin: 0; padding: 0; columns: 2 260px; column-gap: 28px; }
nav.toc li { font-size: 14.5px; line-height: 1.45; margin: 0 0 7px; break-inside: avoid; display: flex; gap: 8px; }
nav.toc li .n { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; color: var(--grey); min-width: 2.2em; padding-top: 1px; }
nav.toc a { text-decoration: none; }
nav.toc a:hover { text-decoration: underline; }

@media (min-width: 1100px) {
  .shell { display: grid; grid-template-columns: 250px minmax(0, 780px); column-gap: 56px; grid-template-areas: "toc intro" "toc doc"; justify-content: center; }
  .intro { grid-area: intro; }
  .doc { grid-area: doc; }
  nav.toc { grid-area: toc; align-self: start; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; margin: 0; background: transparent; border: 0; border-right: 1px solid var(--line); padding: 4px 20px 4px 0; }
  nav.toc ol { columns: auto; }
  nav.toc li { font-size: 14px; margin-bottom: 9px; }
}

section.s { scroll-margin-top: 20px; padding-top: 8px; }
section.s + section.s { margin-top: 28px; border-top: 1px solid var(--line-strong); padding-top: 26px; }
h2 { font-family: "IBM Plex Sans", sans-serif; font-weight: 500; font-size: 25px; line-height: 1.3; margin: 0 0 14px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
h2 .num { font-family: "IBM Plex Mono", monospace; font-size: 16px; color: var(--grey); font-weight: 500; }
h2 a.anchor, h3 a.anchor { font-family: "IBM Plex Mono", monospace; font-size: 15px; color: var(--grey); text-decoration: none; opacity: .55; }
h2 a.anchor:hover, h2 a.anchor:focus-visible, h3 a.anchor:hover, h3 a.anchor:focus-visible { opacity: 1; }
h3 { font-size: 18.5px; font-weight: 500; line-height: 1.4; margin: 26px 0 8px; scroll-margin-top: 20px; }
p, li { font-size: 17px; line-height: 1.72; max-width: 72ch; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 4px; }
code { font-family: "IBM Plex Mono", monospace; font-size: .88em; overflow-wrap: anywhere; background: rgba(35,35,35,.06); padding: 0 .25em; }
strong { font-weight: 500; }
.note { border-left: 3px solid var(--char); padding: 4px 0 4px 16px; margin: 14px 0; }
.note p:last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 16px; }
caption { text-align: left; font-size: 13.5px; color: var(--grey); padding: 0 0 6px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); line-height: 1.55; }
th { font-weight: 500; font-size: 13.5px; color: var(--grey); border-bottom: 1px solid var(--line-strong); }
td code { font-size: .85em; }

mark[data-todo] { background: var(--todo); color: var(--char); font-family: "IBM Plex Mono", monospace; font-size: .82em; padding: 1px 4px; border: 1px dashed rgba(35,35,35,.5); }

.contact { border: 1px solid var(--line-strong); background: var(--panel); padding: 16px 20px; margin: 10px 0 16px; }
.contact p { margin: 0 0 6px; }
ol.history { padding-left: 0; list-style: none; }
ol.history li { border-bottom: 1px solid var(--line); padding: 8px 0; }
ol.history .v { font-family: "IBM Plex Mono", monospace; font-size: 14px; margin-right: 10px; }

footer.site { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; color: var(--grey); max-width: 1180px; margin: 0 auto; padding: 0 24px 48px; line-height: 1.9; }
footer.site a { margin-right: 14px; }

@media screen and (max-width: 700px) {
  .shell { padding: 40px 16px 72px; }
  header.site .in, footer.site { padding-left: 16px; padding-right: 16px; }
  p, li { font-size: 16px; }
  .lead { font-size: 17px; }
  h2 { font-size: 22px; }
  dl.meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  nav.toc ol { columns: 1; }
  /* Narrow tables: each row becomes a block, the column label shows above each cell. */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.stack td { border: 0; padding: 2px 0; }
  table.stack td[data-k]::before { content: attr(data-k); display: block; font-size: 12.5px; color: var(--grey); margin-top: 6px; }
}
@media screen and (max-width: 420px) {
  dl.meta { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; color: #000; }
  header.site, footer.site, nav.toc, .tools, .skip, h2 a.anchor, h3 a.anchor { display: none !important; }
  .shell { display: block; max-width: none; padding: 0; }
  .intro, .doc { max-width: none; }
  p, li { font-size: 10.5pt; line-height: 1.5; max-width: none; }
  h1 { font-size: 20pt; }
  h2 { font-size: 14pt; break-after: avoid; }
  h3 { font-size: 11.5pt; break-after: avoid; }
  table { font-size: 9.5pt; }
  tr, .contact { break-inside: avoid; }
  .lead, .summary li, nav.toc li { font-size: 10.5pt; line-height: 1.5; }
  .summary { padding: 10px 14px 4px; }
  .summary, .contact, dl.meta > div { background: #fff; }
  table.stack thead { display: table-header-group; }
  a { text-decoration: none; }
  .doc a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
  mark[data-todo] { background: #fff; border: 1px solid #000; }
  code { background: none; }
}
