* { box-sizing: border-box; }
:root {
  --bg: #f3f6fa;
  --panel: #fff;
  --ink: #152033;
  --muted: #637083;
  --line: #d9e1ea;
  --marine: #1a3f7a;
  --red: #e42529;
  --soft: #f8fafc;
  --shadow: 0 18px 55px rgba(21,32,51,.08);
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 78% -10%, rgba(26,63,122,.10), transparent 34%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 46%, #eef3f7 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(21,32,51,.03);
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
button:hover { border-color: var(--marine); color: var(--marine); transform: translateY(-1px); }
.primary { background: var(--marine); border-color: var(--marine); color: #fff; }
.primary:hover { color: #fff; background: #143462; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  width: 238px;
  height: 100vh;
  padding: 22px 18px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--line);
  box-shadow: 14px 0 40px rgba(21,32,51,.04);
}
.sidebar-logo { width: 205px; margin-bottom: 26px; }
.nav {
  width: 100%;
  display: block;
  text-align: left;
  margin-bottom: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 12px 14px;
  text-decoration: none;
}
.nav.active, .nav:hover { background: #eaf2ff; color: var(--marine); }
.workspace { flex: 1; min-width: 0; padding: 24px; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.topbar p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.topbar h1 { margin: 0; font-size: 28px; letter-spacing: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.toolbar input {
  min-width: min(52vw, 952px);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 13px;
  background: rgba(255,255,255,.9);
  box-shadow: inset 0 1px 0 rgba(21,32,51,.02);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
  margin-bottom: 16px;
}
.mobile-tabs {
  display: none;
  gap: 8px;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding: 8px 0;
}
.mobile-tabs button {
  flex: 1;
  background: #fff;
}
.mobile-tabs button.active {
  background: var(--marine);
  color: #fff;
  border-color: var(--marine);
}
.stats div, .editor, .preview, .container-workbench {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.stats div { padding: 18px 19px; display: grid; gap: 8px; }
.stats span { color: var(--muted); font-size: 12px; }
.stats strong { font-size: 23px; }
.module-grid {
  display: grid;
  grid-template-columns: minmax(420px, .66fr) minmax(820px, 1.34fr);
  gap: 18px;
  align-items: start;
}
.editor {
  height: calc(100vh - 32px);
  min-height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px 20px 120px;
  scroll-padding-bottom: 120px;
}
.editor-block {
  padding-bottom: 17px;
  margin-bottom: 17px;
  border-bottom: 1px solid var(--line);
}
.editor-block:last-child { border-bottom: 0; }
.party-jump {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}
.party-jump button {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}
.editor-block h2 {
  margin: 0 0 12px;
  font-size: 15px;
}
label {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 13px;
  outline: 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
input:focus, textarea:focus {
  border-color: var(--marine);
  box-shadow: 0 0 0 3px rgba(26,63,122,.10);
}
textarea { min-height: 82px; resize: vertical; }
.grid { display: grid; gap: 10px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.asset-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.asset-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 5px;
  align-items: stretch;
}
.upload {
  min-height: 46px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #f7fafc;
  margin-bottom: 0;
  font-size: 11px;
  letter-spacing: .08em;
}
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.asset-control button {
  min-height: 46px;
  padding: 0;
  border-radius: 8px;
  background: #fff7f7;
  color: var(--red);
  font-size: 11px;
  letter-spacing: 0;
  box-shadow: none;
}
.asset-control button:hover {
  border-color: var(--red);
  color: var(--red);
}
.row-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.document-list { display: grid; gap: 7px; }
.document-list button {
  display: grid;
  gap: 3px;
  text-align: left;
}
.document-list span { color: var(--muted); font-size: 11px; }
.archive-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.archive-panel {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.archive-panel h2 {
  margin: 0;
  font-size: 18px;
}
.archive-panel .row-title {
  margin-bottom: 14px;
}
.archive-panel .row-title a {
  color: var(--marine);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.archive-list {
  display: grid;
  gap: 9px;
}
.archive-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.archive-open {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}
.archive-item:hover {
  border-color: var(--marine);
  box-shadow: 0 10px 26px rgba(26,63,122,.10);
}
.archive-open div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.archive-open strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.archive-open span,
.archive-open p,
.archive-list p {
  color: var(--muted);
  font-size: 12px;
}
.archive-open p {
  margin: 0;
}
.archive-delete {
  min-height: 34px;
  padding: 7px 12px;
  border-color: #f0b4b4;
  background: #fff7f7;
  color: var(--red);
  box-shadow: none;
}
.archive-delete:hover {
  border-color: var(--red);
  color: var(--red);
}
.container-workbench {
  margin-top: 22px;
  padding: 18px;
}
.container-workbench .row-title {
  margin-bottom: 14px;
}
.container-workbench h2 {
  margin: 0;
  font-size: 18px;
}
.container-head,
.container-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(95px, .85fr) minmax(120px, 1fr) minmax(105px, .9fr) minmax(140px, 1.05fr) 44px 44px 86px 66px;
  gap: 9px;
  align-items: center;
}
.container-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 8px;
  padding: 0 2px 6px;
  background: rgba(255,255,255,.96);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.container-editor {
  display: grid;
  gap: 9px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 4px;
}
.container-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 8px;
}
.container-row input { min-width: 0; font-size: 14px; padding: 10px; }
.container-row button { min-height: 39px; padding: 0 8px; font-size: 12px; }
.preview { overflow: auto; }
.preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.preview-bar span { color: var(--muted); font-size: 12px; }
.print-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 24px auto;
  background: #fff;
  color: #111827;
  box-shadow: 0 28px 80px rgba(21,32,51,.18);
  font-family: Arial, Tahoma, sans-serif;
  overflow: hidden;
}
.preview .print-sheet {
  max-width: calc(100% - 24px);
}
body.pdf-exporting .print-sheet {
  width: 210mm;
  max-width: none;
  min-height: 0;
  margin: 0;
  box-shadow: none;
  overflow: visible;
}
.bol-shell { width: 100%; border-collapse: collapse; }
.bol-shell thead { display: table-header-group; }
.bol-shell tfoot { display: table-footer-group; }
.bol-shell td { padding: 0; }
.doc-header {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(46mm, .95fr);
  gap: 5mm;
  align-items: center;
  padding: 6mm 7mm 3mm;
  border-bottom: 1.5px solid #111;
}
.brand { display: flex; align-items: center; gap: 3mm; min-width: 0; }
.brand img { width: 96mm; max-width: 100%; max-height: 26mm; object-fit: contain; }
.brand div { display: grid; gap: 2mm; font-size: 8pt; line-height: 1.25; }
.brand:has(img) div { display: none; }
.title { text-align: right; }
.title h1 {
  margin: 0 0 2mm;
  font-size: 16.5pt;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.title p { margin: 0; font-size: 11pt; }
.doc-footer {
  display: flex;
  justify-content: space-between;
  padding: 2.5mm 7mm;
  border-top: 1px solid #111;
  font-size: 7pt;
}
.top-grid, .routing, .declaration, .freight {
  display: grid;
  margin: 0 7mm;
  border-left: 1px solid #111;
  border-top: 1px solid #111;
}
.top-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.doc-field, .company-note, .soft, .signature, .declaration > div {
  min-height: 23mm;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
  padding: 2mm;
  font-size: 7.4pt;
  line-height: 1.28;
}
.top-grid > .span2 {
  min-height: 23mm;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
  padding: 2mm;
  font-size: 7.4pt;
  line-height: 1.28;
}
.top-grid > .span2 > .doc-field {
  min-height: 0;
  border: 0;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}
.doc-field b {
  display: block;
  margin-bottom: 2mm;
  font-size: 6.8pt;
  color: #28313f;
}
.doc-field strong, .doc-field span, .company-note span { display: block; }
.doc-field strong { font-size: 7.6pt; }
.company-note strong { display: block; margin-bottom: 3mm; }
.soft { background: #fbfcfd; }
.small { font-size: 6.6pt; }
.qr {
  margin-top: 3mm;
  border: 1px dashed #aab4c3;
  padding: 2mm;
  font-size: 6pt;
}
.routing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.routing .doc-field { min-height: 13mm; }
.cargo, .containers {
  width: calc(100% - 14mm);
  margin: 0 7mm;
  border-collapse: collapse;
  page-break-inside: auto;
}
.cargo th, .cargo td, .containers th, .containers td {
  border: 1px solid #111;
  padding: 1.7mm 2mm;
  font-size: 7.2pt;
  line-height: 1.3;
  vertical-align: top;
}
.cargo thead, .containers thead { display: table-header-group; }
.cargo tr, .containers tr { break-inside: avoid; page-break-inside: avoid; }
.cargo th, .containers th { background: #f2f5f8; text-align: left; font-weight: 800; }
.cargo td:nth-child(2) span { display: block; margin-top: 1.5mm; }
.cargo th:nth-child(1), .cargo td:nth-child(1) { width: 23%; }
.cargo th:nth-child(2), .cargo td:nth-child(2) { width: 45%; }
.cargo th:nth-child(3), .cargo td:nth-child(3), .cargo th:nth-child(4), .cargo td:nth-child(4) { width: 16%; }
.declaration { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.declaration > div { min-height: 16mm; }
.freight { grid-template-columns: .9fr .9fr .9fr .95fr 1.35fr; }
.freight .doc-field, .signature { min-height: 30mm; }
.signature b { display: block; margin-bottom: 4mm; font-size: 6.8pt; }
.signature-images {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22mm;
}
.signature img {
  display: block;
  width: 100%;
  max-width: 48mm;
  max-height: 22mm;
  object-fit: contain;
}
.containers { margin-top: 4mm; margin-bottom: 4mm; }
.containers td:last-child, .containers th:last-child { text-align: right; }
.cmr-sheet {
  padding: 3mm 5mm;
  font-family: Arial, Helvetica, sans-serif;
}
.cmr-header {
  display: grid;
  grid-template-columns: 1fr 44mm;
  gap: 6mm;
  align-items: center;
  border: 1.4px solid #111;
  border-bottom: 0;
  padding: 2mm;
}
.cmr-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 4mm;
  min-width: 0;
}
.cmr-header img {
  width: 62mm;
  max-height: 14mm;
  object-fit: contain;
}
.cmr-header span {
  color: #344055;
  font-size: 8pt;
  font-weight: 700;
}
.cmr-header h1 {
  margin: 0;
  color: #e42529;
  font-size: 24pt;
  line-height: 1;
  letter-spacing: 0;
  text-align: right;
}
.cmr-header p {
  margin: 1mm 0 0;
  font-size: 9pt;
  text-align: right;
}
.cmr-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-left: 1.2px solid #111;
  border-top: 1.2px solid #111;
}
.cmr-span-2 { grid-column: span 2; }
.cmr-span-4 { grid-column: span 4; }
.cmr-box {
  min-height: 15mm;
  border-right: 1.2px solid #111;
  border-bottom: 1.2px solid #111;
  padding: 1.2mm;
  white-space: normal;
}
.cmr-box-label {
  display: flex;
  align-items: baseline;
  gap: 1.5mm;
  margin-bottom: .8mm;
  color: #263244;
  font-size: 6.6pt;
  font-weight: 700;
}
.cmr-box-label strong {
  color: #e42529;
  font-size: 9pt;
}
.cmr-box-value {
  min-height: 7mm;
  font-size: 7.6pt;
  font-weight: 600;
  line-height: 1.3;
}
.cmr-compact { min-height: 11mm; }
.cmr-cargo {
  display: grid;
  grid-template-columns: 1.05fr .7fr .8fr 2fr .75fr .85fr;
  border-right: 1.2px solid #111;
  border-bottom: 1.2px solid #111;
}
.cmr-cargo-cell {
  min-width: 0;
  border-right: 1.2px solid #111;
}
.cmr-cargo-cell:last-child { border-right: 0; }
.cmr-cargo .cmr-box {
  min-height: 29mm;
  border: 0;
}
.cmr-cargo-wide .cmr-box-value { min-height: 19mm; }
.cmr-payment-table {
  display: grid;
  grid-template-columns: 1.25fr .8fr .8fr .8fr;
  border-right: 1.2px solid #111;
  border-bottom: 1.2px solid #111;
  font-size: 7.2pt;
  font-weight: 700;
}
.cmr-payment-table > div {
  min-height: 8mm;
  padding: 1mm;
  border-right: 1.2px solid #111;
  border-bottom: 1.2px solid #111;
}
.cmr-payment-table > div:nth-child(4n) { border-right: 0; }
.cmr-payment-table > div:nth-last-child(-n + 4) { border-bottom: 0; }
.cmr-payment-head {
  display: flex;
  align-items: baseline;
  gap: 1mm;
  color: #263244;
}
.cmr-payment-head strong {
  color: #e42529;
  font-size: 9pt;
}
.cmr-payment-head span {
  color: #263244;
}
.cmr-payment-date-row {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr);
  min-height: 11mm;
  border-right: 1.2px solid #111;
  border-bottom: 1.2px solid #111;
  break-inside: avoid;
  page-break-inside: avoid;
}
.cmr-payment-date-cell {
  min-width: 0;
  padding: 1.2mm;
  border-right: 1.2px solid #111;
  white-space: pre-line;
}
.cmr-payment-date-cell:last-child { border-right: 0; }
.cmr-payment-date-cell .cmr-box-value { min-height: 4mm; }
.cmr-total-row {
  display: grid;
  grid-template-columns: 42mm 1fr 36mm 52mm;
  min-height: 20mm;
  border-right: 1.2px solid #111;
  border-bottom: 1.2px solid #111;
}
.cmr-total-cell {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5mm;
  align-items: start;
  border-right: 1.2px solid #111;
  padding: 2mm;
  font-size: 8.5pt;
  line-height: 1.2;
}
.cmr-total-cell:last-child { border-right: 0; }
.cmr-total-cell strong {
  font-size: 11pt;
  line-height: 1;
}
.cmr-total-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1.2px solid #111;
}
.cmr-oval-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54mm;
  height: 14mm;
  border: 2.8mm solid #2f2f2f;
  border-radius: 50%;
  color: #2f2f2f;
  font-size: 20pt;
  font-weight: 900;
  letter-spacing: 1mm;
  line-height: 1;
}
.cmr-signatures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 33mm;
  border-right: 1.2px solid #111;
  border-bottom: 1.2px solid #111;
}
.cmr-signature-cell {
  position: relative;
  min-width: 0;
  border-right: 1.2px solid #111;
  padding: 1.6mm;
  text-align: center;
}
.cmr-signature-cell:last-child { border-right: 0; }
.cmr-signature-title {
  color: #6c0013;
  font-size: 8.3pt;
  line-height: 1.15;
}
.cmr-signature-value {
  margin-top: 3mm;
  font-size: 7.4pt;
  line-height: 1.25;
  white-space: pre-line;
}
.cmr-agency-logo {
  display: block;
  width: 44mm;
  max-width: 94%;
  max-height: 17mm;
  margin: 4mm auto 0;
  object-fit: contain;
}
.cmr-received-line {
  display: flex;
  justify-content: space-between;
  gap: 6mm;
  margin-top: 3mm;
  color: #6c0013;
  font-size: 8pt;
}
.cmr-goods-received {
  margin-top: 12mm;
  color: #6c0013;
  font-size: 8.5pt;
}
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(15, 23, 42, .72);
  padding: 22px;
}
.pdf-modal.open { display: block; }
.pdf-window {
  height: calc(100vh - 44px);
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 90px rgba(0,0,0,.35);
}
.pdf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.pdf-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pdf-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--marine);
  border-radius: 7px;
  background: var(--marine);
  color: #fff;
  padding: 9px 12px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.pdf-window iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #525659;
}
@media (max-width: 1300px) {
  .app-shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; display: flex; align-items: center; gap: 8px; overflow: auto; }
  .sidebar-logo { width: 180px; margin: 0; }
  .nav { width: auto; white-space: nowrap; margin: 0; }
  .module-grid, .stats { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
}
@media (max-width: 760px) {
  body {
    background: #f4f7fa;
  }
  .sidebar {
    padding: 10px;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }
  .sidebar-logo {
    width: 132px;
    flex: 0 0 auto;
  }
  .nav {
    padding: 8px 10px;
    font-size: 12px;
  }
  .workspace {
    padding: 12px;
  }
  .topbar {
    gap: 10px;
    margin-bottom: 12px;
  }
  .topbar h1 {
    font-size: 20px;
    line-height: 1.2;
  }
  .topbar p {
    font-size: 10px;
  }
  .toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .toolbar input {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }
  .toolbar button {
    min-height: 42px;
    padding: 9px 8px;
    font-size: 12px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
  }
  .stats div {
    padding: 11px;
  }
  .stats strong {
    font-size: 18px;
    word-break: break-word;
  }
  .mobile-tabs {
    display: flex;
  }
  .module-grid {
    display: block;
  }
  .editor,
  .preview,
  .container-workbench {
    overflow: visible;
    border-radius: 8px;
  }
  body[data-mobile-tab="editor"] .preview {
    display: none;
  }
  body[data-mobile-tab="preview"] .editor {
    display: none;
  }
  body[data-mobile-tab="preview"] .container-workbench {
    display: none;
  }
  .editor {
    height: calc(100vh - 24px) !important;
    min-height: calc(100vh - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    overflow: auto !important;
    padding: 12px 12px 140px;
    scroll-padding-bottom: 140px;
  }
  .container-workbench {
    margin-top: 12px;
    padding: 12px;
  }
  .container-head {
    display: none;
  }
  .editor-block {
    padding-bottom: 14px;
    margin-bottom: 14px;
  }
  .editor-block h2 {
    font-size: 14px;
  }
  .grid.two,
  .grid.three,
  .asset-controls {
    grid-template-columns: 1fr;
  }
  .asset-control {
    grid-template-columns: minmax(0, 1fr) 48px;
  }
  input,
  textarea {
    min-height: 42px;
    font-size: 16px;
  }
  textarea {
    min-height: 96px;
  }
  .upload {
    min-height: 44px;
  }
  .row-title {
    align-items: stretch;
    flex-direction: column;
  }
  .row-title button {
    width: 100%;
  }
  .container-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
    padding: 8px;
  }
  .container-row input:first-child {
    grid-column: 1 / -1;
  }
  .container-row button {
    width: 100%;
    min-height: 36px;
    padding: 0 8px;
  }
  .document-list button {
    min-height: 48px;
  }
  .preview {
    padding-bottom: 12px;
  }
  .preview-bar {
    position: sticky;
    top: 53px;
    z-index: 10;
    background: #fff;
  }
  .print-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 10px 0;
    transform: scale(.48);
    transform-origin: top left;
  }
  .preview::after {
    content: "";
    display: block;
    height: calc(297mm * .48 + 20px);
  }
  body[data-mobile-tab="preview"] .preview {
    overflow-x: auto;
  }
  .pdf-modal {
    padding: 8px;
  }
  .pdf-window {
    height: calc(100vh - 16px);
    border-radius: 6px;
  }
  .pdf-header {
    align-items: stretch;
    flex-direction: column;
  }
  .pdf-header > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
@page { size: A4; margin: 7mm 6mm; }
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .stats, .editor, .preview-bar, .container-workbench { display: none !important; }
  .pdf-modal { display: none !important; }
  .workspace, .preview { display: block; padding: 0; border: 0; box-shadow: none; background: #fff; }
  .module-grid { display: block; }
  .print-sheet { width: auto; min-height: auto; margin: 0; box-shadow: none; }
  .doc-header { padding-top: 0; }
}
