.hst-signature-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.hst-signature-modal[hidden] {
	display: none;
}

body.hst-signature-modal-open {
	overflow: hidden;
}

.hst-signature-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.hst-signature-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 34rem;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
	padding: 1.25rem 1.5rem 1.5rem;
}

.hst-signature-modal__title {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
}

.hst-signature-modal__intro {
	margin: 0 0 1rem;
	color: #555;
	font-size: 0.95rem;
}

.hst-signature-modal__previous-label,
.hst-signature-modal__draw-label {
	margin: 0 0 0.5rem;
	font-weight: 600;
	font-size: 0.9rem;
}

.hst-signature-modal__previous-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.hst-signature-modal__previous-item {
	display: block;
	padding: 0.35rem;
	border: 2px solid #ddd;
	border-radius: 4px;
	background: #fafafa;
	cursor: pointer;
	outline: none;
	box-shadow: none;
}

.hst-signature-modal__previous-item:focus,
.hst-signature-modal__previous-item:focus-visible {
	outline: none;
	box-shadow: none;
	border-color: #ddd;
}

.hst-signature-modal__previous-item.is-selected,
.hst-signature-modal__previous-item.is-selected:focus,
.hst-signature-modal__previous-item.is-selected:focus-visible {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.hst-signature-modal__previous-item img {
	display: block;
	max-width: 140px;
	max-height: 56px;
	width: auto;
	height: auto;
}

.hst-signature-modal__canvas-wrap {
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	margin-bottom: 1rem;
	touch-action: none;
	width: 100%;
	min-height: 180px;
}

.hst-signature-modal__canvas {
	display: block;
	width: 100%;
	height: 180px;
	cursor: crosshair;
	touch-action: none;
}

.hst-signature-modal__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.5rem;
}

.hst-signature-modal__btn {
	padding: 0.5em 1em;
	border-radius: 3px;
	font-size: 0.95rem;
	cursor: pointer;
	border: 1px solid #ccc;
	background: #fff;
}

.hst-signature-modal__btn--secondary {
	color: #000;
}

.hst-signature-modal__btn--secondary:hover:not(:disabled) {
	background: #f0f0f0;
	color: #000;
}

.hst-signature-modal__btn--primary {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.hst-signature-modal__btn--primary:hover:not(:disabled) {
	background: #135e96;
}

.hst-signature-modal__btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.hst-signature-field {
	margin: 0.35em 0;
}

.hst-signature-field__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.hst-signature-field__ui {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.hst-signature-field__preview {
	display: block;
	max-width: 160px;
	max-height: 64px;
	width: auto;
	height: auto;
	border: 1px solid #ddd;
	border-radius: 3px;
	background: #fff;
	padding: 0.25rem;
}

.hst-signature-field__sign,
.hst-signature-field__remove {
	padding: 0.4em 0.75em;
	border-radius: 3px;
	font-size: 0.9rem;
	cursor: pointer;
	border: 1px solid #ccc;
	background: #fff;
}

.hst-signature-field__sign {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.hst-signature-field__sign:hover {
	background: #135e96;
}

.hst-signature-field__remove:hover {
	background: #f0f0f0;
}
