.ap-waybill {
	--ap-red: #bf1c1f;
	--ap-orange: #ff6600;
	--ap-soft: rgba(196, 196, 196, 0.2);
	--ap-line: rgba(0, 0, 0, 0.16);
	--ap-paper-line: #777;
	--ap-paper-pink: #fff0f2;
	padding-top: 3.8125rem;
	font-family: var(--font-family, "Onest", sans-serif);
}

body.page-id-90 .text.container:has(.ap-waybill),
body.page .text.container:has(.ap-waybill) {
	padding-top: 0;
}

body.page-id-90 .text.container:has(.ap-waybill) > .text__title,
body.page .text.container:has(.ap-waybill) > .text__title {
	display: none;
}

.ap-waybill__intro {
	max-width: 52rem;
	margin: 0 auto 3.25rem;
	text-align: center;
}

.ap-waybill .ap-waybill__lead {
	max-width: 42rem;
	margin: 1.25rem auto 0;
	font-size: clamp(1rem, 1.3888888889vw, 1.25rem);
	line-height: 1.35;
	text-align: center !important;
	color: #000;
}

.ap-waybill__notice {
	max-width: 48.5rem;
	margin: 0 auto 1.5rem;
	padding: 1rem 1.25rem;
	border: 0.0625rem solid var(--ap-red);
	border-radius: 0.3125rem;
	background: #fff7f7;
	font-weight: 600;
	color: var(--ap-red);
}

.ap-waybill-form {
	width: 100%;
}

.ap-waybill-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem;
}

.ap-waybill-form__grid--bottom {
	margin-top: 1.25rem;
}

.ap-waybill-card {
	border: 0.0625rem solid var(--ap-red);
	border-radius: 0.3125rem;
	background: #fff;
	overflow: hidden;
}

.ap-waybill-card__head {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1.5rem 1.75rem;
	background: var(--ap-soft);
	border-bottom: 0.0625rem solid rgba(191, 28, 31, 0.25);
}

.ap-waybill-card__number {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 0.3125rem;
	background: var(--ap-red);
	font-weight: 800;
	color: #fff;
}

.ap-waybill-card__title {
	font-size: clamp(1.25rem, 2vw, 1.75rem);
	line-height: 1.2;
}

.ap-waybill-card__heading {
	display: grid;
	gap: 0.35rem;
}

.ap-waybill .ap-waybill-card__note {
	margin: 0;
	font-size: 0.9375rem !important;
	font-weight: 400 !important;
	line-height: 1.25;
	color: rgba(0, 0, 0, 0.5) !important;
}

.ap-waybill-card__fields {
	display: grid;
	gap: 1rem;
	padding: 1.75rem;
}

.ap-waybill-card__fields--compact {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ap-waybill-field {
	display: grid;
	gap: 0.5rem;
	margin: 0;
}

.ap-waybill-field--city-suggest {
	position: relative;
}

.ap-waybill-field--wide {
	grid-column: 1 / -1;
}

.ap-waybill-field__label {
	font-weight: 700;
	font-size: 0.9375rem;
	line-height: 1.25;
	color: #000;
}

.ap-waybill-field__hint {
	margin-top: -0.25rem;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.25;
	color: rgba(0, 0, 0, 0.48);
}

.ap-waybill-city-suggestions {
	display: none;
	max-height: 14rem;
	margin-top: -0.125rem;
	border: 0.0625rem solid rgba(191, 28, 31, 0.28);
	border-radius: 0.3125rem;
	background: #fff;
	box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.12);
	overflow-y: auto;
	z-index: 20;
}

.ap-waybill-city-suggestions.is-open {
	display: block;
}

