/* Scoped overrides preserve the existing document typography. */
* { box-sizing: border-box; }
body { padding-bottom: 0; }
.site-page { letter-spacing: 0; }
.editor-toolbar { max-width: 1440px; padding: 12px 24px; margin: auto; display: flex; gap: 20px; align-items: end; flex-wrap: wrap; }
.document-picker { flex: 1 1 720px; min-width: 0; }
.document-picker > span { display: block; font: 12px var(--sans); margin-bottom: 6px; }
.document-picker .tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); width: 100%; justify-self: stretch; margin: 0; gap: 4px; }
.document-picker .tabs a { min-height: 44px; white-space: normal; text-align: center; display: grid; align-items: center; font: 12px/1.3 var(--sans); padding: 7px; border: 1px solid var(--rule); }
.header-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 12px var(--sans); }
.header-tools button { min-height: 38px; display: inline-flex; gap: 6px; align-items: center; background: white; border: 1px solid var(--rule); padding: 7px 10px; border-radius: 4px; font: inherit; cursor: pointer; }
.gen-shell { grid-template-columns: minmax(0, 820px) minmax(220px,300px); justify-content: center; gap: 28px; padding: 12px 24px 32px; }
.paper-stage,.paper { min-width: 0; }
.paper { width: 100%; max-width: 820px; }
.paper .doc-title { font-size: 21px; line-height: 1.4; text-align: center; }
.paper .ed { overflow-wrap: anywhere; max-width: 100%; white-space: normal; }
.paper .party-field { max-width: 100%; white-space: normal; }
.paper .party-line { overflow-wrap: anywhere; }
.paper .article-num { font-size: 16px; }
.inline-choice { display: inline; }
.inline-choice select { max-width: 100%; width: auto; white-space: normal; padding: 3px 24px 3px 6px; min-height: 32px; }
.ed-select-print { display: none; }
.sidebar-r { min-width: 0; }
.tip-author img { width: 44px; height: 44px; object-fit: cover; }
.party-role { flex-wrap: wrap; }
.tip-pin { cursor: pointer; }
#tip-dialog { width: min(94%,520px); max-height: 85dvh; overflow: auto; border: 1px solid #ccc; border-radius: 4px; padding: 18px; }
#tip-dialog::backdrop { background: #0008; }
#tip-dialog > button { float: right; min-height: 44px; cursor: pointer; }
.support-content,.catalog,.info-content { max-width: 1200px; margin: auto; padding: 24px; }
.catalog { border-top: 1px solid var(--rule); }
.catalog h2 { font: 24px/1.4 var(--serif); }
.catalog p { font: 14px/1.6 var(--sans); }
.sample-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.sample { display: flex; align-items: start; gap: 18px; border-top: 1px solid var(--rule); padding-top: 20px; min-width: 0; }
.sample img { width: 100px; height: auto; border: 1px solid #ddd; }
.sample h3 { font: 18px/1.5 var(--serif); margin-top: 0; }
.sample a { display: inline-block; padding: 9px 0; }
.video-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.video-frame { max-height: 480px; width: 100%; background: #111; }
.video-frame button { width: 100%; height: 100%; position: relative; display: block; border: 0; padding: 0; cursor: pointer; color: white; }
.video-frame img { width: 100%; height: 100%; object-fit: contain; background: #111; }
.video-frame span { position: absolute; bottom: 16px; left: 16px; padding: 10px; background: #111; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.video-frame[style*="9/16"] { max-width: 270px; max-height: none; }
.site-footer { padding: 28px 24px; border-top: 1px solid var(--rule); font: 13px/1.8 var(--sans); text-align: center; }
.site-footer button { border: 0; padding: 0; background: none; font: inherit; text-decoration: underline; cursor: pointer; }
.info-content > h1 { font: 30px/1.4 var(--serif); }
.info-content .hero-doc-preview,.info-content .authority-strip { display: none; }
.info-content .section { padding: 32px 0; }
.info-content .display { font-size: 28px; }
.info-content .author-card img { max-width: 260px; height: auto; }
.info-content .section-header { display: block; }
.info-content .section-header .h1 { font-size: 26px; }
.info-content table { display: block; overflow-x: auto; }
.disc-wrap { overflow-wrap: anywhere; }
.disc-wrap table { display: block; max-width: 100%; overflow-x: auto; }
.word-export-status,[data-editor-status] { text-align: center; font: 13px var(--sans); }
@media(max-width:1100px) { .gen-shell { grid-template-columns: minmax(0,820px); } .sidebar-r { position: static; width: 100%; } .sidebar-r .tip-box { display: none; } }
@media(max-width:600px) {
  .editor-toolbar { padding: 10px 12px; gap: 12px; }
  .document-picker .tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .document-picker .tabs a { min-height: 44px; }
  .gen-shell { padding: 0 8px 24px; }
  .paper { padding: 28px 16px; }
  .paper .doc-title { font-size: 17px; }
  .paper .party-block { padding-left: 10px; }
  .paper .party-line { font-size: 14px; line-height: 1.9; }
  .party-type-switches { width: 100%; align-items: start; margin-left: 0; }
  .header-tools { width: 100%; }
  .sample-grid,.video-grid { grid-template-columns: minmax(0,1fr); }
  .sample img { width: 72px; }
  .info-content,.support-content,.catalog { padding: 20px 14px; }
  .contact-layout { padding: 16px 0; gap: 24px; }
  .intro-grid { display: block; }
  .intro-author { padding: 8px 0 0; border: 0; }
  .intro-author__person img { width: 32px; height: 32px; }
  .intro-author__info { margin-left: 42px; }
}
@media print {
  @page { size: A4; margin: 18mm; }
  body { background: white; }
  .fp-header,.vzor-page-head,.editor-toolbar,.sidebar-r,.paper-actions,.support-content,.catalog,.site-footer,dialog,[data-editor-status],.cookie-banner,.cookie-backdrop,.no-print { display:none !important; }
  .gen-shell,.paper-stage { display:block; padding:0; margin:0; }
  .paper { width:100%; max-width:none; padding:0; box-shadow:none; border:0; margin:0; font-size:11pt; }
  .paper .ed { background:none; border:0; color:inherit; }
  .inline-choice select { display:none; }
  .ed-select-print { display:inline !important; color:inherit; font:inherit; }
  .article-head,.signatures { break-inside:avoid; }
}
/* Article semantics keep the original document typography. */
.paper h2.article-num, .paper h3.article-title { margin: 0; font: inherit; }
@media print { .paper .party-line { text-align: left; } }
