/* Passport document styles — CSP style-src 'self' */
:root {
  --bg: #FFFFFF;
  --text: #0F1115;
  --muted: #5F6672;
  --line: #E1E4EA;
  --accent: #1B4DE4;
  --z-green: #1E7F4F;
  --z-green-bg: #E3F4EA;
  --z-yellow: #9A6700;
  --z-yellow-bg: #FBF0D5;
  --z-red: #B42323;
  --z-red-bg: #FBE4E4;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Onest, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
  display: flex;
  flex-direction: column;
  align-items: center;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap {
  width: 720px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
  position: relative;
  box-sizing: border-box;
}
@media (max-width: 760px) {
  .wrap { width: 100%; padding: 0 16px; }
}
.layer { position: relative; }
.layer + .layer { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.wm-host {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.wm-host canvas {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  width: 80%;
  height: auto;
  opacity: 1;
}
.layer > *:not(.wm-host) { position: relative; z-index: 1; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: Unbounded, sans-serif;
  font-weight: 500;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.topbar-left { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.topbar-right {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  flex-shrink: 0;
}
.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  word-break: break-all;
}
.muted { color: var(--muted); }
.caption { font-size: 12.5px; color: var(--muted); }

.channel { margin: 1.5rem 0; }
.channel h1 {
  font-family: Onest, sans-serif;
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 0.2rem;
  line-height: 1.25;
}
.channel .meta { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.rights-note { margin-top: 0.5rem; color: var(--text); line-height: 1.45; }

.class-block {
  margin: 1.25rem 0 0;
  padding: 1rem 0 0.35rem;
  border-top: 1px solid var(--line);
  border-bottom: none;
}
.stamp {
  width: 168px;
  height: 168px;
  background: #1B4DE4;
  border-radius: 6px;
  color: #fff;
  position: relative;
  text-align: center;
  flex-shrink: 0;
  overflow: visible;
}
.stamp .letter {
  font-family: Unbounded, sans-serif;
  font-weight: 600;
  font-size: 96px;
  line-height: 1;
  margin: 0;
  color: #fff;
  text-transform: uppercase;
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
}
.stamp .lines {
  font-family: Onest, sans-serif;
  font-size: 10px;
  line-height: 1.3;
  color: #fff;
  opacity: 0.85;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  margin: 0;
}
#qr-face {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}
#qr-face a { display: block; }
#qr-face img, #qr-face canvas { width: 96px !important; height: 96px !important; display: block; }
.class-line { font-weight: 600; font-size: 22px; margin: 0 0 0.5rem; }
.class-sentence { margin: 0.65rem 0 0; }
.prelim {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.35rem 0.65rem;
  background: var(--z-yellow-bg);
  color: var(--z-yellow);
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
}
.prelim-note { margin: 0.35rem 0 0; }
.status-line {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 1rem;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.4;
}
.checklist { list-style: none; margin: 0.75rem 0 1.25rem; padding: 0; }
.checklist li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.35rem 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.checklist .cid { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--muted); }
.checklist .clabel { font-weight: 600; display: block; }
.checklist .canswer { color: var(--text); }
.header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
  width: 100%;
}
.header-grid .meta {
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}
.header-grid h1 { margin: 0.25rem 0 0.05rem !important; }
.header-grid .rights-note { margin: 0.35rem 0 0; line-height: 1.35; }
.summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: none;
}
@media (max-width: 560px) {
  .header-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .topbar-right { order: 2; margin-top: 0.5rem; }
  .topbar-left { gap: 0; }
  .header-grid .meta { line-height: 1.3; }
  .stamp { width: 120px; height: 120px; }
  .stamp .letter { font-size: 80px; }
}

.now {
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.now h2, .sec-title, .sheet h2, .verify h2, .owner h2 {
  font-family: Onest, sans-serif;
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 0.75rem;
}
.now .tag {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.now p { margin: 0.25rem 0; }

.summary-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.5rem 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.summary-list a.row {
  display: contents;
  color: inherit;
  text-decoration: none;
}
.summary-list a.row:hover .sum-title { color: var(--accent); text-decoration: underline; }
.zone {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.3;
  white-space: nowrap;
}
.zone.green { color: var(--z-green); background: var(--z-green-bg); }
.zone.yellow { color: var(--z-yellow); background: var(--z-yellow-bg); }
.zone.red { color: var(--z-red); background: var(--z-red-bg); }
.zone.none { color: var(--muted); background: transparent; padding-left: 0; }
.sum-title { font-weight: 600; }
.sum-line { grid-column: 2; font-size: 14px; color: var(--muted); margin: 0; }

.history { margin: 1.25rem 0; font-size: 15px; }
.history span { color: var(--muted); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1.5rem 0 0;
}
.btn {
  appearance: none;
  border: 1px solid #1B4DE4;
  background: #fff;
  color: #1B4DE4;
  font-family: Onest, sans-serif;
  font-size: 14px;
  height: 40px;
  padding: 0 1rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.btn:hover { background: #F2F5FE; color: #1B4DE4; text-decoration: none; }
.btn.primary { background: #1B4DE4; border-color: #1B4DE4; color: #fff; }
.btn.primary:hover { background: #1740C4; color: #fff; }

.section-block {
  margin: 40px 0;
  padding-top: 0;
}
.section-block h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 24px;
  line-height: 1.3;
}
.section-concl { color: var(--muted); margin: 0 0 24px; }
.chart-wrap {
  position: relative;
  width: 720px;
  height: 280px;
  margin: 0 0 8px;
}
.chart-wrap canvas { display: block; width: 720px; height: 100%; }
.chart-wrap.tall { height: 280px; }
.chart-wrap.h240 { height: 240px; }
.chart-wrap.sm { height: 160px; width: 720px; }
.chart-note { font-size: 12.5px; color: var(--muted); margin: 0 0 24px; }
.checklist { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.checklist li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.checklist .cid { font-weight: 600; margin-right: 0.5rem; }
.heat { margin: 0.75rem 0 1rem; overflow-x: auto; }
.heat table { border-collapse: collapse; font-size: 11px; width: 100%; }
.heat th, .heat td {
  border: 1px solid var(--line);
  padding: 0.2rem 0.25rem;
  text-align: center;
  min-width: 1.6rem;
}
.heat th { color: var(--muted); font-weight: 500; }
.heat .cell { background: var(--z-green-bg); }
.rule .tl { margin: 0.25rem 0; }
.rule .tl span { color: var(--muted); }

table.metrics {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 0 0 1.25rem;
}
table.metrics th, table.metrics td {
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.35rem;
  text-align: left;
  vertical-align: top;
}
table.metrics th { color: var(--muted); font-weight: 500; font-size: 13px; }
table.metrics td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.metrics th.t-num, table.metrics td.t-num { text-align: right; font-variant-numeric: tabular-nums; }
table.metrics th.t-zone, table.metrics td.t-zone { text-align: center; }

.rules { margin: 0 0 1.25rem; }
.rule {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}
.rule summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: baseline;
}
.rule summary::-webkit-details-marker { display: none; }
.rule .rid { font-weight: 600; }
.rule .rval { font-variant-numeric: tabular-nums; }
.rule .body { margin-top: 0.55rem; font-size: 14px; }
.rule .method {
  margin-top: 0.5rem;
  font-size: 13px;
  color: var(--muted);
}
.rule .method summary { color: var(--accent); font-size: 13px; }

.adv-note {
  font-size: 14px;
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.sheet { margin-top: 2.5rem; }
.sheet ul { padding-left: 1.1rem; margin: 0.4rem 0; }

.verify .row { margin: 0.5rem 0; }
.verify .result {
  display: inline-block;
  margin-left: 0.5rem;
  font-weight: 600;
  min-height: 1.2em;
}
.verify .result.ok { color: var(--z-green); }
.verify .result.bad { color: var(--z-red); }
.wm-note { margin: 1.25rem 0; font-size: 14px; color: var(--muted); }
.disclaimers { margin: 1.25rem 0; padding: 0; list-style: none; }
.disclaimers li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.owner ul { padding-left: 1.1rem; }
.stub {
  margin-top: 0.75rem;
  font-size: 14px;
  color: var(--muted);
  display: none;
}
.stub.open { display: block; }

.print-footer { display: none; align-self: stretch; width: 100%; }

@page { size: A4; margin: 18mm 15mm 24mm 15mm; }
@media print {
  body { background: #fff; }
  .actions, .btn, .page-actions, .verify-btns { display: none !important; }
  .wrap {
    width: 720px;
    zoom: 0.94;
    padding: 0;
    margin: 0 auto;
  }
  #face { page-break-after: always; break-after: page; }
  h1, h2, h3, h4, .sec-title, .doc-title {
    break-after: avoid;
    page-break-after: avoid;
  }
  /* keep только атомарные блоки — не контейнеры разделов / «Подробный разбор» */
  .card, .card-proto, .chart-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }
  table.table-keep {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .header-grid {
    align-items: start;
    break-inside: auto;
    page-break-inside: auto;
  }
  .topbar-right {
    position: static !important;
    float: none !important;
    display: flex !important;
    align-items: flex-start;
    gap: 0.75rem;
    flex-shrink: 0;
  }
  #qr-face {
    display: block !important;
    position: static !important;
    width: 168px !important;
    height: 168px !important;
    max-width: 168px !important;
    max-height: 168px !important;
    flex-shrink: 0;
    overflow: hidden;
  }
  #qr-face img {
    display: block !important;
    width: 168px !important;
    height: 168px !important;
    max-width: 168px !important;
    max-height: 168px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #qr-face canvas, #qr-face table { display: none !important; }
  /* PDF через Playwright: footerTemplate; в браузерной печати фиксированный подвал скрыт */
  .print-footer { display: none !important; }
  .layer + .layer { border-top: none; }
}

@media (max-width: 560px) {
  .topbar { flex-direction: column; }
  .topbar-right { align-self: flex-start; }
  .summary-list li { grid-template-columns: 1fr; }
  .sum-line { grid-column: 1; }
  .stamp { width: 140px; height: 140px; }
  .stamp .letter { font-size: 96px; }
}
/* 03g overrides */

.wm-host { display: none !important; }
.prelim { display: none !important; }
.status-line { display: none !important; }
.stamp { width:168px!important; height:168px!important; background:#1B4DE4!important; color:#fff!important; border:none!important; border-radius:6px!important; padding:0!important; }
.stamp .letter { font-family:Unbounded,sans-serif!important; font-weight:600!important; font-size:96px!important; color:#fff!important; line-height:1!important; margin:0!important; text-transform:uppercase; }
.stamp .lines { font-family:Onest,sans-serif!important; font-size:10px!important; color:#fff!important; opacity:0.85!important; }
#qr-face, #qr-face img, #qr-face canvas { width:168px!important; height:168px!important; }
.wordmark { font-size:26px!important; }
.brand-sub { font-size:13px; color:var(--muted); margin:0.2rem 0 0; }
.doc-title { font-size:22px; font-weight:600; margin:1rem 0 0.25rem; line-height:1.3; }
.doc-num { font-family:"JetBrains Mono",monospace; font-size:14px; margin:0 0 1rem; }
.facts { margin:0; padding:0; list-style:none; }
.facts li { display:grid; grid-template-columns:minmax(160px,44%) 1fr; gap:0.5rem; padding:0.22rem 0; border-bottom:1px solid var(--line); font-size:15px; }
.facts .k { color:var(--muted); }
.two-lists { display:grid; grid-template-columns:1fr 1fr; gap:1.25rem; margin:1rem 0 1.5rem; }
.two-lists h3 { font-size:15px; font-weight:600; margin:0 0 0.4rem; }
.two-lists ul { margin:0; padding-left:1.1rem; }
.two-lists li { margin:0.25rem 0; font-size:14px; }
.sec-table { width:100%; border-collapse:collapse; margin:1rem 0; font-size:14px; }
.sec-table th, .sec-table td { border-bottom:1px solid var(--line); padding:0.45rem 0.35rem; text-align:left; vertical-align:top; }
.sec-table th { color:var(--muted); font-weight:500; }
.card-proto { border-top:1px solid var(--line); padding:1rem 0; margin:0.35rem 0; }
.card-proto .card-head { display:flex; justify-content:space-between; gap:1rem; font-weight:600; margin-bottom:0.55rem; }
.card-proto .row { display:grid; grid-template-columns:150px 1fr; gap:0.35rem; margin:0.2rem 0; font-size:14px; }
.card-proto .lab { color:var(--muted); }
.page-actions { display:flex; flex-wrap:wrap; gap:0.5rem; margin-top:2.5rem; padding-top:1.5rem; border-top:1px solid var(--line); }
.legend-once { font-size:14px; color:var(--muted); margin:0 0 1.5rem; padding:0.75rem 0; border-bottom:1px solid var(--line); }
.concl-table, .place-table, .verify-table, table.t-fields { width:720px; border-collapse:collapse; font-size:14px; margin:0.75rem 0 1.25rem; table-layout:fixed; }
.concl-table th, .concl-table td, .place-table th, .place-table td, .verify-table th, .verify-table td { border-bottom:1px solid #E1E4EA; padding:8px 12px 8px 0; text-align:left; vertical-align:top; }
.concl-table th, .verify-table th { color:#5F6672; font-weight:500; }
.facts-table { margin:0 0 24px; }
.verify-head { display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; }
.verify-btns { display:flex; gap:0.5rem; align-items:center; flex-wrap:wrap; }
.class-rule { margin:0 0 1rem; font-size:15px; }
@media (max-width:640px){ .two-lists{grid-template-columns:1fr;} .facts li{grid-template-columns:1fr;} }
@media print{ .page-actions, .verify-btns button{ display:none!important; } }

/* verstka-spec-v1: форма страницы */

html, body, * { hyphens:none!important; -webkit-hyphens:none!important; -moz-hyphens:none!important; overflow-wrap:normal; }
body { line-height:1.55; font-size:15px; font-variant-numeric:tabular-nums; }
h1, h2, h3, h4 { line-height:1.3; }
.section-block { margin:40px 0; }
.section-block h3, .sec-title { font-size:22px; font-weight:600; white-space:normal; }
.section-block h4 { font-size:15px; font-weight:600; margin:24px 0 8px; }
.chart-wrap { position:relative; width:720px; height:280px; margin:0 0 8px; }
.chart-wrap.tall { height:280px; }
.chart-wrap.ret { height:240px; }
.chart-row { display:block; margin:0 0 24px; }
.chart-row .chart-wrap { margin:0 0 16px; }

table.t-ind, table.t-list, table.t-fields,
table.metrics, table.sec-table, table.concl-table, table.place-table, table.verify-table {
  table-layout: fixed;
  width: 720px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 24px;
}
table.t-ind th, table.t-list th, table.t-fields th,
table.metrics th, table.concl-table th, table.place-table th, table.verify-table th {
  color: #5F6672;
  font-weight: 500;
  font-size: 12.5px;
  vertical-align: bottom;
  line-height: 1.3;
  border-bottom: 1px solid #C9CED6;
  padding: 8px 12px 8px 0;
}
table.t-ind td, table.t-list td, table.t-fields td,
table.metrics td, table.concl-table td, table.place-table td, table.verify-table td {
  border-bottom: 1px solid #E1E4EA;
  padding: 8px 12px 8px 0;
  vertical-align: top;
  overflow: visible;
}
table.t-ind th.t-text, table.t-ind td.t-text,
table.t-list th.t-text, table.t-list td.t-text,
table.t-fields th, table.t-fields td.t-text { text-align: left; }
table.t-ind th.t-num, table.t-ind td.t-num,
table.t-ind th.t-zone, table.t-ind td.t-zone,
table.t-ind th.t-keep, table.t-ind td.t-keep {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow-wrap: break-word;
}
table.t-list th.t-num, table.t-list th.t-zone, table.t-list th.t-keep {
  text-align: center;
  white-space: normal;
  font-variant-numeric: tabular-nums;
}
table.t-list td.t-num, table.t-list td.t-zone, table.t-list td.t-keep {
  text-align: center;
  white-space: normal;
  font-variant-numeric: tabular-nums;
}
table.t-list td.t-title { text-align: left; white-space: normal; overflow-wrap: break-word; word-break: normal; }
.table-note, .chart-note { font-size: 12.5px; color: var(--muted); margin: -12px 0 24px; }
.chart-legend, ul.chart-legend {
  font-size: 12.5px; color: var(--muted); line-height: 1.45;
  margin: 0 0 16px; padding: 0;
}
ul.chart-legend { list-style: none; }
ul.chart-legend li { margin: 0.15rem 0; display: flex; align-items: center; gap: 6px; }
.chart-legend .swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0;
  vertical-align: middle; margin-right: 4px;
}
.card-proto { border-top: 1px solid var(--line); padding: 0; margin: 0 0 20px; }
.card-proto .card-head { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; margin-bottom: 8px; white-space: nowrap; }
.card-proto .row { display: grid; grid-template-columns: 160px 560px; gap: 0.75rem; margin: 0 0 4px; font-size: 14px; }
.card-proto .row:last-child { margin-bottom: 0; }
.card-proto .lab { color: var(--muted); white-space: nowrap; }
.zone { font-size: 12px; padding: 2px 8px; border-radius: 4px; line-height: 1.3; white-space: normal; }
.btn {
  height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid #1B4DE4; background: #fff; color: #1B4DE4;
  padding: 0 1rem; font-size: 14px; line-height: 1.2;
}
.btn.primary { background: #1B4DE4; border-color: #1B4DE4; color: #fff; }
.btn.primary:hover { background: #1740C4; color: #fff; }
.page-actions, .actions, .verify-btns { gap: 12px; }
.page-actions { margin-top: 3rem; padding-top: 1.5rem; }
#face .page-actions { display: none !important; }
@media print { .page-actions, .verify-btns button, .btn { display: none !important; } }