.ap-waybill-city-suggestions__item {
	padding: 0.75rem 1rem;
	font-size: 0.9375rem;
	line-height: 1.2;
	color: #000;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ap-waybill-city-suggestions__item:hover,
.ap-waybill-city-suggestions__item.is-active {
	background: rgba(191, 28, 31, 0.08);
	color: var(--ap-red);
}

.ap-waybill .form__input,
.ap-waybill .form__textarea {
	max-width: none;
	border: 0.0625rem solid rgba(0, 0, 0, 0.25);
	background: #fff;
	color: #000;
}

.ap-waybill .form__input {
	height: 3rem;
	padding-top: 0.55rem;
	padding-bottom: 0.55rem;
}

.ap-waybill input[name="sender_company"]::placeholder,
.ap-waybill input[name="recipient_company"]::placeholder {
	font-size: 1rem;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.45);
}

.ap-waybill input[name="sender_address"]::placeholder,
.ap-waybill input[name="recipient_address"]::placeholder {
	font-size: 1rem;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.45);
}

.ap-waybill .form__textarea {
	width: 100%;
	min-height: 8rem;
	padding: 1.25rem;
	border-radius: 0.3125rem;
	font-family: var(--font-family, "Onest", sans-serif);
	font-weight: 400;
	font-size: 1rem;
	line-height: 1.35;
	resize: vertical;
}

.ap-waybill-field__textarea--compact {
	height: 3rem;
	min-height: 3rem !important;
	padding-top: 0.55rem !important;
	padding-bottom: 0.55rem !important;
	resize: none !important;
}

.ap-waybill .form__input:focus,
.ap-waybill .form__textarea:focus {
	border-color: var(--ap-red);
	box-shadow: 0 0 0 0.1875rem rgba(191, 28, 31, 0.1);
}

.ap-waybill-payment {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
}

.ap-waybill-dimensions {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 0.5rem;
}

.ap-waybill-dimensions__input {
	min-width: 0;
	font-size: 0.875rem !important;
	text-align: center;
}

.ap-waybill-dimensions__input::placeholder {
	font-size: 0.875rem;
}

.ap-waybill-dimensions__separator {
	font-weight: 700;
	font-size: 1.25rem;
	line-height: 1;
	color: rgba(0, 0, 0, 0.55);
}

.ap-waybill-payment__item {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	min-height: 3.25rem;
	padding: 0.875rem 1rem;
	border: 0.0625rem solid rgba(0, 0, 0, 0.2);
	border-radius: 0.3125rem;
	background: #fff;
	font-weight: 600;
	cursor: pointer;
}

.ap-waybill-payment__item input {
	width: 1rem;
	height: 1rem;
	accent-color: var(--ap-red);
}

.ap-waybill-form__actions {
	display: flex;
	justify-content: center;
	margin-top: 2rem;
}

.ap-waybill-form__submit {
	max-width: 24rem;
	gap: 1.25rem;
}

.ap-waybill--preview {
	padding-bottom: 1rem;
}

.ap-waybill-preview-actions {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 18rem));
	justify-content: center;
	gap: 1rem;
	margin: -1rem auto 2.5rem;
}

.ap-waybill-new-button {
	border: 0.0625rem solid rgba(0, 0, 0, 0.16);
	background: #fff;
	color: #000;
}

.ap-waybill__error-button {
	max-width: 24rem;
	margin: 2rem auto 0;
}

.ap-waybill-preview-copy {
	width: 100%;
	overflow-x: auto;
	padding-bottom: 0.5rem;
}

.ap-waybill-print {
	display: none;
}

.ap-paper {
	width: 100%;
	max-width: 69rem;
	min-width: 57.5rem;
	margin: 0 auto;
	border: 0.09rem solid var(--ap-paper-line);
	background: #fff;
	font-family: Arial, Helvetica, sans-serif;
	color: #222;
}

.ap-paper * {
	box-sizing: border-box;
}

.ap-paper__top {
	display: grid;
	grid-template-columns: 2fr 2fr 1.7fr;
	align-items: start;
	gap: 1.375rem;
	padding: 1.5rem 2.125rem 0.875rem;
}

.ap-paper__logo img {
	display: block;
	width: 18.25rem;
	max-width: 100%;
	height: auto;
}

.ap-paper__barcode {
	text-align: center;
}

