/* Nocture Console · legal pages: /dieu-khoan/, /chinh-sach-thue/, /chinh-sach-bao-mat/, /hop-dong-mau/
   Long-form text lives in <article class="doc">: the page's art direction (theme.css) may restyle .doc; this file only gives it
   readable defaults on top of console.css + pages.css, and the printable A4 contract (.doc-paper).
   Print: contract text is at least 12pt with dark ink on white paper (Nghị định 55/2024/NĐ-CP, Điều 6: hợp đồng theo mẫu bằng giấy). */

.doc { max-width: 780px; color: var(--fg-2); font-size: 16px; line-height: 1.7; }
.doc-head { margin-bottom: 20px; max-width: none; }
.doc-head .h1 { overflow-wrap: anywhere; }
.doc h2 { margin: 44px 0 12px; font-family: var(--font-display); font-size: clamp(21px, 2.6vw, 26px); line-height: 1.25; color: var(--fg); letter-spacing: -.01em; scroll-margin-top: calc(var(--hdr, 64px) + 16px); }
.doc h3 { margin: 26px 0 8px; font-size: 17px; line-height: 1.35; color: var(--fg); }
.doc p, .doc ul, .doc ol { margin: 0 0 12px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc li::marker { color: var(--muted); }
.doc strong, .doc b { color: var(--fg); font-weight: 600; }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc small, .doc .doc-src { color: var(--muted); font-size: 13.5px; }
.doc .tbl-wrap { margin: 10px 0 16px; }
.doc .tbl { font-size: 15px; }

.doc-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; font-size: 14px; color: var(--muted); }
.doc-meta div { display: flex; gap: 6px; }
.doc-meta dt { margin: 0; }
.doc-meta dd { margin: 0; color: var(--fg); font-weight: 550; }

.doc-toc { margin: 22px 0 8px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.doc-toc h2 { margin: 0 0 8px; font-size: 15px; font-family: var(--font-sans); letter-spacing: 0; }
.doc-toc ol { margin: 0; padding-left: 20px; columns: 2 220px; column-gap: 28px; font-size: 14.5px; }
.doc-toc li { margin: 3px 0; break-inside: avoid; }
.doc-toc a { color: var(--fg-2); text-decoration: none; }
.doc-toc a:hover { color: var(--accent); text-decoration: underline; }

.doc-note { margin: 14px 0 18px; padding: 14px 18px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--accent-soft); color: var(--fg); }
.doc-note p:last-child, .doc-note ul:last-child { margin-bottom: 0; }

.doc-co { display: grid; gap: 0; margin: 8px 0 16px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.doc-co div { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 15px; }
.doc-co div:first-child { border-top: 0; }
.doc-co dt { color: var(--muted); }
.doc-co dd { margin: 0; color: var(--fg); overflow-wrap: anywhere; }
@media (max-width: 560px) { .doc-co div { grid-template-columns: 1fr; gap: 2px; } }

.doc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 18px 0 8px; padding: 0; list-style: none; }
.doc-cards li { margin: 0; }
.doc-cards a { display: block; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--fg-2); text-decoration: none; font-size: 14.5px; line-height: 1.5; }
.doc-cards a:hover { border-color: var(--line-2); }
.doc-cards b { display: block; margin-bottom: 4px; color: var(--fg); font-size: 16px; }

.doc-related { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; }

