#page-content > .container-fluid.doc-tpl-page {
  max-width: none;
}

.doc-tpl-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.doc-tpl-side {
  flex: 0 0 16.5rem;
  width: 16.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.doc-tpl-label {
  margin-top: 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #5c6b7a;
}

.doc-tpl-side .doc-tpl-label:first-child {
  margin-top: 0;
}

.doc-tpl-kind .form-check,
.doc-tpl-checks .form-check {
  margin-bottom: 0.35rem;
}

.doc-tpl-hint {
  margin: 0.8rem 0 0.9rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #6c757d;
}

.doc-tpl-note {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #6c757d;
}

.doc-tpl-download {
  align-self: flex-start;
}

.doc-tpl-preview {
  flex: 1 1 auto;
  min-width: 0;
}

.doc-tpl-warn {
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
  color: #8a5a00;
}

.doc-tpl-fit {
  width: 100%;
  container-type: inline-size;
}

.doc-tpl-sheet {
  width: 190mm;
  zoom: min(1, 100cqi / 190mm);
  background: #fff;
  border: 1px solid #e4e8ee;
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.06);
  color: #1f2933;
  font-size: 11px;
  line-height: 1.35;
}

.doc-tpl-banner {
  background: #2c3e50;
  color: #fff;
  text-align: center;
  font-size: 18px;
  letter-spacing: 0.2em;
  height: 26mm;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-tpl-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem 0.55rem;
}

.doc-tpl-main {
  flex: 1 1 auto;
  min-width: 0;
}

.doc-tpl-to {
  font-size: 0.95rem;
  font-weight: 700;
}

.doc-tpl-meta {
  flex: 0 0 12.5rem;
  width: 12.5rem;
  text-align: right;
}

.doc-tpl-meta-line,
.doc-tpl-issuer-line {
  margin-top: 0.1rem;
}

.doc-tpl-meta-gap {
  height: 10px;
}

.doc-tpl-issuer-name {
  margin-top: 0.45rem;
  font-weight: 700;
}

.doc-tpl-stamp {
  display: block;
  width: 28mm;
  height: 28mm;
  margin: 2mm 0 0 auto;
  object-fit: contain;
}

.doc-tpl-ghost {
  color: #b7c0ca;
}

.doc-tpl-greet {
  white-space: pre-wrap;
  padding: 0.35rem 0 0.55rem;
}

.doc-tpl-overview {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.doc-tpl-overview th,
.doc-tpl-overview td {
  border: 1px solid #d0d5dd;
  padding: 0.28rem 0.4rem;
  vertical-align: middle;
}

.doc-tpl-overview th {
  width: 5.2rem;
  background: #2c3e50;
  color: #fff;
  font-weight: 600;
  text-align: center;
}

.doc-tpl-overview-value {
  white-space: pre-wrap;
  min-height: 1.2rem;
}

.doc-tpl-grid {
  width: calc(100% - 1.8rem);
  margin: 0 0.9rem 0.35rem;
  border-collapse: collapse;
  table-layout: fixed;
}

.doc-tpl-grid th,
.doc-tpl-grid td {
  border: 1px solid #d0d5dd;
  padding: 0 0.15rem;
  text-align: center;
  font-weight: 500;
  height: 7mm;
}

.doc-tpl-grid th {
  background: #2c3e50;
  color: #fff;
  font-size: 10px;
}

.doc-tpl-grid td {
  color: #8b97a3;
}

.doc-tpl-sum {
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  margin: 0 0.9rem;
  padding: 0.18rem 0.4rem;
  background: #f4f6f8;
  border: 1px solid #d0d5dd;
  border-top: 0;
}

.doc-tpl-sum.is-plain {
  background: transparent;
}

.doc-tpl-sum.is-grand {
  margin-top: 0.35rem;
  background: #2c3e50;
  color: #fff;
  border-color: #2c3e50;
}

.doc-tpl-remarks {
  margin: 0.8rem 0.9rem 0.2rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid #2c3e50;
  font-weight: 700;
}

.doc-tpl-remarks-box {
  margin: 0 0.9rem 0.9rem;
  border: 1px solid #d0d5dd;
}

.doc-tpl-caption {
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: #6c757d;
}

@media (max-width: 900px) {
  .doc-tpl-layout {
    flex-direction: column;
  }

  .doc-tpl-side {
    width: 100%;
    flex-basis: auto;
  }

  .doc-tpl-head {
    flex-direction: column;
  }

  .doc-tpl-meta {
    width: 100%;
    flex-basis: auto;
  }
}