.ap-paper__barcode-svg {
	display: block;
	width: 15.625rem;
	height: 4.25rem;
	margin: 0.125rem auto 0;
}

.ap-paper__number {
	margin-top: 0.125rem;
	font-size: 1.35rem;
	line-height: 1;
	letter-spacing: 0.02em;
}

.ap-paper__service {
	min-height: 4.875rem;
	border: 0.09rem solid var(--ap-paper-line);
	text-align: center;
	font-size: 0.875rem;
	line-height: 1.2;
}

.ap-paper__service-title {
	padding: 0.25rem 0.375rem;
}

.ap-paper__service-text {
	padding: 0 0.5rem 0.375rem;
	text-align: left;
	font-size: 0.75rem;
}

.ap-paper__table {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0 2.125rem;
	border-top: 0.09rem solid var(--ap-paper-line);
	border-left: 0.09rem solid var(--ap-paper-line);
}

.ap-paper__cell {
	border-right: 0.09rem solid var(--ap-paper-line);
	border-bottom: 0.09rem solid var(--ap-paper-line);
}

.ap-paper__section-title {
	padding: 0.375rem 0.5rem;
	text-align: center;
	font-size: 0.8125rem;
	line-height: 1.15;
}

.ap-paper__party {
	display: grid;
	align-content: start;
	gap: 0.45rem;
	min-height: 11.75rem;
	padding: 1.75rem 0.75rem 1rem;
}

.ap-paper__tinted {
	background: var(--ap-paper-pink);
	box-shadow: inset 0 0 0 0.09rem #f5bdc1;
}

.ap-paper__line {
	display: grid;
	grid-template-columns: 9.5rem minmax(0, 1fr);
	align-items: end;
	gap: 0.625rem;
	min-height: 1.2rem;
	font-size: 0.8125rem;
	line-height: 1.12;
}

.ap-paper__line span,
.ap-paper__content-row span,
.ap-paper__date-row span,
.ap-paper__signature span {
	font-weight: 400;
}

.ap-paper__line strong,
.ap-paper__content-row strong,
.ap-paper__date-row strong,
.ap-paper__signature strong,
.ap-paper__tariff strong {
	display: block;
	min-height: 1.05rem;
	border-bottom: 0.09rem solid var(--ap-paper-line);
	font-weight: 400;
}

.ap-paper__line--tall {
	min-height: 2.2rem;
}

.ap-paper__line--large {
	min-height: 4.5rem;
	align-items: start;
}

.ap-paper__note {
	display: grid;
	grid-template-columns: 7.5rem minmax(0, 1fr);
	gap: 0.5rem;
	min-height: 2.35rem;
	padding: 0.55rem 0.75rem;
	font-size: 0.8125rem;
	line-height: 1.15;
}

.ap-paper__note strong {
	font-weight: 400;
}

.ap-paper__middle {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin: 0 2.125rem;
	border-left: 0.09rem solid var(--ap-paper-line);
}

.ap-paper__cargo,
.ap-paper__payment {
	border-right: 0.09rem solid var(--ap-paper-line);
	border-bottom: 0.09rem solid var(--ap-paper-line);
}

.ap-paper__cargo {
	display: grid;
	align-content: start;
	gap: 0.45rem;
	padding-top: 0.8rem;
}

.ap-paper__cargo .ap-paper__line {
	padding: 0 0.75rem 0 5.3rem;
	grid-template-columns: 4.5rem minmax(0, 1fr);
}

.ap-paper__content-row {
	display: grid;
	grid-template-columns: 10.5rem minmax(0, 1fr);
	min-height: 4.1rem;
	margin-top: 0.2rem;
	border-top: 0.09rem solid var(--ap-paper-line);
	font-size: 0.8125rem;
}

.ap-paper__content-row span {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem;
	border-right: 0.09rem solid var(--ap-paper-line);
}

.ap-paper__content-row strong {
	min-height: 100%;
	padding: 0.45rem 0.75rem;
	border-bottom: 0;
}