/* ------------------------------------------------------------------ /hop-dong-mau/: the printable contract */
.doc-wide { max-width: 900px; }
.doc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 18px; }
.doc-toolbar p { margin: 0; font-size: 14px; color: var(--muted); }
.doc-paper { --ink: #111318; --ink-2: #3b3f4a; --rule: #9aa0ab;
  padding: clamp(18px, 5vw, 56px) clamp(16px, 5vw, 60px); border-radius: 6px; background: #fff; color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 24px 60px -28px rgba(0,0,0,.55); font-family: var(--font-sans); font-size: 16px; line-height: 1.6; }
.doc-paper a { color: var(--ink); }
.doc-paper h2, .doc-paper h3, .doc-paper strong, .doc-paper b { color: var(--ink); }
.doc-paper h2 { margin: 26px 0 8px; font-family: var(--font-sans); font-size: 17px; letter-spacing: 0; text-transform: none; }
.doc-paper p, .doc-paper li { color: var(--ink); }
.doc-paper li::marker { color: var(--ink-2); }
.k-motto { margin: 0 0 18px; text-align: center; font-weight: 600; line-height: 1.45; }
.k-motto span { display: block; font-weight: 600; }
.k-motto span + span { text-decoration: underline; text-underline-offset: 4px; }
.k-title { margin: 6px 0 4px; text-align: center; font-family: var(--font-sans); font-size: 21px; font-weight: 700; letter-spacing: .01em; color: var(--ink); text-transform: uppercase; }
.k-sub { margin: 0 0 16px; text-align: center; color: var(--ink-2); }
.k-basis { margin: 0 0 14px; padding-left: 20px; font-style: italic; color: var(--ink-2); }
.k-party { margin: 6px 0 4px; }
.k-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 4px 0; }
.k-row > span:not(.blank) { max-width: 100%; }
.blank { display: inline-block; min-width: 9em; flex: 1 1 9em; border-bottom: 1px dotted var(--rule); min-height: 1.4em; vertical-align: bottom; }
.blank.s { min-width: 4em; flex: 0 1 5em; }
.blank.m { min-width: 7em; flex: 0 1 8em; }
.blank:not(:empty) { border-bottom-style: solid; padding: 0 2px; font-weight: 600; }
.k-box::before { content: "☐"; display: inline-block; margin-right: 5px; font-size: 1.1em; }
.k-tbl { width: 100%; margin: 8px 0 12px; border-collapse: collapse; font-size: 14.5px; line-height: 1.4; }
.k-tbl th, .k-tbl td { padding: 7px 8px; border: 1px solid #5f6570; vertical-align: top; text-align: left; color: var(--ink); }
.k-tbl th { background: #f0f1f4; font-weight: 600; }
.k-tbl td.c, .k-tbl th.c { text-align: center; white-space: nowrap; }
.k-tbl td.w { min-width: 9em; }
.k-tbl .num { text-align: right; white-space: nowrap; }
.k-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.k-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 26px 0 8px; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.k-sign b { display: block; }
.k-sign i { display: block; font-size: 13.5px; color: var(--ink-2); }
.k-sign .k-space { height: 96px; }
.k-return { margin-top: 30px; padding-top: 18px; border-top: 2px solid var(--ink); }
.k-small { font-size: 14px; color: var(--ink-2); }
@media (max-width: 560px) { .k-sign { grid-template-columns: 1fr; } .k-sign .k-space { height: 64px; } }

/* ------------------------------------------------------------------ print: legal pages and the A4 contract */
@page { size: A4; margin: 14mm 15mm 16mm; }
@media print {
  /* paper is white whatever theme is on screen: the dark theme's color-scheme would also paint the page margins dark */
  :root, :root[data-theme] { color-scheme: light !important; --bg: #fff; --bg-2: #fff; --panel: #fff; --panel-2: #fff; --fg: #000; --fg-2: #000;
    --muted: #333; --line: #999; --line-2: #777; --accent: #000; --accent-soft: transparent; }
  html, body { background: #fff !important; color: #000 !important; }
  .hdr, .ftr, .pg-skip, .toasts, .ann, .doc-toolbar, .doc-toc, .doc-related, .lp-crumbs, #hdr, #ftr { display: none !important; }
  .doc-wide > .doc-head { display: none !important; }          /* the contract page prints the contract only */
  .doc, .doc * { color: #000 !important; }
  .sec, .pg-sec { padding: 0 !important; }
  .frame { max-width: none !important; padding: 0 !important; }
  .doc { max-width: none; color: #000; font-size: 12pt; line-height: 1.5; }
  .doc h2 { margin-top: 16pt; font-size: 14pt; color: #000; break-after: avoid; page-break-after: avoid; }
  .doc h3 { color: #000; font-size: 12.5pt; break-after: avoid; page-break-after: avoid; }
  .doc a { color: #000; text-decoration: none; }
  .doc .muted, .doc small, .doc-meta, .doc-meta dd, .doc-co dt, .doc-co dd, .doc strong, .doc b { color: #000 !important; }
  .doc-co, .doc-note, .doc-toc { background: none !important; border-color: #888 !important; }
  .doc-paper { padding: 0; box-shadow: none; border-radius: 0; font-size: 12pt; line-height: 1.45; }
  .doc-paper * { color: #000 !important; }
  .doc-paper h2 { font-size: 12.5pt; margin: 12pt 0 4pt; }
  .k-title { font-size: 15pt; }
  .k-tbl { font-size: 12pt; }
  .k-tbl th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .k-tbl tr, .k-row, .k-party, .k-tbl { break-inside: avoid; page-break-inside: avoid; }
  .k-scroll { overflow: visible; }
  .blank { border-bottom-color: #555; }
  .k-sign .k-space { height: 26mm; }
  .k-return { break-before: page; page-break-before: always; border-top: 0; padding-top: 0; margin-top: 0; }
}