.ap-paper__date-row {
	display: grid;
	grid-template-columns: 12.5rem minmax(0, 1fr);
	align-items: center;
	min-height: 2.05rem;
	padding: 0 0.75rem;
	border-top: 0.09rem solid var(--ap-paper-line);
	background: var(--ap-paper-pink);
	font-size: 0.8125rem;
}

.ap-paper__payment-grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	border-bottom: 0.09rem solid var(--ap-paper-line);
	min-height: 4.25rem;
}

.ap-paper__payment-methods {
	border-right: 0.09rem solid var(--ap-paper-line);
}

.ap-paper__checks {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.35rem 0.75rem;
	padding: 0.15rem 0.875rem 0.55rem;
	font-size: 0.8125rem;
	line-height: 1.1;
}

.ap-paper__check {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.ap-paper__check span {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	box-sizing: border-box;
	width: 0.95rem;
	height: 0.95rem;
	border: 0.09rem solid var(--ap-paper-line);
	background: #fff;
}

.ap-paper__check span.is-checked::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 0.45rem;
	height: 0.68rem;
	border: solid #111;
	border-width: 0 0.14rem 0.14rem 0;
	transform: translate(-50%, -58%) rotate(45deg);
	transform-origin: center;
}

.ap-paper__tariff strong {
	margin: 0.3rem 0.875rem 0;
}

.ap-paper__agreement {
	padding: 0.6rem 1rem 0.55rem;
	text-align: center;
	font-weight: 700;
	font-size: 0.98rem;
	line-height: 1.15;
}

.ap-paper__contacts {
	margin-top: 0.35rem;
	font-weight: 400;
	font-size: 0.76rem;
	line-height: 1.2;
}

.ap-paper__signatures {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0 2.125rem 1.2rem;
	border-left: 0.09rem solid var(--ap-paper-line);
}

.ap-paper__signature-col {
	display: grid;
	gap: 0.95rem;
	padding: 1rem 0.75rem 0.65rem;
	border-right: 0.09rem solid var(--ap-paper-line);
	border-bottom: 0.09rem solid var(--ap-paper-line);
}

.ap-paper__signature {
	display: grid;
	grid-template-columns: 9.3rem minmax(0, 1fr);
	position: relative;
	align-items: end;
	gap: 0.625rem;
	font-size: 0.8125rem;
	line-height: 1.15;
}

.ap-paper__signature em {
	position: absolute;
	right: 2.25rem;
	bottom: -0.75rem;
	font-size: 0.68rem;
	font-style: normal;
}

@media (max-width: 61.99875rem) {
	.ap-waybill {
		padding-top: 2.5rem;
	}

	.ap-waybill-form__grid,
	.ap-waybill-form__grid--bottom {
		grid-template-columns: 1fr;
	}

	.ap-waybill-card__fields--compact {
		grid-template-columns: 1fr;
	}

	.ap-waybill-preview-actions {
		grid-template-columns: 1fr;
		max-width: 20.625rem;
	}
}

@media (max-width: 35.99875rem) {
	.ap-waybill__intro {
		margin-bottom: 2.5rem;
	}

	.ap-waybill-card__head,
	.ap-waybill-card__fields {
		padding-inline: 1.25rem;
	}

	.ap-waybill-payment {
		grid-template-columns: 1fr;
	}

	.ap-waybill-form__submit {
		max-width: 100%;
	}
}

@media print {
	@page {
		size: A4 portrait;
		margin: 5mm;
	}

	html,
	body {
		width: 210mm;
		min-height: 297mm;
		background: #fff !important;
	}

	body * {
		visibility: hidden !important;
	}

	.header,
	.footer,
	.ap-waybill__intro,
	.ap-waybill-preview-actions,
	.ap-waybill-preview-copy {
		display: none !important;
	}

	.ap-waybill,
	.ap-waybill-print,
	.ap-waybill-print * {
		visibility: visible !important;
	}

	.ap-waybill {
		width: auto !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.ap-waybill-print {
		display: block !important;
		position: absolute;
		left: 0;
		top: 0;
		width: 200mm;
		background: #fff;
	}

	.ap-waybill-print-page {
		display: grid;
		grid-template-rows: 143.5mm 143.5mm;
		align-items: start;
		width: 200mm;
		height: 287mm;
		page-break-after: always;
		break-after: page;
	}

	.ap-waybill-print-page:last-child {
		page-break-after: auto;
		break-after: auto;
	}

	.ap-paper {
		width: 198mm;
		min-width: 198mm;
		max-width: 198mm;
		height: 142mm;
		margin: 0 auto;
		overflow: hidden;
		border-width: 0.35mm;
		page-break-inside: avoid;
		break-inside: avoid;
		font-size: 10px;
	}

	.ap-paper__top {
		grid-template-columns: 1.8fr 2fr 1.65fr;
		gap: 4mm;
		padding: 4mm 7mm 2mm;
	}

	.ap-paper__logo img {
		width: 49mm;
	}

	.ap-paper__barcode-svg {
		width: 44mm;
		height: 15mm;
	}

	.ap-paper__number {
		font-size: 5.2mm;
	}

	.ap-paper__service {
		min-height: 13mm;
		font-size: 3mm;
	}

	.ap-paper__service-text {
		font-size: 2.35mm;
	}

	.ap-paper__table,
	.ap-paper__middle,
	.ap-paper__signatures {
		margin-left: 6mm;
		margin-right: 6mm;
	}

	.ap-paper__section-title,
	.ap-paper__line,
	.ap-paper__note,
	.ap-paper__content-row,
	.ap-paper__date-row,
	.ap-paper__checks,
	.ap-paper__signature {
		font-size: 2.65mm;
	}

	.ap-paper__party {
		min-height: 35mm;
		gap: 1mm;
		padding: 4mm 2.5mm 2mm;
	}

	.ap-paper__line {
		grid-template-columns: 30mm minmax(0, 1fr);
		min-height: 4mm;
		gap: 2mm;
	}

	.ap-paper__line--tall {
		min-height: 6.5mm;
	}

	.ap-paper__line--large {
		min-height: 12mm;
	}

	.ap-paper__note {
		grid-template-columns: 25mm minmax(0, 1fr);
		min-height: 6.2mm;
		padding: 1.35mm 2.5mm;
	}

	.ap-paper__cargo {
		gap: 1mm;
		padding-top: 1.9mm;
	}

	.ap-paper__cargo .ap-paper__line {
		grid-template-columns: 15mm minmax(0, 1fr);
		padding-left: 27mm;
		padding-right: 2.5mm;
	}

	.ap-paper__content-row {
		grid-template-columns: 31mm minmax(0, 1fr);
		min-height: 12mm;
	}

	.ap-paper__date-row {
		grid-template-columns: 42mm minmax(0, 1fr);
		min-height: 6mm;
	}

	.ap-paper__payment-grid {
		min-height: 12.4mm;
	}

	.ap-paper__checks {
		gap: 1.15mm 2.5mm;
		padding: 0.7mm 2.8mm 1.5mm;
	}

	.ap-paper__check span {
		width: 3.4mm;
		height: 3.4mm;
	}

	.ap-paper__check span.is-checked::after {
		width: 1.45mm;
		height: 2.15mm;
		border-width: 0 0.42mm 0.42mm 0;
		transform: translate(-50%, -58%) rotate(45deg);
	}

	.ap-paper__agreement {
		padding: 1.5mm 3mm 1.2mm;
		font-size: 3mm;
	}

	.ap-paper__contacts {
		margin-top: 0.8mm;
		font-size: 2.35mm;
	}

	.ap-paper__signatures {
		margin-bottom: 2mm;
	}

	.ap-paper__signature-col {
		gap: 2.35mm;
		padding: 2.2mm 2.5mm 1.6mm;
	}

	.ap-paper__signature {
		grid-template-columns: 31mm minmax(0, 1fr);
	}

	.ap-paper__signature em {
		right: 7mm;
		bottom: -2mm;
		font-size: 2mm;
	}
}
